omf2097 / openomf

One Must Fall 2097 Remake
http://www.openomf.org
MIT License
362 stars 35 forks source link

Had a Segfault related to scripts and scraps in demo mode #502

Closed joyrider3774 closed 3 months ago

joyrider3774 commented 7 months ago

Hi,

After the SDL_Mixer fixes, i left the engine running under GDB while i was sleeping to see if it would still be running when i woke up and if the sound still caused issues. When i woke up the engine was no longer running but it seems it was not a crash related to audio but related to scripts and the scrap state. I have stacktrace.

this was the last thing the game showed before the crash

image

Thread 1 "openomf" received signal SIGSEGV, Segmentation fault.
_sd_script_get_tag (frame=0x555557550940, tag=0x5555556355cb "bu") at /mnt/c/github/openomf/src/formats/script.c:380
380             if(strcmp(tag, frame->tags[i].key) == 0) {
(gdb) bt
#0  _sd_script_get_tag (frame=0x555557550940, tag=0x5555556355cb "bu")
    at /mnt/c/github/openomf/src/formats/script.c:380
#1  0x0000555555577a71 in sd_script_get_tag (frame=0x555557550940, tag=0x5555556355cb "bu")
    at /mnt/c/github/openomf/src/formats/script.c:391
#2  0x0000555555577a96 in sd_script_isset (frame=0x555557550940, tag=0x5555556355cb "bu")
    at /mnt/c/github/openomf/src/formats/script.c:395
#3  0x000055555559508f in player_run (obj=0x5555577a7eb0) at /mnt/c/github/openomf/src/game/protos/player.c:590
#4  0x00005555555916ea in object_dynamic_tick (obj=0x5555577a7eb0)
    at /mnt/c/github/openomf/src/game/protos/object.c:284
#5  0x000055555557d4f3 in game_state_call_tick (gs=0x5555572ab690, mode=0)
    at /mnt/c/github/openomf/src/game/game_state.c:599
#6  0x000055555557d9ee in game_state_dynamic_tick (gs=0x5555572ab690)
    at /mnt/c/github/openomf/src/game/game_state.c:707
#7  0x000055555555e199 in engine_run (init_flags=0x7fffffffd750) at /mnt/c/github/openomf/src/engine.c:234
#8  0x000055555555da45 in main (argc=1, argv=0x7fffffffd9d8) at /mnt/c/github/openomf/src/main.c:226
(gdb)

and these are the last few things it mentioned in debug mode before the crash happened

[   1682][E] audio_play_sound(): Unable to play sound: No free channels
[   1686][D] ai_har_event(): Reset tactic queue: EVENT_BLOCK
[   1686][D] queue_tactic(): HAR 8 queued tactic: TRIP
[   1686][D] object_set_custom_string(): Set animation string to A5
[   1686][E] audio_play_sound(): Unable to play sound: No free channels
[   1686][E] audio_play_sound(): Unable to play sound: No free channels
[   1687][D] match_move(): matched move 19 with string K1
[   1687][D] har_take_damage(): applying 18432.000000 stun damage to 35261.218750
[   1687][D] object_set_custom_string(): Set animation string to s2l50bl7A1-B1-C4-B3-A2
[   1687][E] audio_play_sound(): Unable to play sound: No free channels
[   1687][D] har_collide_with_har(): HAR ELECTRA to HAR GARGOYLE collision at 106,165!
[   1687][D] har_collide_with_har(): HAR GARGOYLE animation set to s2l50bl7A1-B1-C4-B3-A2
[   1687][D] har_collide_with_har(): HAR GARGOYLE going to next move 36
[   1688][D] har_collide_with_har(): COLLISIONS: Disabled for this frame.
[   1689][D] har_collide_with_har(): COLLISIONS: Disabled for this frame.
[   1690][D] har_act(): standing move led to airborne one
[   1690][D] har_collide_with_har(): COLLISIONS: Disabled for this frame.
[   1691][D] har_collide_with_har(): COLLISIONS: Disabled for this frame.
[   1692][D] har_collide_with_har(): COLLISIONS: Disabled for this frame.
[   1693][D] har_collide_with_har(): COLLISIONS: Disabled for this frame.
[   1694][D] har_collide_with_har(): COLLISIONS: Disabled for this frame.
[   1695][D] har_collide_with_har(): COLLISIONS: Disabled for this frame.
[   1696][D] har_collide_with_har(): COLLISIONS: Disabled for this frame.
[   1697][D] har_collide_with_har(): COLLISIONS: Disabled for this frame.
[   1697][D] arena_har_hook(): RECOVER 1
[   1698][D] queue_tactic(): HAR 8 queued tactic: CLOSE
[   1698][D] har_collide_with_har(): COLLISIONS: Disabled for this frame.
[   1699][D] har_collide_with_har(): COLLISIONS: Disabled for this frame.
[   1700][D] har_collide_with_har(): COLLISIONS: Disabled for this frame.
[   1701][D] har_collide_with_har(): COLLISIONS: Disabled for this frame.
[   1702][D] har_collide_with_har(): COLLISIONS: Disabled for this frame.
[   1703][D] har_collide_with_har(): COLLISIONS: Disabled for this frame.
[   1704][D] har_collide_with_har(): COLLISIONS: Disabled for this frame.
[   1705][D] har_collide_with_har(): COLLISIONS: Disabled for this frame.
[   1706][D] har_collide_with_har(): COLLISIONS: Disabled for this frame.
[   1707][D] har_collide_with_har(): COLLISIONS: Disabled for this frame.
[   1707][D] arena_har_hit_wall_hook(): Player 0 hit wall 0
[   1708][D] har_collide_with_har(): COLLISIONS: Disabled for this frame.
[   1708][D] arena_har_hit_wall_hook(): Player 0 hit wall 0
[   1709][D] har_collide_with_har(): COLLISIONS: Disabled for this frame.
[   1709][D] arena_har_hit_wall_hook(): Player 0 hit wall 0
[   1710][D] arena_har_hit_wall_hook(): Player 0 hit wall 0
[   1710][D] arena_har_hook(): LAND 0
[   1710][D] queue_tactic(): HAR 4 queued tactic: COUNTER
[   1731][D] match_move(): matched move 34 with string P6
[   1731][D] ai_har_event(): Reset tactic queue: EVENT_TAKE_HIT
[   1731][D] har_take_damage(): applying 26112.000000 stun damage to 0.000000
[   1731][D] har_take_damage(): Slowdown: Slowing from 10 to 0.
[   1731][D] object_set_custom_string(): Set animation string to ex-40A20-ex-40y-20J3-eoy-90frM3-eoy-90x+30frL3-ex+40oy-82rfhA6-gvx-4y-10arfoy-82bb11l40s4A1-x-20ox-20L1-ox-20L2-x-20zzs4l25sp13M1-zzM200
[   1731][D] player_run(): E: pos.x = 117.000000, pos.y = 190.000000
[   1731][D] har_collide_with_har(): HAR GARGOYLE to HAR ELECTRA collision at 0,0!
[   1731][D] har_collide_with_har(): HAR ELECTRA animation set to ex-40A20-ex-40y-20J3-eoy-90frM3-eoy-90x+30frL3-ex+40oy-82rfhA6-gvx-4y-10arfoy-82bb11l40s4A1-M500
[   1731][D] player_run(): E: pos.x = 117.000000, pos.y = 190.000000
[   1732][D] player_run(): E: pos.x = 122.000000, pos.y = 190.000000
[   1733][D] player_run(): E: pos.x = 127.000000, pos.y = 190.000000
[   1734][D] player_run(): E: pos.x = 132.000000, pos.y = 190.000000
[   1735][D] player_run(): E: pos.x = 137.000000, pos.y = 190.000000
[   1736][D] player_run(): E: pos.x = 137.000000, pos.y = 186.000000
[   1736][D] har_tick(): switching to fallen
[   1737][D] player_run(): E: pos.x = 137.000000, pos.y = 182.000000
[   1738][D] player_run(): E: pos.x = 137.000000, pos.y = 178.000000
[   1739][D] player_run(): E: pos.x = 137.000000, pos.y = 174.000000
[   1740][D] player_run(): E: pos.x = 137.000000, pos.y = 170.000000
[   1741][D] player_run(): E: pos.x = 137.000000, pos.y = 164.000000
[   1742][D] player_run(): E: pos.x = 137.000000, pos.y = 158.000000
[   1743][D] player_run(): E: pos.x = 137.000000, pos.y = 152.000000
[   1744][D] player_run(): E: pos.x = 137.000000, pos.y = 146.000000
[   1745][D] player_run(): E: pos.x = 137.000000, pos.y = 140.000000
[   1746][D] game_state_call_tick(): Slowdown: Speed back up from 0 to 10.
[   1746][D] player_run(): E: pos.x = 137.000000, pos.y = 134.000000
[   1747][D] player_run(): E: pos.x = 137.000000, pos.y = 128.000000
[   1748][D] player_run(): E: pos.x = 137.000000, pos.y = 122.000000
[   1749][D] player_run(): E: pos.x = 137.000000, pos.y = 116.000000
[   1750][D] queue_tactic(): HAR 8 queued tactic: FLY
[   1750][D] player_run(): E: pos.x = 137.000000, pos.y = 110.000000
[   1751][D] har_act(): standing move led to airborne one
[   1751][D] player_run(): E: pos.x = 140.000000, pos.y = 106.000000
[   1752][D] player_run(): E: pos.x = 143.000000, pos.y = 102.000000
[   1753][D] player_run(): E: pos.x = 146.000000, pos.y = 98.000000
[   1753][D] player_run(): O_CORRECTION: Y = -90
[   1754][D] player_run(): E: pos.x = 153.000000, pos.y = 98.000000
[   1755][D] player_run(): E: pos.x = 160.000000, pos.y = 98.000000
[   1756][D] player_run(): E: pos.x = 167.000000, pos.y = 98.000000
[   1756][D] player_run(): O_CORRECTION: Y = -90
[   1757][D] player_run(): E: pos.x = 170.000000, pos.y = 102.000000
[   1758][D] player_run(): E: pos.x = 173.000000, pos.y = 106.000000
[   1759][D] player_run(): E: pos.x = 176.000000, pos.y = 110.000000
[   1759][D] player_run(): O_CORRECTION: Y = -82
[   1759][D] player_run(): O_CORRECTION: Y = -82
[   1760][D] player_run(): E: pos.x = 176.000000, pos.y = 122.000000
[   1761][D] player_run(): E: pos.x = 176.000000, pos.y = 134.000000
[   1762][D] player_run(): E: pos.x = 176.000000, pos.y = 146.000000
[   1763][D] player_run(): E: pos.x = 176.000000, pos.y = 158.000000
[   1764][D] player_run(): E: pos.x = 176.000000, pos.y = 170.000000
[   1765][D] player_run(): O_CORRECTION: Y = -82
[   1766][D] player_run(): O_CORRECTION: X = -20
[   1767][D] player_run(): O_CORRECTION: X = -20
[   1771][D] arena_har_hook(): LAND 1
[   1775][D] match_move(): matched move 18 with string K2
[   1795][E] audio_play_sound(): Unable to play sound: No free channels
[   1808][E] audio_play_sound(): Unable to play sound: No free channels
[   1830][D] match_move(): CHAINING
[   1830][D] match_move(): matched move 31 with string P63214
[   1830][D] har_act(): going to scrap state
[   1830][D] object_set_custom_string(): Set animation string to gO121-gm55mx+39my-3s28l60N1-gm55mx-6my+3sw40N1-gm12mx+20mi20N1-M3-N2-O2000
[   1833][D] har_act(): state is 13
[   1834][D] har_act(): state is 13
[   1835][D] har_act(): state is 13
[   1836][D] har_act(): state is 13
[   1837][D] har_act(): state is 13
[   1838][D] har_act(): state is 13
[   1839][D] har_act(): state is 13
[   1840][D] har_act(): state is 13
[   1841][D] har_act(): state is 13
[   1842][D] har_act(): state is 13
[   1843][D] har_act(): state is 13
[   1844][D] har_act(): state is 13
[   1845][D] har_act(): state is 13
[   1846][D] har_act(): state is 13
[   1847][D] har_act(): state is 13
[   1848][D] har_act(): state is 13
[   1849][D] har_act(): state is 13
[   1850][D] har_act(): state is 13
[   1851][D] har_act(): state is 13
[   1852][D] har_act(): state is 13
[   1853][D] har_act(): state is 13
[   1854][D] har_act(): state is 13
[   1855][D] har_act(): state is 13
[   1856][D] har_act(): state is 13
[   1858][D] har_act(): state is 13
[   1859][D] har_act(): state is 13
[   1860][D] har_act(): state is 13
[   1886][D] har_act(): state is 13
[   1887][D] har_act(): state is 13
[   1888][D] har_act(): state is 13
[   1889][D] har_act(): state is 13
[   1890][D] har_act(): state is 13
[   1891][D] har_act(): state is 13
[   1892][D] har_act(): state is 13
[   1893][D] har_act(): state is 13
[   1894][D] har_act(): state is 13
[   1895][D] har_act(): state is 13
[   1896][D] har_act(): state is 13
[   1897][D] har_act(): state is 13
[   1898][D] har_act(): state is 13
[   1899][D] har_act(): state is 13
[   1900][D] har_act(): state is 13
[   1901][D] har_act(): state is 13
[   1902][D] har_act(): state is 13
[   1903][D] har_act(): state is 13
[   1904][D] har_act(): state is 13
[   1905][D] har_act(): state is 13
[   1905][D] player_run(): E: pos.x = 132.000000, pos.y = 190.000000
[   1906][D] har_act(): state is 13
[   1906][D] player_run(): E: pos.x = 132.000000, pos.y = 190.000000
[   1907][D] player_run(): E: pos.x = 132.000000, pos.y = 190.000000
[   1908][D] player_run(): E: pos.x = 132.000000, pos.y = 190.000000
[   1909][D] har_act(): state is 13
[   1909][D] player_run(): E: pos.x = 132.000000, pos.y = 190.000000
[   1910][D] har_act(): state is 13
[   1910][D] player_run(): E: pos.x = 132.000000, pos.y = 190.000000
[   1911][D] har_act(): state is 13
[   1911][D] player_run(): E: pos.x = 132.000000, pos.y = 190.000000
[   1912][D] har_act(): state is 13
[   1912][D] player_run(): E: pos.x = 132.000000, pos.y = 190.000000
[   1913][D] har_act(): state is 13
[   1913][D] player_run(): E: pos.x = 132.000000, pos.y = 190.000000
[   1914][D] har_act(): state is 13
[   1914][D] player_run(): E: pos.x = 132.000000, pos.y = 190.000000
[   1915][D] har_act(): state is 13
[   1915][D] player_run(): E: pos.x = 132.000000, pos.y = 190.000000
[   1916][D] har_act(): state is 13
[   1916][D] player_run(): E: pos.x = 132.000000, pos.y = 190.000000
[   1917][D] har_act(): state is 13
[   1917][D] player_run(): E: pos.x = 132.000000, pos.y = 190.000000
[   1918][D] har_act(): state is 13
[   1918][D] player_run(): E: pos.x = 132.000000, pos.y = 190.000000
[   1919][D] har_act(): state is 13
[   1919][D] player_run(): E: pos.x = 132.000000, pos.y = 190.000000
[   1920][D] har_act(): state is 13
[   1920][D] player_run(): E: pos.x = 132.000000, pos.y = 190.000000
[   1921][D] har_act(): state is 13
[   1921][D] player_run(): E: pos.x = 132.000000, pos.y = 190.000000
[   1922][D] har_act(): state is 13
[   1922][D] player_run(): E: pos.x = 132.000000, pos.y = 190.000000
[   1923][D] har_act(): state is 13
[   1923][D] player_run(): E: pos.x = 132.000000, pos.y = 190.000000
[   1924][D] har_act(): state is 13
[   1924][D] player_run(): E: pos.x = 132.000000, pos.y = 190.000000
[   1925][D] har_act(): state is 13
[   1925][D] player_run(): E: pos.x = 132.000000, pos.y = 190.000000
[   1926][D] har_act(): state is 13
[   1926][D] player_run(): E: pos.x = 132.000000, pos.y = 190.000000
[   1927][D] har_act(): state is 13
[   1927][D] player_run(): E: pos.x = 132.000000, pos.y = 190.000000
[   1928][D] har_act(): state is 13
[   1928][D] player_run(): E: pos.x = 132.000000, pos.y = 190.000000
[   1929][D] har_act(): state is 13
[   1929][D] player_run(): E: pos.x = 132.000000, pos.y = 190.000000
[   1930][D] har_act(): state is 13
[   1930][D] player_run(): E: pos.x = 132.000000, pos.y = 190.000000
[   1931][D] har_act(): state is 13
[   1931][D] player_run(): E: pos.x = 132.000000, pos.y = 190.000000
[   1932][D] har_act(): state is 13
[   1932][D] player_run(): E: pos.x = 132.000000, pos.y = 190.000000
[   1933][D] player_run(): E: pos.x = 132.000000, pos.y = 190.000000
[   1934][D] har_act(): state is 13
[   1934][D] player_run(): E: pos.x = 132.000000, pos.y = 190.000000
[   1935][D] har_act(): state is 13
[   1936][D] har_act(): state is 13
[   1937][D] har_act(): state is 13
[   1938][D] har_act(): state is 13
[   1939][D] har_act(): state is 13
[   1940][D] har_act(): state is 13
[   1941][D] har_act(): state is 13
[   1942][D] har_act(): state is 13
[   1943][D] har_act(): state is 13
[   1944][D] har_act(): state is 13
[   1945][D] har_act(): state is 13
[   1946][D] har_act(): state is 13
[   1947][D] har_act(): state is 13
[   1948][D] har_act(): state is 13
[   1949][D] har_act(): state is 13
[   1950][D] player_run(): mp flags set for new animation 0:
[   1950][D] player_run():  * 0x04: HAR 1 related
[   1950][D] player_run():  * 0x10: HAR 2 related
[   1951][D] player_run(): mp flags set for new animation 0:
[   1951][D] player_run():  * 0x01: NON-HAR Sprite
[   1951][D] player_run():  * 0x02: Unknown
[   1951][D] player_run():  * 0x04: HAR 1 related
[   1951][D] player_run():  * 0x08: Something timer related is skipped ?
[   1951][D] player_run(): mp flags set for new animation 0:
[   1951][D] player_run():  * 0x04: HAR 1 related
[   1951][D] player_run():  * 0x10: HAR 2 related
[   1952][D] player_run(): mp flags set for new animation 0:
[   1952][D] player_run():  * 0x01: NON-HAR Sprite
[   1952][D] player_run():  * 0x02: Unknown
[   1952][D] player_run():  * 0x04: HAR 1 related
[   1952][D] player_run():  * 0x08: Something timer related is skipped ?
joyrider3774 commented 7 months ago

it may be related to #434

katajakasa commented 7 months ago

Yep, probably related. More precisely, this is probably related to some issues in the animation string parser. I have a rewrite pending that should fix those, but haven't yet had the time to do much. Marking this as "bug" and putting to backlog for now.

katajakasa commented 3 months ago

Possibly fixed now via https://github.com/omf2097/openomf/pull/520 -- closing as fixed. Please reopen if this reoccurs.