cxong / cdogs-sdl

Classic overhead run-and-gun game
https://cxong.github.io/cdogs-sdl/
GNU General Public License v2.0
887 stars 114 forks source link

what is the state of lan network play? #702

Closed nixinator closed 3 years ago

nixinator commented 3 years ago

Lan options seems to be 'grayed out' and if i start a game an enable a server my cdogs segfaults.

I'm not sure how this network code hangs together, does cdogs require a cetain version of protobufs or some other network dependency?

[ 9920.880409] cdogs-sdl[40178]: segfault at 73656e6f4a ip 00000073656e6f4a sp 00007fffad235e98 error 14
[ 9920.880422] Code: Unable to access opcode bytes at RIP 0x73656e6f20.
Thread 1 "cdogs-sdl" received signal SIGSEGV, Segmentation fault.
0x00000073656e6f4a in ?? ()
(gdb) traceback
Undefined command: "traceback".  Try "help".
(gdb) backtrace
#0  0x00000073656e6f4a in ?? ()
#1  0x00000000004a453b in encode_field ()
#2  0x00000000004a477b in pb_encode ()
#3  0x000000000048851b in NetEncode ()
#4  0x00000000004868c8 in NetServerSendMsg ()
#5  0x000000000043154c in PlayerEquipOnExit.part.0 ()
#6  0x00000000004278ff in GameLoopOnExit ()
#7  0x0000000000427ac8 in LoopRunnerRunInner ()
#8  0x0000000000427dd8 in LoopRunnerRun ()
#9  0x00000000004216e4 in main ()
valgrind output

20210414-061745 INFO  [MAIN ] [campaigns.c:119] LoadAllCampaigns(): Load dogfights from dir /home/l33/tmp/outputs/out/dogfights...
20210414-061745 INFO  [MAIN ] [campaigns.c:123] LoadAllCampaigns(): Load quick play...
20210414-061745 INFO  [MAIN ] [cdogs.c:276] main(): Starting game
20210414-061746 INFO  [MAIN ] [campaigns.c:226] CampaignSeedRandom(): Seeding with 0
20210414-061746 INFO  [MAIN ] [campaigns.c:226] CampaignSeedRandom(): Seeding with 0
==44074== Conditional jump or move depends on uninitialised value(s)
==44074==    at 0x472490: MapNewLoad (in tmp/source/build/src/cdogs-sdl)
==44074==    by 0x45A5B9: CampaignLoad (in tmp/source/build/src/cdogs-sdl)
==44074==    by 0x42954B: StartGameMode (in tmp/source/build/src/cdogs-sdl)
==44074==    by 0x42C7DC: MenuUpdate (in tmp/source/build/src/cdogs-sdl)
==44074==    by 0x428B0C: MainMenuUpdate (in 0tmp/source/build/src/cdogs-sdl)
==44074==    by 0x427A8D: LoopRunnerRunInner (in tmp/source/build/src/cdogs-sdl)
==44074==    by 0x427DD7: LoopRunnerRun (in tmp/source/build/src/cdogs-sdl)
==44074==    by 0x4216E3: main (in tmp/source/build/src/cdogs-sdl)
==44074== 
20210414-061802 INFO  [MAIN ] [gamedata.c:111] CampaignLoad(): loaded campaign/dogfight
20210414-061803 INFO  [MAIN ] [player.c:63] PlayerDataAddOrUpdate(): add default player UID(0) local(true)
20210414-061804 INFO  [MAIN ] [player.c:105] PlayerDataAddOrUpdate(): update player UID(0) maxHealth(200)
20210414-061842 INFO  [MAIN ] [campaigns.c:226] CampaignSeedRandom(): Seeding with 0
20210414-061848 INFO  [NET  ] [net_server.c:110] HostOpen(): starting server on 0.0.0.0:42677
20210414-061848 INFO  [NET  ] [net_server.c:141] ListenSocketTryOpen(): listening for scans on port 34219
==44074== Jump to the invalid address stated on the next line
==44074==    at 0x73656E6F4A: ???
==44074==    by 0x1FFEFF1A6F: ???
==44074==  Address 0x73656e6f4a is not stack'd, malloc'd or (recently) free'd
==44074== 
==44074== 
==44074== Process terminating with default action of signal 11 (SIGSEGV): dumping core
==44074==  Bad permissions for mapped region at address 0x73656E6F4A
==44074==    at 0x73656E6F4A: ???
==44074==    by 0x1FFEFF1A6F: ???
==44074== 
==44074== HEAP SUMMARY:
==44074==     in use at exit: 60,328,021 bytes in 54,565 blocks
==44074==   total heap usage: 544,236 allocs, 489,671 frees, 1,462,133,506 bytes allocated
==44074== 
==44074== LEAK SUMMARY:
==44074==    definitely lost: 33,924 bytes in 1,671 blocks
==44074==    indirectly lost: 41,145 bytes in 295 blocks
==44074==      possibly lost: 7,048,950 bytes in 3,843 blocks
==44074==    still reachable: 53,204,002 bytes in 48,756 blocks
==44074==                       of which reachable via heuristic:
==44074==                         newarray           : 16 bytes in 1 blocks
==44074==                         multipleinheritance: 104 bytes in 1 blocks
==44074==         suppressed: 0 bytes in 0 blocks
==44074== Rerun with --leak-check=full to see details of leaked memory
==44074== 
==44074== Use --track-origins=yes to see where uninitialised values come from
==44074== For lists of detected and suppressed errors, rerun with: -s
==44074== ERROR SUMMARY: 130 errors from 8 contexts (suppressed: 0 from 0)
Segmentation fault (core dumped)
cxong commented 3 years ago

looks like LAN is broken right now; I'll try to fix for the next release. Thanks for reporting!

nixinator commented 3 years ago

Thanks... game is great fun...! thanks everyone! Now available in here

https://search.nixos.org/packages?channel=unstable&show=cdogs-sdl&from=0&size=50&sort=relevance&query=cdogs