## Scripts stuck

Bug reports and feature requests. New features can only be added to the current development version. Bug-fixes may be back-ported.

Current release: 099 / Current development: 100
Alwir
New User
Posts: 27
Joined: Sat Aug 26, 2017 2:50 am

### Scripts stuck

Hi there, again

I have some strange problem.

Sometimes all scripts are stuck.

Code: Select all

[08/30 17:54:55] sysload=33 (20) cputime=16109375
[08/30 18:18:58] sysload=40 (3778) cputime=24437500
it's happen for different the time, different number of players(30-90), different interval of time. It can appear every three days or five times per day.
Some scripts work, another scripts no, next time another scripts work, some no

I tryed x64 and x32 cores for windows. Old and new the builds. But this the stuck are present ((

Unfortunately i don't remember last build without this stuck ((.

Can anybody tell where i have to look for? And which information i need get for explain in detail?

PS sorry for my English

Pumpkins
Apprentice Poster
Posts: 52
Joined: Mon Jan 22, 2007 6:06 am

### Re: Scripts stuck

Hello,

What script base are using? The distro?

Alwir
New User
Posts: 27
Joined: Sat Aug 26, 2017 2:50 am

### Re: Scripts stuck

No it's my own scripts.

Yukiko
Distro Developer
Posts: 2773
Joined: Thu Feb 02, 2006 1:41 pm
Location: San Antonio, Texas
Contact:

### Re: Scripts stuck

I don't know the cause of your scripts getting stuck but there is a setting in POL.cfg that might help locate the problem. There is no information in the docs about the setting though. You can try adding it to pol.cfg and see if it reveals any more information.

Code: Select all

ThreadStacktracesWhenStuck=1

Nando
POL Developer
Posts: 269
Joined: Wed Sep 17, 2008 6:53 pm
Contact:

### Re: Scripts stuck

That setting won't help much, Yukiko. The best is to check the debug.log and look for runaway critical scripts.

Yukiko
Distro Developer
Posts: 2773
Joined: Thu Feb 02, 2006 1:41 pm
Location: San Antonio, Texas
Contact:

### Re: Scripts stuck

Thanks Nando. Can elaborate on what the setting does?

Alwir
New User
Posts: 27
Joined: Sat Aug 26, 2017 2:50 am

### Re: Scripts stuck

I check critical and runaway scripts with RunawayScriptThreshold=100000
no it's not this scripts ((
logs don't have any info: LogLevel=3 and DebugLevel=3

to Yukiko:
Server(core) works without problem, all chars can walk, run etc. But scripts don't work for some time and then turn on again.
I try to turn on CacheInteractiveScripts=0 it didn't help

PS and scripts don't turn off at once, players tell me about thats happen one by one for 2-3 minutes.

PPS Memory on server 16Gb

I thought it's some kind of queue in core, but i don't know how i can check it (((
Last edited by Alwir on Thu Aug 31, 2017 8:34 am, edited 1 time in total.

Yukiko
Distro Developer
Posts: 2773
Joined: Thu Feb 02, 2006 1:41 pm
Location: San Antonio, Texas
Contact:

### Re: Scripts stuck

As I understand it it is random which scripts freeze. Is it some scripts from a certain group of scripts that sometimes freeze?

I mean is it random from all your scripts or maybe just "use" scripts that freeze?

Alwir
New User
Posts: 27
Joined: Sat Aug 26, 2017 2:50 am

### Re: Scripts stuck

It's random scripts. Brain, use, walkon etc.
it's can be any scripts (
They are exist in PolCore().script_profiles but don't work

ThisIsMe
Distro Developer
Posts: 97
Joined: Sun Jul 17, 2016 1:29 am
Contact:

### Re: Scripts stuck

Question, does this prevent your save world state from working properly, it sounds like an issue I have where the shard after a random few to a couple weeks of time where the shard, with no players logged in at all in this time save for my staff level one enters into a point where I can't force a SWS nor does the auto SWS trigger every 15 minutes as it should. Everything is functional just not the saving of the world's state.

Alwir
New User
Posts: 27
Joined: Sat Aug 26, 2017 2:50 am

### Re: Scripts stuck

sometimes it turn off scripts with autosave or saving from GM command sometimes no.
Same as another scripts

But the saving via ctrl+c work properly.

Yukiko
Distro Developer
Posts: 2773
Joined: Thu Feb 02, 2006 1:41 pm
Location: San Antonio, Texas
Contact:

### Re: Scripts stuck

Alwir, it might help if we knew which script set your shard is based on. I realize they are your own but most of us started with some basic scripts and built our shards from there.

Nando
POL Developer
Posts: 269
Joined: Wed Sep 17, 2008 6:53 pm
Contact:

### Re: Scripts stuck

Set "RunawayScriptThreshold" to some smaller value, like 1000 or 5000 and see if anything shows up in the debug.log. 100000 is too large.

Yukiko: the option you mentioned is useful only when the core reports "No clock movement in 30 seconds. Dumping thread status.". If I understand correctly, he mostly has large pauses on the scripts but no other error is reported.

Alwir
New User
Posts: 27
Joined: Sat Aug 26, 2017 2:50 am

### Re: Scripts stuck

to Nando
ok i will try with 5000 and tell about. But we have problem, script.log doesn't have time notch (

to Yukiko
sorry (( i have shard more over 10 years since 2005. My scripts isn't based on common basic scripts or this is scripts were fully rewrited

Yukiko
Distro Developer
Posts: 2773
Joined: Thu Feb 02, 2006 1:41 pm
Location: San Antonio, Texas
Contact:

### Re: Scripts stuck

Thanks Nando. So it creates a dump file of the thread status. Ok.

Thanks Alwir. I understand rewriting scripts but sometimes the problem can be based in code left over from the set you started with. Anyway these intermittent problems are tough to track down. So any additional information you can provide may help the developers with your problem.

Alwir
New User
Posts: 27
Joined: Sat Aug 26, 2017 2:50 am

### Re: Scripts stuck

Yukiko yes, of course i undertsand this. But i really don't use any common scripts (
in 2005 if i remember it was start from distro of pol93 but i can mistake. And now, I don't have any packages from common scripts.

And I don't think that this is because of the scripts. It started 3-4 month ago with new core, but i have some mess in my life in that time and I was only restarting serv and didn't look why.

PS about ThreadStacktracesWhenStuck it doesn't create dump file. It creates entry in pol.log like this

Code: Select all

Current StackBackTrace
StackWalker::ShowCallstack - 0x14026c424
d:\pol_test\lib\stackwalker\stackwalker.cpp : 1047
Pol::Clib::HiddenMiniDumper::print_backtrace - 0x1402615df
d:\pol_test\pol-core\clib\mdump.cpp : 282
Pol::Clib::HiddenMiniDumper::TopLevelFilter - 0x140261204
d:\pol_test\pol-core\clib\mdump.cpp : 195
UnhandledExceptionFilter - 0x7ff8d9861f42
(filename not available)
memset - 0x7ff8dc5df133
(filename not available)
_C_specific_handler - 0x7ff8dc5c1d86
(filename not available)
_chkstk - 0x7ff8dc5d33fd
(filename not available)
RtlRaiseException - 0x7ff8dc594847
(filename not available)
KiUserExceptionDispatcher - 0x7ff8dc5d258a
(filename not available)
MoveSmall - 0x14027e6ca
f:\dd\vctools\crt\crtw32\string\amd64\memcpy.asm : 362
Pol::Core::remove_item_from_world - 0x14013a5d4
d:\pol_test\pol-core\pol\uworld.cpp : 69
Pol::Core::destroy_item - 0x140102df6
d:\pol_test\pol-core\pol\ufunc.cpp : 1624
Pol::Module::UOExecutorModule::mf_DestroyItem - 0x1401db723
d:\pol_test\pol-core\pol\module\uomod.cpp : 2910
Pol::Bscript::Executor::execFunc - 0x1402227b2
d:\pol_test\pol-core\bscript\executor.cpp : 830
Pol::Bscript::Executor::ins_func - 0x1402299b3
d:\pol_test\pol-core\bscript\executor.cpp : 2265
Pol::Bscript::Executor::execInstr - 0x140222d45
d:\pol_test\pol-core\bscript\executor.cpp : 3360
Pol::Core::run_executor_to_completion - 0x1400cabc2
d:\pol_test\pol-core\pol\scrsched.cpp : 404
Pol::Core::run_script_to_completion - 0x1400cb1bb
d:\pol_test\pol-core\pol\scrsched.cpp : 478
Pol::Items::Item::run_equip_script - 0x14020b3a8
d:\pol_test\pol-core\pol\item\item.cpp : 1002
Pol::Items::Item::check_equip_script - 0x140207262
d:\pol_test\pol-core\pol\item\item.cpp : 1039
Pol::Core::equip_item - 0x14003cc44
d:\pol_test\pol-core\pol\eqpitem.cpp : 117
Pol::Core::process_data - 0x140187d47
d:\pol_test\pol-core\clib\socketsvc.cpp : 62
(filename not available)
(filename not available)
[04/21 17:51:21] Script                                       cycles  incov    cyc/invoc      %
scripts/misc/chatbutton.ecl                       9      3            3 3.59237e-005
scripts/misc/chrdeath.ecl                      1957      1         1957 0.00781141
scripts/misc/death.ecl                       272285     55         4950 1.08683
pkg/autoquest/altar/map/altarmap.ecl             15      1           15 5.98729e-005
pkg/autoquest/hram/molitva.ecl                  492      1          492 0.00196383
pkg/autoquest/questnpc/brain.ecl               1410      2          705 0.00562805
pkg/autoquest/questnpc/process_events.ecl        76852      2        38426 0.306757
pkg/classes/ranger/masc.ecl                    4990      4         1247 0.0199177
pkg/classes/recalc.ecl                        24714     10         2471 0.0986465
pkg/foundations/control/commands/player/cmdbar.ecl        49142      4        12285 0.196152
pkg/foundations/control/logon.ecl               252      3           84 0.00100586
pkg/foundations/gumps/autoClose.ecl           75072    153          490 0.299652
pkg/foundations/gumps/sendgumpAC.ecl          17482    153          114 0.0697798
pkg/foundations/hooks/attributeCore.ecl       134784      3        44928 0.537994
pkg/items/_gm/teletile_go.ecl                   384      6           64 0.00153275
pkg/items/decorations/stone.ecl               60758     40         1518 0.242517
pkg/items/decorations/unmnt.ecl                2584     17          152 0.0103141
pkg/items/doors/closeDoor.ecl                  7623     47          162 0.0304274
pkg/items/doors/door.ecl                      25161     35          718 0.100431
pkg/items/doors/openDoor.ecl                   7787     49          158 0.031082
pkg/items/doors/setFlow.ecl                     120      8           15 0.000478983
pkg/items/Dungeon-Tool/tilefordung.ecl        88671     73         1214 0.353932
pkg/items/moongates/kanall.ecl                  658      2          329 0.00262642
pkg/items/moongates/kanallst.ecl               1342     18           74 0.00535663
pkg/items/moongates/telerand.ecl               1669      4          417 0.00666185
pkg/items/packet/packet.ecl                     633      1          633 0.00252664
pkg/items/refresh_items/reftile_go.ecl        47496      5         9499 0.189581
pkg/items/resstone/resstone.ecl                 541      1          541 0.00215941
pkg/items/switchers/switcher.ecl               2398      1         2398 0.00957168
pkg/items/traps/control/trapcontrol.ecl        19715    280           70 0.0786929
pkg/items/traps/triggers/hiddenTrap.ecl         9017     37          243 0.0359916
pkg/items/travelstone/travelstone.ecl         39645      1        39645 0.158244
pkg/kernel/AuxRegister/reg_aux.ecl               82      1           82 0.000327305
pkg/kernel/dbaccess/dbaccess.ecl                  0      1            0      0
pkg/kernel/OnlineStatus/logoff.ecl             3473     46           75 0.0138626
pkg/kernel/OnlineStatus/logon.ecl               652      3          217 0.00260247
pkg/kernel/OnlineStatus/StatUpdater.ecl       422378     15        28158 1.68593
pkg/kernel/raiting/dbfish.ecl                  1267      1         1267 0.00505726
pkg/kernel/raiting/dbguild.ecl               129142      1       129142 0.515473
pkg/kernel/raiting/dbraiting.ecl             181817      1       181817 0.725727
pkg/npcs/barber/controlHair.ecl                  58      2           29 0.000231508
pkg/skills/alchemy/alchemy.ecl               441444    106         4164 1.76203
pkg/skills/alchemy/potions/orugpot.ecl         1522      3          507 0.0060751
pkg/skills/armslore/armsLore.ecl               1397      1         1397 0.00557616
pkg/skills/camping/bedroll.ecl                  722      2          361 0.00288188
pkg/skills/carpentry/carpentry.ecl            83387      1        83387 0.332841
pkg/skills/cooking/foodcontrol.ecl             4560    160           28 0.0182014
pkg/skills/cooking/hunger.ecl                  2209      2         1104 0.00881728
pkg/skills/cooking/logon.ecl                     80      3           26 0.000319322
pkg/skills/cooking/razdav.ecl                   172      1          172 0.000686542
pkg/skills/cooking/recalc.ecl                  4178      2         2089 0.0166766
pkg/skills/fishing/fisheffect.ecl            687789   1357          506 2.74533
pkg/skills/fishing/fishing.ecl              1834606     63        29120 7.32288
pkg/skills/healing/blood_bandage.ecl          13604     22          618 0.0543007
pkg/skills/herding/herd.ecl                  120808    112         1078 0.482208
pkg/skills/herding/prokachka.ecl             424724      9        47191 1.6953
pkg/skills/hiding/hiding.ecl                 207253    229          905 0.827255
pkg/skills/itemid/itemID.ecl                   4889      3         1629 0.0195146
pkg/skills/lockpicking/lockpicking.ecl       908651     22        41302 3.6269
pkg/skills/meditation/meditation.ecl          83843      3        27947 0.334661
pkg/skills/mining/logon.ecl                      21      3            7 8.3822e-005
pkg/skills/mining/mining.ecl                 823837    136         6057 3.28837
pkg/skills/mining/smelting.ecl                14333     10         1433 0.0572105
pkg/skills/mining/solved.ecl                 645445    179         3605 2.57631
pkg/skills/musicianship/entice.ecl           581285    488         1191 2.32021
pkg/skills/poisoning/poisonSkill.ecl           1648      1         1648 0.00657803
pkg/skills/removetrap/removeTrap.ecl          48475     42         1154 0.193489
pkg/skills/stealth/stealth.ecl                40723     31         1313 0.162547
pkg/skills/tailoring/makeClothItems.ecl       237979      3        79326 0.949899
pkg/skills/tailoring/scissors.ecl              8053      7         1150 0.0321437
pkg/spells/bless.ecl                          20493     14         1463 0.0817983
pkg/spells/clumsy.ecl                          2139      1         2139 0.00853787
pkg/spells/curse.ecl                           6683      2         3341 0.0266754
pkg/spells/energyField.ecl                     1034      1         1034 0.00412724
pkg/spells/paralyze.ecl                       28828     12         2402 0.115068
pkg/spells/protection.ecl                       980      1          980 0.00391169
pkg/spells/teleport.ecl                       22034      2        11017 0.0879493
pkg/spells/weaken.ecl                          2159      1         2159 0.0086177
pkg/systems/bonussystem/bonustimer.ecl            9      3            3 3.59237e-005
pkg/systems/bonussystem/popup_gump_timer.ecl         5022     16          313 0.0200454
pkg/systems/brain/ai/tamed.ecl                 6528      8          816 0.0260567
pkg/systems/brain/ai/trus.ecl                 69045      2        34522 0.275595
pkg/systems/brain/brain.ecl                 1162783    111        10475 4.64128
pkg/systems/brain/subscripts/detecthide.ecl        80146    228          351 0.319905
pkg/systems/brain/subscripts/healme.ecl        50397    201          250 0.201161
pkg/systems/brain/subscripts/healmyclan.ecl          870      3          290 0.00347263
pkg/systems/cash/convertor.ecl                    6      2            3 2.39491e-005
pkg/systems/cash/create.ecl                    3490    143           24 0.0139304
pkg/systems/cash/destroy.ecl                   2001     81           24 0.00798704
pkg/systems/combat/dclick.ecl                  4068     12          339 0.0162375
pkg/systems/combat/destroy.ecl                 2700      9          300 0.0107771
pkg/systems/combat/equip.ecl                 100629    172          585 0.401663
pkg/systems/combat/unequip.ecl                69318     62         1118 0.276685
pkg/systems/combat/vzlom.ecl                   9091      1         9091 0.036287
pkg/systems/delayactions/delayact.ecl         22130    365           60 0.0883324
pkg/systems/delayactions/delaydmg.ecl         12354    316           39 0.0493113
pkg/systems/delayactions/delaymeffect.ecl          376      4           94 0.00150081
pkg/systems/delayactions/delayparalaze.ecl           28      1           28 0.000111763
pkg/systems/delayactions/delaypoisoning.ecl         4424    316           14 0.0176585
pkg/systems/delayactions/delaysfx.ecl         35428    788           44 0.141412
pkg/systems/delayactions/delayshowdmg.ecl       253848    325          781 1.01324
pkg/systems/events/tabletime.ecl               4709      8          588 0.0187961
pkg/systems/housing/hlock.ecl                 28863      3         9621 0.115207
pkg/systems/housing/houseBanning.ecl           4497     14          321 0.0179499
pkg/systems/housing/secureCont.ecl           999277    104         9608 3.98864
pkg/systems/massonry/doloto.ecl               27495     32          859 0.109747
pkg/systems/merchantnodes/restock.ecl        120695    178          678 0.481757
pkg/systems/negative/logon.ecl                   72      3           24 0.00028739
pkg/systems/negative/subscript/temps/decall.ecl         9394      9         1043 0.0374964
pkg/systems/negative/subscript/temps/decdex.ecl         2480      4          620 0.00989898
pkg/systems/negative/subscript/temps/decint.ecl         1557      3          519 0.0062148
pkg/systems/negative/subscript/temps/decstr.ecl         4539      7          648 0.0181175
pkg/systems/negative/subscript/temps/incall.ecl         8580      4         2145 0.0342473
pkg/systems/negative/subscript/temps/navoz.ecl         2854     10          285 0.0113918
pkg/systems/negative/subscript/temps/paral.ecl        11640     12          970 0.0464613
pkg/systems/negative/watch/negative.ecl         3781      8          472 0.015092
pkg/systems/PacketHooks/megacliloc/chardata.ecl      2200091   4409          499 8.78172
pkg/systems/plants/zatopt.ecl                   522     29           18 0.00208358
pkg/systems/QuestArrowEx/QuestArrowEx.ecl          447      1          447 0.00178421
pkg/systems/sleeps/logon.ecl                   2005      3          668 0.00800301
pkg/systems/sleeps/sleep.ecl                  12652      1        12652 0.0505008
pkg/systems/spawnSystem/engines/itemFill/spawnCycle.ecl       250446     44         5691 0.999661
pkg/systems/spawnSystem/engines/npcFill/spawnCycle.ecl      1489708    507         2938 5.94621
pkg/systems/timer/autoCloses.ecl              83429   3631           22 0.333009
pkg/systems/timer/gumpicon.ecl                  987      3          329 0.00393963
pkg/systems/timer/icons.ecl                 1990387   3631          548 7.94468
pkg/systems/timer/logon.ecl                      72      3           24 0.00028739
pkg/tools/motd/logon.ecl                         33      3           11 0.00013172
pkg/tools/motd/textcmd/player/news.ecl       209958      3        69986 0.838053
scripts/boneControl.ecl                          15      1           15 5.98729e-005
scripts/console/shutdown.ecl                 184266      1       184266 0.735502
scripts/control/bloodRemove.ecl                2455     13          188 0.00979919
scripts/control/canInsert.ecl                174318   1383          126 0.695795
scripts/control/canRemove.ecl                144880    490          295 0.578292
scripts/control/corpseControl.ecl            236335     56         4220 0.943337
scripts/control/corpseRemove.ecl               1237     30           41 0.00493752
scripts/control/destroycontainer.ecl           8718    102           85 0.0347981
scripts/control/onInsert.ecl                  12556    662           18 0.0501176
scripts/control/onInsert_backpack.ecl         39098    720           54 0.156061
scripts/control/onRemove.ecl                  96280    460          209 0.384304
scripts/control/trashInsert.ecl                2862      9          318 0.0114237
scripts/doRes.ecl                               783      3          261 0.00312536
scripts/items/opencorpse.ecl                   1222     47           26 0.00487764
scripts/misc/dblclickitem.ecl                 15876   1323           12 0.0633694
scripts/misc/equiptest.ecl                     1165    233            5 0.00465013
scripts/misc/logoff.ecl                       25173     46          547 0.100479
scripts/misc/logofftest.ecl                   33135     45          736 0.132259
scripts/misc/logon.ecl                        40993      3        13664 0.163625
scripts/misc/pogoda.ecl                         270      3           90 0.00107771
scripts/misc/reclama.ecl                      39373     74          532 0.157158
scripts/misc/tips.ecl                          4479     73           61 0.017878
scripts/textcmd/player/heal.ecl              882805   1338          659 3.52374
scripts/textcmd/seer/go.ecl                   51050      1        51050 0.203767
scripts/www/running_scripts.ecl               78746      5        15749 0.314317
scripts/www/time.ecl                             12      1           12 4.78983e-005
but only when server crash down

PS i am mistake a little. I started from pol92

Code: Select all

# $Id: pkg.cfg 373 2006-06-17 18:27:33Z austinheilman$
#
#
Enabled		1
Name		datafile
Version		2.0

CoreRequired	92
Requires	gumps 1.2
Requires	control 2.0

Creator		Austin Heilman
Email		AustinHeilman@gmail.com
Maintainer	Austin Heilman
Email		AustinHeilman@gmail.com

#conflicts	none
it is from oldest package nearly without changes

Pumpkins
Apprentice Poster
Posts: 52
Joined: Mon Jan 22, 2007 6:06 am

### Re: Scripts stuck

Alwir,

try posting all your .logs or atleast debug.log

Alwir
New User
Posts: 27
Joined: Sat Aug 26, 2017 2:50 am

### Re: Scripts stuck

Ok I will post logs(debug, script, pol .log) when I will get this bug another time.

But debug and scripts don't have time notch ((( It's will be very big files without explain where and when was bug

DevGIB
Grandmaster Poster
Posts: 247
Joined: Mon Feb 06, 2006 6:12 am

### Re: Scripts stuck

Delete the files and start fresh.