You are not logged in.

Read the FAQ and Knowledge Base before posting.
We won't make a 3DS/2DS emulator.



#1 2008-05-17 22:45:40

AerialX
Member
Registered: 2008-05-17
Posts: 3

Segfault with GDB stubs

I'm unable to use the --arm9gdb or --arm7gdb flags at all. Whatever I set them to (and whichever ROM I use), desmume instantly segfaults before loading anything.
This happens consistently on Arch Linux x86_64, on my 32bit chroot within that OS, and in a 32bit Arch VM.
Also happens on the 0.8 release and CVS head.

Output from within gdb:

gdb desmume-cli
(gdb) run --cflash=media.img --arm9gdb=1234 dslibris.nds
[ -- cut symbol loading -- ]
CFLASH: Using CFlash disk image file media.img
CFLASH: Disk image size = 134217728 (262144 sectors)

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fdc30134710 (LWP 4890)]
0x0000000000433b40 in ?? ()
(gdb) thread apply all bt

Thread 3 (Thread 0x41077950 (LWP 4894)):
#0  0x00007fdc2fc1f6db in write () from /lib/libpthread.so.0
#1  0x00007fdc2fe618fa in DSP_PlayAudio () from /usr/lib/libSDL-1.2.so.0
#2  0x00007fdc2fe371b5 in SDL_RunAudio () from /usr/lib/libSDL-1.2.so.0
#3  0x00007fdc2fe3e5b7 in SDL_RunThread () from /usr/lib/libSDL-1.2.so.0
#4  0x00007fdc2fe80949 in RunThread () from /usr/lib/libSDL-1.2.so.0
#5  0x00007fdc2fc18fc7 in start_thread () from /lib/libpthread.so.0
#6  0x00007fdc2f27be0d in clone () from /lib/libc.so.6
#7  0x0000000000000000 in ?? ()

Thread 2 (Thread 0x421e9950 (LWP 4893)):
#0  0x00007fdc2f275542 in select () from /lib/libc.so.6
#1  0x0000000000434103 in ?? ()
#2  0x00007fdc2fe3e5b7 in SDL_RunThread () from /usr/lib/libSDL-1.2.so.0
#3  0x00007fdc2fe80949 in RunThread () from /usr/lib/libSDL-1.2.so.0
#4  0x00007fdc2fc18fc7 in start_thread () from /lib/libpthread.so.0
#5  0x00007fdc2f27be0d in clone () from /lib/libc.so.6
#6  0x0000000000000000 in ?? ()

Thread 1 (Thread 0x7fdc30134710 (LWP 4890)):
#0  0x0000000000433b40 in ?? ()
#1  0x0000000000403579 in ?? ()
---Type <return> to continue, or q <return> to quit---
#2  0x00007fdc2f1cb18a in __libc_start_main () from /lib/libc.so.6
#3  0x0000000000402a19 in ?? ()
#4  0x00007fff382dd7b8 in ?? ()
#5  0x000000000000001c in ?? ()
#6  0x0000000000000004 in ?? ()
#7  0x00007fff382df825 in ?? ()
#8  0x00007fff382df83a in ?? ()
#9  0x00007fff382df84d in ?? ()
#10 0x00007fff382df85c in ?? ()
#11 0x0000000000000000 in ?? ()

Offline

#2 2008-05-18 13:38:16

ghee
Member
Registered: 2007-08-03
Posts: 17

Re: Segfault with GDB stubs

similarly, on FC8 (Linux fugazi.local 2.6.24.7-92.fc8 #1 SMP Wed May 7 16:50:09 EDT 2008 i686 i686 i386 GNU/Linux)

[rhaleblian@fugazi dslibris]$ gdb --args desmume-cli dslibris.nds --arm9gdb=20000
GNU gdb Red Hat Linux (6.6-35.fc8rh)
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-redhat-linux-gnu"...
Using host libthread_db library "/lib/libthread_db.so.1".
(gdb) run
Starting program: /opt/bin/desmume-cli dslibris.nds --arm9gdb=20000

warning: Missing the separate debug info file: /usr/lib/debug/.build-id/ac/2eeb206486bb7315d6ac4cd64de0cb50838ff6.debug

warning: Missing the separate debug info file: /usr/lib/debug/.build-id/0b/110f91cb785a9133102dff41a2eb2503c45937.debug

warning: Missing the separate debug info file: /usr/lib/debug/.build-id/6c/1cdbb38ae2a292613c8c31195417ee80ea7e1e.debug
[Thread debugging using libthread_db enabled]
[New process 12679]

warning: Missing the separate debug info file: /usr/lib/debug/.build-id/c9/1667d94147b7a8a3dded6fc02c1c5d3ada863a.debug

warning: Missing the separate debug info file: /usr/lib/debug/.build-id/e2/bbd1eacd0ca20fb84248cf04046c69c1cdee27.debug

warning: Missing the separate debug info file: /usr/lib/debug/.build-id/ba/4ea1118691c826426e9410cafb798f25cefad5.debug

warning: Missing the separate debug info file: /usr/lib/debug/.build-id/92/8ab51a53627c59877a85dd9afecc1619ca866c.debug

warning: Missing the separate debug info file: /usr/lib/debug/.build-id/db/a292aff9720bfc3f25c53fa8e469168460a894.debug

warning: Missing the separate debug info file: /usr/lib/debug/.build-id/03/5807c541381466da2f8457545e62c87066fd4f.debug

warning: Missing the separate debug info file: /usr/lib/debug/.build-id/90/ebf9c172c9332feed316b7c0fdff30ce1a15ae.debug

warning: Missing the separate debug info file: /usr/lib/debug/.build-id/8a/cc903fa48e73406552c64938e7866699a10801.debug

warning: Missing the separate debug info file: /usr/lib/debug/.build-id/54/97ce83a1cf21660e17bef3f4831e2f24afe795.debug

warning: Missing the separate debug info file: /usr/lib/debug/.build-id/41/b572ad1b8e3fac8fb0dadf6bcc2b61ef6e08a9.debug

warning: Missing the separate debug info file: /usr/lib/debug/.build-id/60/d593e7987c4f31a338bf509b15d713aa1fe1fb.debug

warning: Missing the separate debug info file: /usr/lib/debug/.build-id/88/27308433e33aeefb560f42fb133577c8936f20.debug

warning: Missing the separate debug info file: /usr/lib/debug/.build-id/db/8cb95645d5df469d4aece301cdb5e60087be21.debug

warning: Missing the separate debug info file: /usr/lib/debug/.build-id/f2/8414adf5c05e495ce77db42b8b14f40bff2fef.debug

warning: Missing the separate debug info file: /usr/lib/debug/.build-id/e6/6176c26fd113826bac909964f08ed95e3b1745.debug

warning: Missing the separate debug info file: /usr/lib/debug/.build-id/0d/605d38e5e2d23fb14837dd95144b2d330b946c.debug

warning: Missing the separate debug info file: /usr/lib/debug/.build-id/87/d66bafb3c5d1af9e5a91a447ef5efcc0a3ec3c.debug
[New Thread -1208599664 (LWP 12682)]
[New Thread -1208596784 (LWP 12679)]

warning: Missing the separate debug info file: /usr/lib/debug/.build-id/99/575d169ed67c966005b44652ea183f0437b0ee.debug

warning: Missing the separate debug info file: /usr/lib/debug/.build-id/3b/db6d4e345aec32ec5498236708a53bb49d26c4.debug

warning: Missing the separate debug info file: /usr/lib/debug/.build-id/04/ae3795bc4da9647985eaafd55123b36729d66c.debug

warning: Missing the separate debug info file: /usr/lib/debug/.build-id/99/575d169ed67c966005b44652ea183f0437b0ee.debug

warning: Missing the separate debug info file: /usr/lib/debug/.build-id/3b/db6d4e345aec32ec5498236708a53bb49d26c4.debug

warning: Missing the separate debug info file: /usr/lib/debug/.build-id/04/ae3795bc4da9647985eaafd55123b36729d66c.debug
[New Thread -1219355760 (LWP 12683)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1208596784 (LWP 12679)]
activateStub_gdb (instance=0xc019008, cpu_ctrl=0x4e20) at gdbstub.c:1657
1657      stub->cpu_ctrl->stall( stub->cpu_ctrl->data);

Last edited by ghee (2008-05-18 14:30:43)

Offline

#3 2008-05-18 14:00:41

ghee
Member
Registered: 2007-08-03
Posts: 17

Re: Segfault with GDB stubs

issue does not manifest in my configuration using 0.7.3.

Offline

#4 2008-05-18 14:02:34

AerialX
Member
Registered: 2008-05-17
Posts: 3

Re: Segfault with GDB stubs

Hm, I'll use 0.7.3 for the time being then. It works fine with dslibris I assume?

Offline

#5 2008-05-18 14:31:56

ghee
Member
Registered: 2007-08-03
Posts: 17

Re: Segfault with GDB stubs

so far so good. remove -O2 from CFLAGS for both procs to get sensible source stepping.

Offline

#6 2008-05-18 15:20:22

AerialX
Member
Registered: 2008-05-17
Posts: 3

Re: Segfault with GDB stubs

Not working here >.>
0.7.3 starts it fine normally, but adding the --arm9gdb flag makes it stay on a white screen... I'm kinda able to use GDB to connect to it, but it seems like it's dying before I can... Is it possible the --arm9gdb flag is conflicting with the --cflash flag?

EDIT: Wait, I got it big_smile
One thing though... Why is execution jumping around? I'm using kdbg and as I step through it the cursor is jumping back and forth, sometimes executing the same line twice? I suspect it's the mischief of -O2... How do I turn it off?

EDIT 2: k, found it... Is there a better way to disable it rather then editing the Makefile though? Or can we change the Makefile up so that an environment variable disables it..?

EDIT 3: Great, removing -O2 makes it go ~50% slower... hmm

Last edited by AerialX (2008-05-18 15:45:20)

Offline

#7 2008-05-18 19:14:16

ghee
Member
Registered: 2007-08-03
Posts: 17

Re: Segfault with GDB stubs

Heh, you got to EDIT 3 much faster than it took me the first time   hmm big_smile

Your mileage matches mine.

Offline

#8 2008-07-12 03:13:09

colintoal
Member
Registered: 2008-07-12
Posts: 1

Re: Segfault with GDB stubs

I get the segfault with gdb stubs in 0.8 also - on Ubuntu 8.04

Offline

Board footer

Powered by FluxBB