FreeDink crashes on game load when compiled with -O2 or -Os
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Raspbian |
New
|
Undecided
|
Unassigned |
Bug Description
Hi,
I'm the FreeDink maintainer and I've got a report of a segfault on game load:
http://
I recently got a Raspberry Pi myself and was able to confirm the issue.
The game segfaults following a NULL pointer derefence. The issues appears with -O2 or -Os, but there's no problem with -O0 or -O1.
Attempting to debug the issue failed to due a GDB issue (see below).
Manual code review didn't help me find a related bug (no path to get a NULL pointer, though theoretically there could be a memory mistwrite somewhere else).
FreeDink has been ported to numerous systems and architectures, such as GNU/Linux, Windows, FreeBSD, PSP, OpenPandora, etc. (https:/
I did get a close report on Fedora 19 though:
http://
https:/
BUT it disappeared after a mere RPM rebuild, and the segfault happened at a different place.
Which contributes to the GCC issue hypothesis.
What do you think?
- Segfault backtrace :
$ gdb --args /usr/games/freedink --window
GNU gdb (GDB) 7.4.1-debian
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "arm-linux-
For bug reporting instructions, please see:
<http://
Reading symbols from /usr/games/
done.
(gdb) run
Starting program: /usr/games/freedink --window
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/arm-
[New Thread 0xb5f1a440 (LWP 20630)]
[New Thread 0xb54cf440 (LWP 20634)]
Program received signal SIGSEGV, Segmentation fault.
get_parms (proc_name=
warning: Source file is more recent than executable.
2525 slist[i][0] = '\0';
(gdb) p i
$1 = <optimized out>
(gdb) p slist
$2 = {0x0, 0xbd3b98 "", 0x69e858 "", 0x69e868 "", 0x6a1c98 "", 0x6a1ca8 "", 0x6a1cb8 "", 0x42a7b8 "", 0x42a7c8 "", 0x42a7d8 ""}
- GDB watch internal issue :
$ gdb --args /usr/games/freedink --window
GNU gdb (GDB) 7.4.1-debian
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "arm-linux-
For bug reporting instructions, please see:
<http://
Reading symbols from /usr/games/
done.
(gdb) watch slist[0]
Hardware watchpoint 1: slist[0]
(gdb) run
Starting program: /usr/games/freedink --window
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/arm-
[New Thread 0xb5f1a440 (LWP 20658)]
Hardware watchpoint 1: slist[0]
Old value = 0x0
New value = 0x6a1be0 ""
0x00013c90 in dinkc_bindings_init () at dinkc_bindings.
warning: Source file is more recent than executable.
2012 for (; i < 10; i++)
(gdb) c
Continuing.
/build/
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n) n
/build/
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Create a core file of GDB? (y or n) n
Stopped due to shared library event
description: | updated |
Have you tried building with gcc 4.7?
Unfortunately raspbian seem to be one of very few projects that use armv6 hardfloat and we really dont' have the resources to chase this sort of bug beyond trying different compiler versions or settings and seeing if they go away.