Warnes, Gregory R
2002-Nov-04 13:41 UTC
longjmp - was: seemingly random "nesting of readline input" w arnings
Barry, Would you mind providing the necessary patch for this behavior? Thanks, Greg> -----Original Message----- > From: Barry Rowlingson [mailto:B.Rowlingson@lancaster.ac.uk] > Sent: Monday, November 04, 2002 8:04 AM > To: r-devel@stat.math.ethz.ch > Subject: Re: longjmp - was: seemingly random "nesting of > readline input" > warnings > > > Luke Tierney wrote: > > > Looks like another case where our expedient but unfortunately too > > crude approach of handling Control-C on UNIX-likes with longjmp is > > biting us. We really do need to bite the bullet and fix > this properly. > > Maybe Duncan and I can coordinate getting a handle on this. > > please do! It still affects Mosix systems, since the signal > handling > in longjmp causes a system call on the home machine. Mosix tries to > migrate processes to less-loaded machines, but R's constant > setjmp'ing > means the processes get stuck on the machines where they are > started from. > > When I install a new version of R on our mosix cluster, I > also compile > a binary with setjmp/longjmp defined as the versions that do not > preserve signal state. This produces a binary that migrates > better under > Mosix but has broken Ctrl-C handling. I then alter the R > script so that > my modified binary runs if and only if you do "R BATCH". Seems a fair > solution at the moment. > > Barry Rowlingson > Maths and Stats > Lancaster University > > -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-. > -.-.-.-.-.-.-.-.- > r-devel mailing list -- Read > http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html > Send "info", "help", or "[un]subscribe" > (in the "body", not the subject !) To: > r-devel-request@stat.math.ethz.ch > _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._. > _._._._._._._._._ >LEGAL NOTICE Unless expressly stated otherwise, this message is confidential and may be privileged. It is intended for the addressee(s) only. Access to this E-mail by anyone else is unauthorized. If you are not an addressee, any disclosure or copying of the contents of this E-mail or any action taken (or not taken) in reliance on it is unauthorized and may be unlawful. If you are not an addressee, please inform the sender immediately. -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-devel-request@stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Warnes, Gregory R wrote:> Would you mind providing the necessary patch for this behavior?Here's the patch, in 'how-to-do-it' format: 1. Get, compile, check, install R as usual. 2. Edit $RSRC/src/include/Defn.h to make sure that the following are defined: # define JMP_BUF jmp_buf # define SETJMP(x) setjmp(x) # define LONGJMP(x,i) longjmp(x,i) and make sure that the 'sig-' versions are undefined. There's probably a way of doing it via configure, but its easy enough to tweak this way. 3. Compile, check. Copy generated binary to $RHOME/bin/R-jmp.bin 4. Edit one line in $RHOME/bin/BATCH so it calls R-jmp.bin instead of R.bin. Voila, one Mosix-enhanced binary that will only react to the first Ctrl-C you throw at it, ignoring subsequent ones. However this isnt generally a problem when running with R BATCH since its a batch job and there's nobody around to throw Ctrl-Cs at it. However, other signal handling may be broken, so dont try to control your R BATCH job by sending signals to it. Only use this if you know what you are doing, and dont expect any help from me or any of the R developers if this breaks stuff - check any putative bugs with a standard-compiled version first. Barry Rowlingson Maths and Stats Lancaster University, UK -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-devel-request@stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._