The International Simutrans Forum

 

Author Topic: Crash with scripted tool  (Read 308 times)

0 Members and 1 Guest are viewing this topic.

Offline Yona-TYT

  • Devotee
  • *
  • Posts: 1624
    • Simutrans-BLOG
  • Languages: ES
Crash with scripted tool
« on: September 02, 2020, 11:31:45 AM »
I have noticed that "pl" is not integral, unlike scenario scripts.  ???



I'm afraid something caused an error and simutrans stopped working.
Update:
It seems that the error occurs when switching between players who already had the tool previously selected.
Code: [Select]
Thread 1 "sim" received signal SIGSEGV, Segmentation fault.script_vm_t::intern_prepare_pending_callback (this=this@entry=0x0,
    function=function@entry=0x5555559bb318 "exec_script_base_work_callback",
    nret=nret@entry=3) at script/script.cc:561
561        BEGIN_STACK_WATCH(vm);
(gdb) where
#0  script_vm_t::intern_prepare_pending_callback (this=this@entry=0x0,
    function=function@entry=0x5555559bb318 "exec_script_base_work_callback",
    nret=nret@entry=3) at script/script.cc:561
#1  0x000055555591b0fe in script_vm_t::prepare_callback<exec_script_base_t*, player_t*, char const*> (arg3=<optimized out>, arg2=<optimized out>,
    arg1=<optimized out>, nret=3,
    function=0x5555559bb318 "exec_script_base_work_callback", this=0x0)
    at script/script.h:175
#2  tool_exec_script_t::work (this=0x555558be9bf0, player=0x5555751b5760,
    pos=...) at simtool-scripted.cc:243
#3  0x0000555555932ecb in karte_t::call_work (this=<optimized out>,
    tool=tool@entry=0x555558be9bf0, player=player@entry=0x5555751b5760,
    pos=..., suspended=@0x7fffffffae74: false) at simworld.cc:6851
#4  0x00005555558dbe4f in interaction_t::interactive_event (
    this=this@entry=0x55555946cb70, ev=...) at siminteraction.cc:239
#5  0x00005555558dc576 in interaction_t::process_event (
    this=this@entry=0x55555946cb70, ev=...) at siminteraction.cc:417
#6  0x00005555558dc6bf in interaction_t::check_events (this=0x55555946cb70)
    at siminteraction.cc:439
#7  0x000055555593abcb in karte_t::interactive (
    this=this@entry=0x555571241d60, quit_month=quit_month@entry=2147483647)
    at simworld.cc:7156
#8  0x00005555558e4dec in simu_main (argc=argc@entry=1,
---Type <return> to continue, or q <return> to quit---
Code: [Select]
Thread 1 "sim" received signal SIGSEGV, Segmentation fault.
script_vm_t::intern_prepare_pending_callback (this=this@entry=0x0,
    function=function@entry=0x5555559bb318 "exec_script_base_work_callback",
    nret=nret@entry=3) at script/script.cc:561
561        BEGIN_STACK_WATCH(vm);
(gdb) where
#0  script_vm_t::intern_prepare_pending_callback (this=this@entry=0x0,
    function=function@entry=0x5555559bb318 "exec_script_base_work_callback",
    nret=nret@entry=3) at script/script.cc:561
#1  0x000055555591b0fe in script_vm_t::prepare_callback<exec_script_base_t*, player_t*, char const*> (arg3=<optimized out>, arg2=<optimized out>,
    arg1=<optimized out>, nret=3,
    function=0x5555559bb318 "exec_script_base_work_callback", this=0x0)
    at script/script.h:175
#2  tool_exec_script_t::work (this=0x555558be7b90, player=0x55557122cd10,
    pos=...) at simtool-scripted.cc:243
#3  0x0000555555932ecb in karte_t::call_work (this=<optimized out>,
    tool=tool@entry=0x555558be7b90, player=player@entry=0x55557122cd10,
    pos=..., suspended=@0x7fffffffae74: false) at simworld.cc:6851
#4  0x00005555558dbe4f in interaction_t::interactive_event (
    this=this@entry=0x5555593c6da0, ev=...) at siminteraction.cc:239
#5  0x00005555558dc576 in interaction_t::process_event (
    this=this@entry=0x5555593c6da0, ev=...) at siminteraction.cc:417
#6  0x00005555558dc6bf in interaction_t::check_events (this=0x5555593c6da0)
    at siminteraction.cc:439
#7  0x000055555593abcb in karte_t::interactive (
    this=this@entry=0x555571236e60, quit_month=quit_month@entry=2147483647)
    at simworld.cc:7156
#8  0x00005555558e4dec in simu_main (argc=argc@entry=1,
---Type <return> to continue, or q <return> to quit---
Capture:
« Last Edit: September 03, 2020, 04:39:42 PM by Dwachs »

Offline Yona-TYT

  • Devotee
  • *
  • Posts: 1624
    • Simutrans-BLOG
  • Languages: ES
Re: Re: A tool to execute squirrel script
« Reply #1 on: September 03, 2020, 10:58:26 AM »
  I'm afraid something caused an error and simutrans stopped working. Update: It seems that the error occurs when switching between players who already had the tool previously selected.
Code: [Select]
Thread 1 "sim" received signal SIGSEGV, Segmentation fault.script_vm_t::intern_prepare_pending_callback (this=this@entry=0x0, function=function@entry=0x5555559bb318 "exec_script_base_work_callback", nret=nret@entry=3) at script/script.cc:561 561        BEGIN_STACK_WATCH(vm); (gdb) where #0  script_vm_t::intern_prepare_pending_callback (this=this@entry=0x0, function=function@entry=0x5555559bb318 "exec_script_base_work_callback", nret=nret@entry=3) at script/script.cc:561 #1  0x000055555591b0fe in script_vm_t::prepare_callback (arg3=, arg2=, arg1=, nret=3, function=0x5555559bb318 "exec_script_base_work_callback", this=0x0) at script/script.h:175 #2  tool_exec_script_t::work (this=0x555558be9bf0, player=0x5555751b5760, pos=...) at simtool-scripted.cc:243 #3  0x0000555555932ecb in karte_t::call_work (this=, tool=tool@entry=0x555558be9bf0, player=player@entry=0x5555751b5760, pos=..., suspended=@0x7fffffffae74: false) at simworld.cc:6851 #4  0x00005555558dbe4f in interaction_t::interactive_event ( this=this@entry=0x55555946cb70, ev=...) at siminteraction.cc:239 #5  0x00005555558dc576 in interaction_t::process_event ( this=this@entry=0x55555946cb70, ev=...) at siminteraction.cc:417 #6  0x00005555558dc6bf in interaction_t::check_events (this=0x55555946cb70) at siminteraction.cc:439 #7  0x000055555593abcb in karte_t::interactive ( this=this@entry=0x555571241d60, quit_month=quit_month@entry=2147483647) at simworld.cc:7156 #8  0x00005555558e4dec in simu_main (argc=argc@entry=1, ---Type  to continue, or q  to quit---
Code: [Select]
Thread 1 "sim" received signal SIGSEGV, Segmentation fault. script_vm_t::intern_prepare_pending_callback (this=this@entry=0x0, function=function@entry=0x5555559bb318 "exec_script_base_work_callback", nret=nret@entry=3) at script/script.cc:561 561        BEGIN_STACK_WATCH(vm); (gdb) where #0  script_vm_t::intern_prepare_pending_callback (this=this@entry=0x0, function=function@entry=0x5555559bb318 "exec_script_base_work_callback", nret=nret@entry=3) at script/script.cc:561 #1  0x000055555591b0fe in script_vm_t::prepare_callback (arg3=, arg2=, arg1=, nret=3, function=0x5555559bb318 "exec_script_base_work_callback", this=0x0) at script/script.h:175 #2  tool_exec_script_t::work (this=0x555558be7b90, player=0x55557122cd10, pos=...) at simtool-scripted.cc:243 #3  0x0000555555932ecb in karte_t::call_work (this=, tool=tool@entry=0x555558be7b90, player=player@entry=0x55557122cd10, pos=..., suspended=@0x7fffffffae74: false) at simworld.cc:6851 #4  0x00005555558dbe4f in interaction_t::interactive_event ( this=this@entry=0x5555593c6da0, ev=...) at siminteraction.cc:239 #5  0x00005555558dc576 in interaction_t::process_event ( this=this@entry=0x5555593c6da0, ev=...) at siminteraction.cc:417 #6  0x00005555558dc6bf in interaction_t::check_events (this=0x5555593c6da0) at siminteraction.cc:439 #7  0x000055555593abcb in karte_t::interactive ( this=this@entry=0x555571236e60, quit_month=quit_month@entry=2147483647) at simworld.cc:7156 #8  0x00005555558e4dec in simu_main (argc=argc@entry=1, ---Type  to continue, or q  to quit--- Capture:


@Dwachs
Have you managed to replicate this?

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4878
  • Languages: EN, DE, AT
Re: Re: A tool to execute squirrel script
« Reply #2 on: September 03, 2020, 04:21:36 PM »
I got the crash once, but not reliably.

Edit: Got it. Just changing player, then call the tool with original player agian.

Edit2: Should be fixed with r9207.
« Last Edit: September 03, 2020, 04:38:13 PM by Dwachs »