s2client-api icon indicating copy to clipboard operation
s2client-api copied to clipboard

replay segfault

Open mburo opened this issue 7 years ago • 3 comments

While playing with the s2client API on Linux I am running into a segfault when replaying pack2 games (see trace below). The first game replay works fine (although taking ~50 seconds on my laptop computer), but the second one fails. I noticed that Libs/ contains libstdc++.so.6, which when using the system library instead (as ldd
indicates) may cause issues. But running SC2_x64 with its own c++ library still segfaults on the second game.

My O/S is Fedora 26 using gcc 7.2.1.

Trace: foo6[StarCraftII]:~/git-repos/external/s2client-api/build/bin/replay -e $s2

Launched SC2 (/home/mic/tmp/StarCraftII/Versions/Base56787/SC2_x64), PID: 5748 Version: B56787 (SC2.3.17) Build: Aug 25 2017 15:00:49 Command Line: '"/home/mic/tmp/StarCraftII/Versions/Base56787/SC2_x64" -listen 127.0.0.1 -port 8167 -displayMode 0 -windowwidth 1024 -windowheight 768 -windowx 100 -windowy 200' Starting up... Startup Phase 1 complete Startup Phase 2 complete Creating stub renderer... Listening on: 127.0.0.1:8167 (8167) Startup Phase 3 complete. Ready for commands. Waiting for connection. Connected to 127.0.0.1:8167 Replay is from a different version. Relaunching client into the correct version... Launched SC2 (/home/mic/tmp/StarCraftII/Versions/Base55958/SC2_x64), PID: 5781 Version: B55958 (SC2.3.16) Build: Jul 31 2017 13:19:41 Command Line: '"/home/mic/tmp/StarCraftII/Versions/Base55958/SC2_x64" -listen 127.0.0.1 -port 8168 -displayMode 0 -dataVersion 5BD7C31B44525DAB46E64C4602A81DC2 -windowwidth 1024 +-windowheight 768 -windowx 100 -windowy 200' Starting up... Startup Phase 1 complete Startup Phase 2 complete Creating stub renderer... Listening on: 127.0.0.1:8168 (8168) Startup Phase 3 complete. Ready for commands. Waiting for connection. Connected to 127.0.0.1:8168 Configuring interface options Configure: raw interface enabled Configure: feature layer interface disabled Configure: score interface enabled Configure: render interface disabled Launching next game. Next launch phase started: 2 Next launch phase started: 3 Next launch phase started: 4 Next launch phase started: 5 Next launch phase started: 6 Next launch phase started: 7 Next launch phase started: 8 Starting replay '878dbc702783e829405930f179b558c5ea938cd982cbb7bbe01b618aee999d16.SC2Replay' Game has started. Replaying: '/home/mic/tmpdev/StarCraftII/replays/878dbc702783e829405930f179b558c5ea938cd982cbb7bbe01b618aee999d16.SC2Replay' Units created: CommandCenter: 1 SupplyDepot: 7 Refinery: 2 Barracks: 2 EngineeringBay: 1 MissileTurret: 2 Bunker: 1 Factory: 1 Starport: 1 SiegeTank: 1 BarracksTechLab: 1 BarracksReactor: 1 FactoryTechLab: 2 FactoryReactor: 1 SCV: 428 Marine: 67 Reaper: 1 Medivac: 3 MULE: 8 Cyclone: 4 KD8Charge: 1 Finished Configuring interface options Configure: raw interface enabled Configure: feature layer interface disabled Configure: score interface enabled Configure: render interface disabled Launching next game. Next launch phase started: 2 Next launch phase started: 3 Next launch phase started: 4 Next launch phase started: 5 Next launch phase started: 6 Next launch phase started: 7 Next launch phase started: 8 Error signal: '11' Backtrace: /home/mic/tmp/StarCraftII/Versions/Base55958/SC2_x64[0x652f73] /lib64/libc.so.6(+0x36a80)[0x7f225847ea80] /lib64/libc.so.6(+0xafc08)[0x7f22584f7c08] /home/mic/tmp/StarCraftII/Versions/Base55958/SC2_x64[0x167dd7d] /home/mic/tmp/StarCraftII/Versions/Base55958/SC2_x64[0x1283074] /home/mic/tmp/StarCraftII/Versions/Base55958/SC2_x64[0x127c967] /home/mic/tmp/StarCraftII/Versions/Base55958/SC2_x64[0x127c816] /home/mic/tmp/StarCraftII/Versions/Base55958/SC2_x64[0x127c82c] /home/mic/tmp/StarCraftII/Versions/Base55958/SC2_x64[0x127c82c] /home/mic/tmp/StarCraftII/Versions/Base55958/SC2_x64[0x127c82c] /home/mic/tmp/StarCraftII/Versions/Base55958/SC2_x64[0x127c82c] /home/mic/tmp/StarCraftII/Versions/Base55958/SC2_x64[0x127c82c] /home/mic/tmp/StarCraftII/Versions/Base55958/SC2_x64[0x127c82c] /home/mic/tmp/StarCraftII/Versions/Base55958/SC2_x64[0x127c5cb] /home/mic/tmp/StarCraftII/Versions/Base55958/SC2_x64[0x127d35e] /home/mic/tmp/StarCraftII/Versions/Base55958/SC2_x64[0x1294ce2] /home/mic/tmp/StarCraftII/Versions/Base55958/SC2_x64[0x12d254d] /home/mic/tmp/StarCraftII/Versions/Base55958/SC2_x64[0x12d063a] /home/mic/tmp/StarCraftII/Versions/Base55958/SC2_x64[0x1295ffc] /home/mic/tmp/StarCraftII/Versions/Base55958/SC2_x64[0x19300c9] /home/mic/tmp/StarCraftII/Versions/Base55958/SC2_x64[0x19338e6] /home/mic/tmp/StarCraftII/Versions/Base55958/SC2_x64[0x5ed4d5] /lib64/libc.so.6(__libc_start_main+0xea)[0x7f225846888a] /home/mic/tmp/StarCraftII/Versions/Base55958/SC2_x64[0x5ed2d9]

mburo avatar Nov 11 '17 17:11 mburo

As a followup, I copied replays from pack2 starting with 0800 into a new folder and ran replay on that. Now I get a segfault before the first replay starts, and another one after the first replay is complete. I wonder if replay is supposed to go through all replays in the directory.

Trace:

foo6[StarCraftII]:~/git-repos/external/s2client-api/build/bin/replay -e $s26 | tee xxx Launched SC2 (/home/mic/tmp/StarCraftII/Versions/Base56787/SC2_x64), PID: 27782 !!! launch /home/mic/tmp/StarCraftII/Versions/Base56787/SC2_x64.sh -listen 127.0.0.1 -port 8167 -displayMode 0 -windowwidth 1024 -windowheight 768 -windowx 100 -windowy 200 !!! Launch with SC2 C++ library !!! /home/mic/tmp/StarCraftII/Versions/Base56787/../../Libs linux-vdso.so.1 (0x00007ffdba9a9000) libdl.so.2 => /lib64/libdl.so.2 (0x00007f05b47de000) libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f05b45bf000) libstdc++.so.6 => /home/mic/tmp/StarCraftII/Versions/Base56787/../../Libs/libstdc++.so.6 (0x00007f05b423d000) libm.so.6 => /lib64/libm.so.6 (0x00007f05b3f27000) libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f05b3d10000) libc.so.6 => /lib64/libc.so.6 (0x00007f05b393b000) /lib64/ld-linux-x86-64.so.2 (0x00007f05b49e2000) Version: B56787 (SC2.3.17) Build: Aug 25 2017 15:00:49 Command Line: '"/home/mic/tmp/StarCraftII/Versions/Base56787/SC2_x64.orig" -listen 127.0.0.1 -port 8167 -displayMode 0 -windowwidth 1024 -windowheight 768 -windowx 100 -windowy 200' Starting up... Startup Phase 1 complete Startup Phase 2 complete Creating stub renderer... Listening on: 127.0.0.1:8167 (8167) Startup Phase 3 complete. Ready for commands. Waiting for connection. Connected to 127.0.0.1:8167 Replay is from a different version. Relaunching client into the correct version... RequestQuit command received. Closing Application... Launched SC2 (/home/mic/tmp/StarCraftII/Versions/Base55958/SC2_x64), PID: 27847 !!! launch /home/mic/tmp/StarCraftII/Versions/Base55958/SC2_x64.sh -listen 127.0.0.1 -port 8168 -displayMode 0 -dataVersion 5BD7C31B44525DAB46E64C4602A81DC2 -windowwidth 1024 -windowheight 768 -windowx 100 -windowy 200 !!! Launch with SC2 C++ library !!! /home/mic/tmp/StarCraftII/Versions/Base55958/../../Libs linux-vdso.so.1 (0x00007ffdac11d000) libdl.so.2 => /lib64/libdl.so.2 (0x00007fdc190c2000) libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fdc18ea3000) libstdc++.so.6 => /home/mic/tmp/StarCraftII/Versions/Base55958/../../Libs/libstdc++.so.6 (0x00007fdc18b21000) libm.so.6 => /lib64/libm.so.6 (0x00007fdc1880b000) libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007fdc185f4000) libc.so.6 => /lib64/libc.so.6 (0x00007fdc1821f000) /lib64/ld-linux-x86-64.so.2 (0x00007fdc192c6000) Version: B55958 (SC2.3.16) Build: Jul 31 2017 13:19:41 Command Line: '"/home/mic/tmp/StarCraftII/Versions/Base55958/SC2_x64.orig" -listen 127.0.0.1 -port 8168 -displayMode 0 -dataVersion 5BD7C31B44525DAB46E64C4602A81DC2 -windowwidth 1024 -windowheight 768 -windowx 100 -windowy 200' Starting up... Startup Phase 1 complete Error signal: '11' Backtrace: /home/mic/tmp/StarCraftII/Versions/Base56787/SC2_x64.orig[0x659853] /lib64/libc.so.6(+0x36a80)[0x7fa543170a80] /home/mic/tmp/StarCraftII/Versions/Base56787/SC2_x64.orig[0xec110b] /home/mic/tmp/StarCraftII/Versions/Base56787/SC2_x64.orig[0xfd5cdf] /home/mic/tmp/StarCraftII/Versions/Base56787/SC2_x64.orig[0xfd5e42] /home/mic/tmp/StarCraftII/Versions/Base56787/SC2_x64.orig[0x1a073a2] /home/mic/tmp/StarCraftII/Versions/Base56787/SC2_x64.orig[0x1a0b096] /home/mic/tmp/StarCraftII/Versions/Base56787/SC2_x64.orig[0x5f3db5] /lib64/libc.so.6(__libc_start_main+0xea)[0x7fa54315a88a] /home/mic/tmp/StarCraftII/Versions/Base56787/SC2_x64.orig[0x5f3bb9] /home/mic/tmp/StarCraftII/Versions/Base56787/SC2_x64.sh: line 9: 27796 Segmentation fault (core dumped) $me.orig ${@:1:99} Startup Phase 2 complete Creating stub renderer... Listening on: 127.0.0.1:8168 (8168) Startup Phase 3 complete. Ready for commands. Waiting for connection. Connected to 127.0.0.1:8168 Configuring interface options Configure: raw interface enabled Configure: feature layer interface disabled Configure: score interface enabled Configure: render interface disabled Launching next game. Next launch phase started: 2 Next launch phase started: 3 Next launch phase started: 4 Next launch phase started: 5 Next launch phase started: 6 Next launch phase started: 7 Next launch phase started: 8 Starting replay '0800e085b430f09cbd1357fd36b15f8db219f9dcee9ee4b12eec5dc5d26ef91f.SC2Replay' Game has started. Replaying: '/home/mic/tmpdev/StarCraftII/replays0800/0800e085b430f09cbd1357fd36b15f8db219f9dcee9ee4b12eec5dc5d26ef91f.SC2Replay' Units created: Baneling: 18 Hatchery: 4 CreepTumor: 8 Extractor: 7 SpawningPool: 1 EvolutionChamber: 3 HydraliskDen: 1 Spire: 1 BanelingNest: 1 RoachWarren: 1 SpineCrawler: 11 SporeCrawler: 2 Drone: 1667 Zergling: 106 Overlord: 23 Hydralisk: 35 Roach: 1 Queen: 18 CreepTumorQueen: 11 Larva: 222 Broodling: 36 Finished Configuring interface options Configure: raw interface enabled Configure: feature layer interface disabled Configure: score interface enabled Configure: render interface disabled User leave event received. Launching next game. Next launch phase started: 2 Next launch phase started: 3 Next launch phase started: 4 Next launch phase started: 5 Next launch phase started: 6 Next launch phase started: 7 Next launch phase started: 8 Error signal: '11' Backtrace: /home/mic/tmp/StarCraftII/Versions/Base55958/SC2_x64.orig[0x652f73] /lib64/libc.so.6(+0x36a80)[0x7f41fc60aa80] /lib64/libc.so.6(+0xafc08)[0x7f41fc683c08] /home/mic/tmp/StarCraftII/Versions/Base55958/SC2_x64.orig[0x167dd7d] /home/mic/tmp/StarCraftII/Versions/Base55958/SC2_x64.orig[0x1283074] /home/mic/tmp/StarCraftII/Versions/Base55958/SC2_x64.orig[0x127c967] /home/mic/tmp/StarCraftII/Versions/Base55958/SC2_x64.orig[0x127c816] /home/mic/tmp/StarCraftII/Versions/Base55958/SC2_x64.orig[0x127c82c] /home/mic/tmp/StarCraftII/Versions/Base55958/SC2_x64.orig[0x127c82c] /home/mic/tmp/StarCraftII/Versions/Base55958/SC2_x64.orig[0x127c82c] /home/mic/tmp/StarCraftII/Versions/Base55958/SC2_x64.orig[0x127c82c] /home/mic/tmp/StarCraftII/Versions/Base55958/SC2_x64.orig[0x127c82c] /home/mic/tmp/StarCraftII/Versions/Base55958/SC2_x64.orig[0x127c82c] /home/mic/tmp/StarCraftII/Versions/Base55958/SC2_x64.orig[0x127c5cb] /home/mic/tmp/StarCraftII/Versions/Base55958/SC2_x64.orig[0x127d35e] /home/mic/tmp/StarCraftII/Versions/Base55958/SC2_x64.orig[0x1294ce2] /home/mic/tmp/StarCraftII/Versions/Base55958/SC2_x64.orig[0x12d254d] /home/mic/tmp/StarCraftII/Versions/Base55958/SC2_x64.orig[0x12d063a] /home/mic/tmp/StarCraftII/Versions/Base55958/SC2_x64.orig[0x1295ffc] /home/mic/tmp/StarCraftII/Versions/Base55958/SC2_x64.orig[0x19300c9] /home/mic/tmp/StarCraftII/Versions/Base55958/SC2_x64.orig[0x19338e6] /home/mic/tmp/StarCraftII/Versions/Base55958/SC2_x64.orig[0x5ed4d5] /lib64/libc.so.6(__libc_start_main+0xea)[0x7f41fc5f488a] /home/mic/tmp/StarCraftII/Versions/Base55958/SC2_x64.orig[0x5ed2d9] /home/mic/tmp/StarCraftII/Versions/Base55958/SC2_x64.sh: line 9: 27860 Segmentation fault (core dumped) $me.orig ${@:1:99}

mburo avatar Nov 11 '17 19:11 mburo

From the log in your second post:

The first issue is the game crashing on shutdown. It looks like it is the same issue as https://github.com/Blizzard/s2client-proto/issues/19. It should be fixed in the later builds. For these older builds, it is annoying but shouldn't impact anything since the game was trying to shutdown anyways.

For the second crash, it looks like the game is confused by the replay being not being compatible with that version of the game. The game should probably handle that by reporting an error back and not crashing. However there is probably a second bug as the library is supposed to be verifying the versions are compatible before passing it into the game.

You may be able to workaround the issue by running these 3.16.1 replays with the 3.16.1 linux package. (The 3.17 package is supposed to support both 3.17 and 3.16.1, but there may be a bug with that)

KevinCalderone avatar Nov 13 '17 17:11 KevinCalderone

@mburo was this solved?

If it was, can you please close this issue?

herodrigues avatar Apr 17 '18 09:04 herodrigues