Thread: [Sablevm-developer] SA_SIGINFO undefined
Brought to you by:
egagnon
From: Julio M. M. V. <jm...@me...> - 2004-03-25 21:58:54
|
Hi again, the last problem I found while building sablevm under NetBSD is that it didn't find SA_SIGINFO defined. Checked the sources, and <signal.h> is included correctly, so the problem is coming from somewhere else. Digging a bit in configure, I found that it defines _POSIX_C_SOURCE. The problem is that defining this disables SA_SIGINFO, because siginfo is not POSIX compliant. According to the siginfo(2) manpage: STANDARDS The siginfo_t type conforms to X/Open System Interfaces and Headers Issue 5 (``XSH5''). Removing that definition lets the code work (because, SA_SIGINFO is defined if no _* macros are explicitly defined), but I don't think this is the solution you want. Instead, and according to the standards text I posted before, defining _XOPEN_SOURCE to 500 lets it work fine. This seems better, and is easy to fix: --- configure.ac.orig 2004-03-20 23:02:08.000000000 +0100 +++ configure.ac @@ -21,6 +21,7 @@ AC_DEFINE_UNQUOTED(_SABLEVM_PACKAGE_VERS AC_DEFINE(_REENTRANT,1,link with reentrant library functions) AC_DEFINE(_POSIX_C_SOURCE,199506L,link with POSIX library functions) +AC_DEFINE(_XOPEN_SOURCE,500,link with XOpen library functions) dnl *** uncomment if you want to insert a magic value in every object instance for debugging *** dnl AC_DEFINE(MAGIC,1,put "SableVM" in every instance) Cheers -- Julio M. Merino Vidal <jm...@me...> The NetBSD Project - http://www.NetBSD.org/ |
From: Etienne G. <gag...@uq...> - 2004-03-26 04:54:22
|
Hi Julio, You've made the Hall of Fame. Your name is in SableVM's AUTHORS file (staging branch), along with your 3 patches applied. Thanks a lot! Etienne -- Etienne M. Gagnon, Ph.D. http://www.info.uqam.ca/~egagnon/ SableVM: http://www.sablevm.org/ SableCC: http://www.sablecc.org/ |
From: Julio M. M. V. <jm...@me...> - 2004-03-26 23:18:53
Attachments:
patch1.diff
|
On Thu, 25 Mar 2004 23:45:58 -0500 Etienne Gagnon <gag...@uq...> wrote: > Hi Julio, > > You've made the Hall of Fame. Your name is in SableVM's AUTHORS file > (staging branch), along with your 3 patches applied. > > Thanks a lot! Wow :-) You're welcome. But now, back again to the SA_SIGINFO stuff. The patch I sent yesterday really fixed sablevm, but only for NetBSD-current. Today I gave a try under NetBSD 1.6.2 (the stable branch, which frankly is getting out of date and misses stuff like siginfo)... you guessed right, the build failed. I've got a patch that fixes it, though I'm not sure it's 100% right (because some signal handling is left out). Here is what I did: - Check for the presence of siginfo_t from configure. If it's not present, completely disable "signals for exceptions" unconditionally (with the appropiate warning to let the user know what's going on). I assume that if siginfo_t is not present, SA_SIGINFO is not either (and viceversa). - If siginfo is not present, define siginfo_t to void. This is used just once in a function prototype, and the siginfo_t parameter is never used when "signals for exceptions" are disabled. Therefore, setting it to a void pointer lets it work (because the parameter is not used), and the workaround is completely transparent to the code. - Move some #ifdef's around in error.c, to protect more code that uses siginfo stuff. So, if this rationale is ok, the attached patch should do it correctly ;-) Cheers -- Julio M. Merino Vidal <jm...@me...> The NetBSD Project - http://www.NetBSD.org/ |
From: Grzegorz B. P. <ga...@de...> - 2004-03-27 17:47:57
|
W li=B6cie z pi=B1, 26-03-2004, godz. 18:18, Julio M. Merino Vidal pisze:= =20 > - Move some #ifdef's around in error.c, to protect more code that uses = siginfo > stuff. The only problem is, that sometimes you want to disable signals for performance resons and still be able to send SIGQUIT to get stack dump. The --disable-signals-for-exceptions has it in its name. It is not a general switch that enables/disables signals. I think that based on the autodetection you wrote you could define a symbol in configure, then use it to either disable SIGQUIT handling completly, or to enable some special version of this handler. Cheers, Grzegorz B. Prokopski --=20 Grzegorz B. Prokopski <ga...@de...> Debian GNU/Linux http://www.debian.org SableVM - LGPLed JVM http://www.sablevm.org Why SableVM ?!? http://devel.sablevm.org/wiki/WhySableVM |
From: Julio M. M. V. <jm...@me...> - 2004-03-27 22:37:01
Attachments:
patch.diff
|
On Sat, 27 Mar 2004 12:16:24 -0500 "Grzegorz B. Prokopski" <ga...@de...> wrote: > W li=B6cie z pi=B1, 26-03-2004, godz. 18:18, Julio M. Merino Vidal pisze:= =20 > > - Move some #ifdef's around in error.c, to protect more code that uses = siginfo > > stuff. >=20 > The only problem is, that sometimes you want to disable signals for > performance resons and still be able to send SIGQUIT to get stack dump. > The --disable-signals-for-exceptions has it in its name. It is not > a general switch that enables/disables signals. >=20 > I think that based on the autodetection you wrote you could define > a symbol in configure, then use it to either disable SIGQUIT handling > completly, or to enable some special version of this handler. That's indeed better. The attached patch should do it: it checks for sigin= fo and, if it's not available, it disables all signals; but if it is, "signals for exceptions" behavior is preserved. Also avoids the ugly "#define sigin= fo_t void" hack of the previous patch. This should help Cygwin too, as I read in another post ;) Let's see if it's better now. Cheers. --=20 Julio M. Merino Vidal <jm...@me...> The NetBSD Project - http://www.NetBSD.org/ |
From: Etienne G. <gag...@uq...> - 2004-03-28 19:18:50
|
Julio M. Merino Vidal wrote: > Let's see if it's better now. Cheers. Hi Julio, I've made some modifications to the configuration code, and the code is now in staging. Thanks a lot! Etienne -- Etienne M. Gagnon, Ph.D. http://www.info.uqam.ca/~egagnon/ SableVM: http://www.sablevm.org/ SableCC: http://www.sablecc.org/ |