This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[PATCH] lin-lwp + pthreads + static binary = gdb internal error
- To: <gdb-patches at sources dot redhat dot com>
- Subject: [PATCH] lin-lwp + pthreads + static binary = gdb internal error
- From: "Ken Whaley" <ken at believe dot com>
- Date: Thu, 12 Jul 2001 16:21:10 -0700
Programs that are linked with -pthread -static cause an
internal error:
Starting program: /mnt/home/ken/src/float
../../gdb+dejagnu-20010615/gdb/lin-lwp.c:739: gdb-internal-error:
lin_lwp_wait: Assertion `iterate_over_lwps (resumed_callback, NULL)' failed.
The assertion fails because there are no lwps yet, so
iterate_over_lwps returns NULL. I'm not sure this is the best patch
for the problem, but it does make the error go away:
Ken Whaley <ken@believe.com>
* lin-lwp.c (lin_lwp_wait): don't look for resumed threads when
there are no lwps
--- gdb/lin-lwp.c.orig Thu Jul 12 15:40:34 2001
+++ gdb/lin-lwp.c Thu Jul 12 15:41:34 2001
@@ -736,7 +736,8 @@
retry:
/* Make sure there is at least one thread that has been resumed. */
- gdb_assert (iterate_over_lwps (resumed_callback, NULL));
+ if (num_lwps > 0)
+ gdb_assert (iterate_over_lwps (resumed_callback, NULL));
/* First check if there is a LWP with a wait status pending. */
if (pid == -1)
--
Ken Whaley
ken@believe.com <mailto:ken@believe.com>