?

Log in

No account? Create an account
The debugger isn't supposed to crash - 'Twas brillig, and the slithy toves did gyre and gimble in the wabe — LiveJournal [entries|archive|friends|userinfo]
Thomas

[ website | Beware the Jabberwock... ]
[ deviantArt | the-boggyb ]
[ FanFiction | Torkell ]
[ Tumblr | torkellr ]

Links
[Random links| BBC news | Vulture Central | Slashdot | Dangerous Prototypes | LWN | Raspberry Pi]
[Fellow blogs| a Half Empty Glass | the Broken Cube | The Music Jungle | Please remove your feet | A letter from home]
[Other haunts| Un4seen Developments | Jazz 2 Online | EmuTalk.net | Feng's shui]

The debugger isn't supposed to crash [Thursday 17th November 2011 at 11:51 pm]
Thomas

boggyb
[Tags|, , , ]
[Feeling |sleepysleepy]
[Playing |Purifying Orbits [PURE.IT]]

Epic technology fail it is! Today's fail makes for a short post, but that doesn't make it any less annoying.

I wanted to help debug a colleague's program at work recently to try and track down a threading issue (I suspected one thread of freeing memory being used by another thread). Since this program runs on Linux, this unfortunately means using gdb. So I fire up gdb, tell it to run the program, and am greeted by something like this:

linux-nat.c:546: internal-error: wait returned unexpected status 0x100
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Create a core file of GDB? (y or n)

Yes, that's the debugger crashing. That's not supposed to happen.

Some searching threw up this bug from oh, about 4 years ago, as being the most likely cause. Now, the title of this bug implies that you should only see this if you have on the order of seven thousand threads, which is such a ridiculously large number that you'd never expect to run into it. It also suggests that even then this bug only happens occasionally.

Except the program we were trying to debug had a grand total of 4 threads. And gdb would reliably crash whenever I tried to run that program. At which point I was rather stuck, because while there's a whole bunch of debuggers available for Linux (off the top of my head I can think of ddd, Eclipse, or KDbg), what they all are is actually just a frontend for gdb. In the end we worked round it by adding lots of logging, waiting for it to crash, and then puzzling through the pieces, but that was a lot of hassle I could have done without.

Link | Previous Entry | Share | Next Entry[ Penny for your thoughts? ]