This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

lin-lwp.c question


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]