lin-lwp.c question

Kevin Buettner kevinb@cygnus.com
Sun Sep 17 01:16:00 GMT 2000


Hi Mark,

In stop_wait_callback () in lin-lwp.c, there is the following
code:

      if (WIFEXITED (status) || WIFSIGNALED (status))
	{
	  gdb_assert (num_lwps > 1);
	  gdb_assert (! is_cloned (lp->pid));

	  gdb_assert (in_thread_list (lp->pid));
	  if (lp->pid != inferior_pid)
	    delete_thread (lp->pid);
	  printf_unfiltered ("[%s exited]\n",
			     target_pid_to_str (lp->pid));

	  delete_lwp (lp->pid);
	  return 0;
	}

I'm wondering about the reason for the following line:

	  gdb_assert (! is_cloned (lp->pid));

I have a simple test program in which I'm (occasionally) seeing
assertion failures due to the above line.  Unfortunately, it's
not consistently reproducible, but I can send you the test program
if you wish to try it for yourself.

If I understand it properly, the only way to get past this assert
is for lp->pid to have it's LWP component and PID component equal.
In other words, we'll only get past the above assert for the main
process, right?

Kevin


More information about the Gdb mailing list