This is the mail archive of the gdb-patches@sourceware.org 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]
Other format: [Raw text]

Re: Fix a couple of multiexec races


On Monday 08 February 2010 18:54:31 you wrote:

> On Wednesday 13 January 2010 15:11:30, Vladimir Prus wrote:
> > 
> > The attached patch fixes a couple of glitches preventing (upcoming)
> > '-exec-run --all' from working.
> > 
> > First, consider this code inside linux_nat_wait_1:
> > 
> > 	  if (lp
> > 	      && ptid_is_pid (ptid)
> > 	      && ptid_get_pid (lp->ptid) != ptid_get_pid (ptid))
> > 	    {
> > 
> > 	      if (debug_linux_nat)
> > 			fprintf (stderr, "LWP %ld got an event %06x, leaving pending.\n",
> > 					 ptid_get_lwp (lp->ptid), status);
> > 
> >               if (WIFSTOPPED (lp->status))
> >                 {
> >                  if (WSTOPSIG (lp->status) != SIGSTOP)
> >                    {
> >                      stop_callback (lp, NULL);
> > 
> >                      /* Resume in order to collect the sigstop.  */
> >                      ptrace (PTRACE_CONT, GET_LWP (lp->ptid), 0, 0);
> > 
> >                      stop_wait_callback (lp, NULL);
> >                    }
> > 
> > Because lp->status is naturally not NULL when calling stop_callback, and because
> > stop_callback has:
> > 
> > 	 gdb_assert (lp->status == 0);
> > 
> > if we ever enter the inner "if", GDB will crash. Offlist, Pedro suggested the inner if be
> > just removed.
> 
> I thought about this some more, and I think this deserves more
> extensive fixing.  See patch (and comments in it) below, which
> I've just applied. 

Thanks for taking care of this!

-- 
Vladimir Prus
CodeSourcery
vladimir@codesourcery.com
(650) 331-3385 x722


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