On Dec 14, 12:30pm, [EMAIL PROTECTED] wrote:
> I wanted to see if there are any ideas on the following 2 problems
> we are seeing with gdb and a multithreaded c/c++ app. Things look OK
> when using gdb on regular apps without threads.
[...]
> Problem #1
> -----------------
> When trying to look at a core file for some reason
> gdb is trying to attach to a process. In the following
> case I purposely set up a segv in our code before
> spawning a lot of threads.
Linux (and not just Linux/IA-64) does not have good support for
debugging core dumps from multi-threaded programs. I know that there
have been a number of proposals for recording thread information in
core files and I think that there are even some patches floating
around, but these have not been acceptable to the kernel folks for
some reason.
Still, it does seem odd that gdb appears to be trying to attach to
a process...
> warning: unable to set global thread event mask
> [New Thread 1024 (LWP 20648)]
> rw_common (): write: Success.
>
> warning: stop_or_attach_thread: generic error
[...]
> I have also encountered the message:
>
> "Error while reading shared library symbols:
> attach_thread: No such process."
>
> instead of the previous message:
>
> "warning: stop_or_attach_thread: generic error"
I haven't seen this before, but I don't often try to debug
core files from a multi-threaded application because I know
it won't work.
> Problem #2
> -----------------
> Our code runs fine as is, but when I try to run the code in gdb we
> consistantly get a segv as follows:
>
> ----------------------------------------------------------------------------
> [root@clue5 mmfsd]# gdb ./mmfsd -s ./mmfsd.map
> GNU gdb 20001124
> (gdb) run
> Program received signal SIGSEGV, Segmentation fault.
> [Switching to Thread 1026 (LWP 20084)]
> 0x20000000001fa170 in chunk_alloc () from /lib/libc.so.6.1
> ----------------------------------------------------------------------------
>
> I can work around the problem by running our
> program and then attaching to it later on, although
> for some screwy reason gdb goes into the background
> when attaching and I need to use "fg" to finally
> get at the gdb console. Everything looks OK once I get
> to the gdb console.
Earlier this year, Mark Kettenis did a very nice job of revamping
Linux thread support. Unfortunately, the IA-64 port doesn't use this
new thread support. I think the best thing for me to do would be to
enable this support and see if it works better for you. (I tried
enabling it earlier this year, but I was busy with other things at the
time and when it didn't immediately work for me, I let it fall by the
wayside.)
Even if this new thread support doesn't work better for you, I'd
prefer to fix the new code which we plan to maintain instead of old
code which will eventually be discarded. I'll try to get to this in
the next couple of days. You may wish to ping me again to remind me
about it in the event that I get busy with other things and forget.
Thanks,
Kevin
_______________________________________________
Bug-gdb mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-gdb