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

Ported to ARM7, compiles but crashes on running. #479

Closed thecosmicslug closed 3 years ago

thecosmicslug commented 7 years ago

I managed to cross-compile cdogs for the steamlink (an arm7 1ghz device with 256mb ram and sdl2 support)

I only had to remove the compiler option " -Winline" to get it running, no other changes but here is the debug log, seems to be loading sound effects before it errors out.

[/home/danny/steamlink-sdk/examples/cdogs-sdl/src/cdogs/ammo.c:127] LoadAmmo(): CFREE(tmp) at 0x0xb71c84a0 [/home/danny/steamlink-sdk/examples/cdogs-sdl/src/cdogs/ammo.c:127] LoadAmmo(): CFREE(tmp) at 0x0xb71c84c8 [/home/danny/steamlink-sdk/examples/cdogs-sdl/src/cdogs/ammo.c:127] LoadAmmo(): CFREE(tmp) at 0x0xb71c84f0 [/home/danny/steamlink-sdk/examples/cdogs-sdl/src/cdogs/bullet_class.c:731] BulletClassFree(): CFREE(b->Name) at 0x(nil) [/home/danny/steamlink-sdk/examples/cdogs-sdl/src/cdogs/bullet_class.c:732] BulletClassFree(): CFREE(b->HitSound.Object) at 0x(nil) [/home/danny/steamlink-sdk/examples/cdogs-sdl/src/cdogs/bullet_class.c:733] BulletClassFree(): CFREE(b->HitSound.Flesh) at 0x(nil) [/home/danny/steamlink-sdk/examples/cdogs-sdl/src/cdogs/bullet_class.c:734] BulletClassFree(): CFREE(b->HitSound.Wall) at 0x(nil) [/home/danny/steamlink-sdk/examples/cdogs-sdl/src/cdogs/c_array.c:189] CArrayTerminate(): CFREE(a->data) at 0x(nil) [/home/danny/steamlink-sdk/examples/cdogs-sdl/src/cdogs/c_array.c:189] CArrayTerminate(): CFREE(a->data) at 0x(nil) [/home/danny/steamlink-sdk/examples/cdogs-sdl/src/cdogs/c_array.c:189] CArrayTerminate(): CFREE(a->data) at 0x(nil) [/home/danny/steamlink-sdk/examples/cdogs-sdl/src/cdogs/c_array.c:189] CArrayTerminate(): CFREE(a->data) at 0x(nil) [/home/danny/steamlink-sdk/examples/cdogs-sdl/src/cdogs/cpic.c:82] CPicLoadJSON(): CFREE(tmp) at 0x0xb71c84f0 [/home/danny/steamlink-sdk/examples/cdogs-sdl/src/cdogs/cpic.c:97] CPicLoadJSON(): CFREE(tmp) at 0x0xb71c84f0 [/home/danny/steamlink-sdk/examples/cdogs-sdl/src/cdogs/bullet_class.c:599] LoadBullet(): CFREE(tmp) at 0x0xb71c84f0 [/home/danny/steamlink-sdk/examples/cdogs-sdl/src/cdogs/bullet_class.c:660] LoadHitsound(): CFREE(hitsound) at 0x(nil) [/home/danny/steamlink-sdk/examples/cdogs-sdl/src/cdogs/bullet_class.c:660] LoadHitsound(): CFREE(hitsound) at 0x(nil) [/home/danny/steamlink-sdk/examples/cdogs-sdl/src/cdogs/bullet_class.c:660] LoadHitsound(): CFREE(hitsound) at 0x(nil) [/home/danny/steamlink-sdk/examples/cdogs-sdl/src/cdogs/bullet_class.c:520] LoadBullet(): CMALLOC(b->HitSound.Object size 10) at 0x0xb72fda28 [/home/danny/steamlink-sdk/examples/cdogs-sdl/src/cdogs/bullet_class.c:524] LoadBullet(): CMALLOC(b->HitSound.Flesh size 11) at 0x0xb72fda38 [/home/danny/steamlink-sdk/examples/cdogs-sdl/src/cdogs/bullet_class.c:528] LoadBullet(): CMALLOC(b->HitSound.Wall size 9) at 0x0xb72fda48 [/home/danny/steamlink-sdk/examples/cdogs-sdl/src/cdogs/bullet_class.c:543] LoadBullet(): CFREE(b->Name) at 0x(nil) [/home/danny/steamlink-sdk/examples/cdogs-sdl/src/cdogs/bullet_class.c:660] LoadHitsound(): CFREE(hitsound) at 0x0xb72fda28 [/home/danny/steamlink-sdk/examples/cdogs-sdl/src/cdogs/bullet_class.c:660] LoadHitsound(): CFREE(*hitsound) at 0x0xb72fda38 Error in `./cdogs-sdl': double free or corruption (out): 0xb72fda38

cxong commented 7 years ago

I'm not familiar with ARM7, are you able to run it in a debugger and see what values it's try to free? Does free(NULL) break on ARM7?

cxong commented 7 years ago

@thecosmicslug I've identified a memory corruption bug recently, could you please try again with the latest code?

thecosmicslug commented 7 years ago

Still segfaults shortly after running, the only option I changed to get compile to succeed was removing -Winline from the makefile... could that be affecting anything?