Bug#678249: (no subject)

Alberto Garcia agarcia at igalia.com
Tue Jul 3 14:25:50 UTC 2012


On Wed, Jun 27, 2012 at 03:02:21PM +0200, Emmanuel Kasper wrote:

> @Berto:
> Upstream is however interested in sorting out this bug, so could you
> maybe submit your backtrace as asked in
> http://forums.bannister.org/ubbthreads.php?ubb=showflat&Number=80250
> ?

I registered there buy my account hasn't been approved yet.

I can paste the information here in the meantime because I think this
is a GCC bug and is relevant for Debian.

The backtrace:

Program received signal SIGSEGV, Segmentation fault.
0x093908b2 in input_type_entry::input_type_entry (this=<optimized out>, 
    type=<optimized out>, group=<optimized out>, token=0xc3a3820 "", 
    name=0x2e <Address 0x2e out of bounds>, standard=..., player=0)
    at src/emu/ioport.c:842
842		m_defseq[SEQ_TYPE_STANDARD] = m_seq[SEQ_TYPE_STANDARD] = standard;
(gdb) bt
#0  0x093908b2 in input_type_entry::input_type_entry (this=<optimized #out>, 
    type=<optimized out>, group=<optimized out>, token=0xc3a3820 "", 
    name=0x2e <Address 0x2e out of bounds>, standard=..., player=0)
    at src/emu/ioport.c:842
#1  0x09396c66 in construct_core_types (typelist=...) at src/emu/inpttype.h:56
#2  0x093f105a in ioport_manager::init_port_types (this=this at entry=0xffffacd8)
    at src/emu/ioport.c:2699
#3  0x093f3c69 in ioport_manager::initialize (this=0xffffacd8)
    at src/emu/ioport.c:2643
#4  0x093f8bea in running_machine::start (this=0xffff9ee8)
    at src/emu/machine.c:266
#5  0x093f95d2 in running_machine::run (this=0xffff9ee8, firstrun=true)
    at src/emu/machine.c:368
#6  0x093f792e in mame_execute (options=..., osd=...) at src/emu/mame.c:189
#7  0x0933f6d4 in cli_frontend::execute (this=0xffffd130, argc=1, 
    argv=0xffffd204) at src/emu/clifront.c:252
#8  0x08d53b2c in main (argc=1, argv=0xffffd204) at src/osd/sdl/sdlmain.c:354

That class is created in construct_core_types (src/emu/inpttype.h) and
is the very first one ("P1 Up") that is already crashing.

I tried this printf line in the constructor (src/emu/ioport.c:842)

   printf("%d, %d, %d, %p, %p, %p\n", type, group, player, token, name, &standard);

Here's the output:

   0, 1, 0, 0xdf6c810, 0x2e, 0x1
   Segmentation fault

   (at least the first and last two parameters are wrong)

The compiler is messing something up. For example, if I comment out
most of those initializations and leave, say, the first 10, then it
doesn't crash.

   46, 1, 0, 0x9c41e89, 0x9c41e83, 0xffee8ea0
   47, 1, 0, 0x9c41ea0, 0x9c41e98, 0xffee8efc
   48, 1, 0, 0x9c41eb9, 0x9c41eb1, 0xffee8f58
   49, 1, 0, 0x9c41ed3, 0x9c41eca, 0xffee8fb4
   50, 1, 0, 0x9c41ef1, 0x9c41ee5, 0xffee9010
   51, 1, 0, 0x9c41f13, 0x9c41f05, 0xffee906c
   52, 1, 0, 0x9c41f37, 0x9c41f29, 0xffee90c8
   53, 1, 0, 0x9c41f5c, 0x9c41f4d, 0xffee9124
   54, 1, 0, 0x9c41f7e, 0x9c41f73, 0xffee9180
   55, 1, 0, 0x9c41f9e, 0x9c41f91, 0xffee91dc

By the way, removing the __attribute__((optimize("O0"))) from the
function definition in inpttype.h also solves the problem. I wonder
what that is for.

Workarounds aside, I still think this is a GCC bug. Adding Mathias
Klose to Cc.

Berto





More information about the Pkg-games-devel mailing list