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

Re: [RFA] Fix internal error in wait_lwp (interrupted system call)


Daniel Jacobowitz wrote:
> I think that's because GDB mostly uses signal().  That automatically
> has SA_RESTART behavior, right?

Andreas Schwab wrote:
> Depends on whether signal() has BSD or SYSV semantics.

I wasn't completely certain how to verify this at the source code level,
so I simply checked via 'strace': and indeed the signal() library calls
performed by gdb are transformed to sigaction() system calls *with*
SA_RESTART set on my Linux system.

This is IMO yet another argument for using SA_RESTART with the explicit
sigaction calls in linux-nat.c as well.

Daniel Jacobowitz wrote:
> I'm just worried that this will
> require non-local fixes; the SIGCHLD handler was in the same file, but
> arbitrary other signal handlers could be at arbitrary places in GDB.
> Not handling EINTR from a library call which is allowed to return EINTR
> is, pedantically, always a bug.
> 
> Perhaps we should make both changes.

As verifying correct EINTR handling everywhere appears to be a major
effort, and the simple SA_RESTART patch both fixes a serious problem,
and appears to be correct in any case, I'd argue for applying that
patch now, and maybe later on adding EINTR handling as required.

Bye,
Ulrich

-- 
  Dr. Ulrich Weigand
  Linux on zSeries Development
  Ulrich.Weigand@de.ibm.com


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