This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java 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]

work around alpha kernel bug


See the comment describing the bug.  I'm planning on fixing it, but
since it affects all extant alpha-linux kernels ignoring the return
allows libjava to run on existing kernels.

Ok?


r~


	* java/lang/natPosixProcess.cc (waitForSignal): Ignore return
	value of sigsuspend.

Index: java/lang/natPosixProcess.cc
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/lang/natPosixProcess.cc,v
retrieving revision 1.20
diff -c -p -d -r1.20 natPosixProcess.cc
*** java/lang/natPosixProcess.cc	18 Aug 2004 15:12:32 -0000	1.20
--- java/lang/natPosixProcess.cc	14 Sep 2004 03:30:07 -0000
*************** error:
*** 126,151 ****
  void
  java::lang::ConcreteProcess$ProcessManager::waitForSignal ()
  {
-   using namespace java::lang;
- 
-   sigset_t mask;
    // Wait for SIGCHLD
    pthread_sigmask (0, NULL, &mask);
    sigdelset (&mask, SIGCHLD);
    // Use sigsuspend() instead of sigwait() as sigwait() doesn't play
    // nicely with the GC's use of signals.
!   int c = sigsuspend (&mask);
  
!   if (c != -1)
!     goto error;
!   if (errno != EINTR)
!     goto error;
  
    // All OK.
    return;
- 
- error:
-   throw new InternalError (JvNewStringUTF (strerror (errno)));
  }
  
  jboolean java::lang::ConcreteProcess$ProcessManager::reap ()
--- 126,148 ----
  void
  java::lang::ConcreteProcess$ProcessManager::waitForSignal ()
  {
    // Wait for SIGCHLD
+   sigset_t mask;
    pthread_sigmask (0, NULL, &mask);
    sigdelset (&mask, SIGCHLD);
+ 
    // Use sigsuspend() instead of sigwait() as sigwait() doesn't play
    // nicely with the GC's use of signals.
!   sigsuspend (&mask);
  
!   // Do not check sigsuspend return value.  The only legitimate return
!   // is EINTR, but there is a known kernel bug affecting alpha-linux
!   // wrt sigsuspend+handler+sigreturn that can result in a return value
!   // of __NR_sigsuspend and errno unset.  Don't fail unnecessarily on
!   // older kernel versions.
  
    // All OK.
    return;
  }
  
  jboolean java::lang::ConcreteProcess$ProcessManager::reap ()


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