Date: Wed, 18 Jan 2006 02:34:16 +0100 From: Marius Strobl <marius@alchemy.franken.de> To: Pav Lucistnik <pav@FreeBSD.org> Cc: freebsd-sparc64@FreeBSD.org Subject: Re: need help with ruby-1.8.4 Message-ID: <20060118023415.I22391@newtrinity.zeist.de> In-Reply-To: <1137487713.38904.8.camel@pav.hide.vol.cz>; from pav@FreeBSD.org on Tue, Jan 17, 2006 at 09:48:33AM %2B0100 References: <1137377234.19156.58.camel@localhost> <20060117005423.A17774@newtrinity.zeist.de> <1137487713.38904.8.camel@pav.hide.vol.cz>
next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Jan 17, 2006 at 09:48:33AM +0100, Pav Lucistnik wrote: > Marius Strobl píše v út 17. 01. 2006 v 00:54 +0100: > > On Mon, Jan 16, 2006 at 03:07:14AM +0100, Pav Lucistnik wrote: > > > Hi, > > > > > > Kris Kennaway hurled this error log on me: > > > > > > http://pointyhat.freebsd.org/errorlogs/sparc64-errorlogs/e.5.2005042909/ruby-1.8.4_1,1.log > > > > > > And I honestly have no clue how to fix it. Any ideas? > > > > > > Also, is there a working scratchbox for the committers running sparc64? > > > > If I fix that compile problem miniruby still segfaults while > > ruby 1.8.4 is built because of exactly the getcontext(3) related > > GCC bug that is described in eval.c (the generated code assumes > > that %l2 didn't change after calling getcontext(3) in rb_call0() > > here). I'd say it's obvious that the workaround implemented in > > ruby can't work; we don't want to tell GCC to not make assumptions > > regarding input, output and local registers before calling > > getcontext(3) but afterwards. In fact when I additionally move > > FUNCTION_CALL_MAY_RETURN_TWICE after calling getcontext(3) in > > ruby_setjmp() miniruby no longer segfaults. But then it turned out > > that the setjmp(3) approach ruby uses on ia64 apparently is also > > sufficient to keep GCC from making assumptions regarding the > > registers in question on sparc64. Therefore I'd suggest to remove > > the inline asm altogether and move FUNCTION_CALL_MAY_RETURN_TWICE > > after getcontext(3) (see attached patch). I verified that this > > doesn't break building ruby 1.8.4 on ia64 and that `make test` still > > succeeds there (and that miniruby segfaults on both architectures > > if just remove FUNCTION_CALL_MAY_RETURN_TWICE altogether). > > I'd suggest to check back with the ruby committer "ark" who added > > this stuff however. > > First, thank you for your investigation. > > With this patch, I can no longer compile ruby on my amd64, it dies > rather mysteriously with > > ./ext/extmk.rb:23:in `require': no such file to load -- rbconfig (LoadError) > from ./ext/extmk.rb:23 > *** Error code 1 > > Can you check on that arch too? > Sorry, I fail to understand what's going on on amd64, especially since defining FUNCTION_CALL_MAY_RETURN_TWICE to 0 also causes strange errors from the interpreter on amd64 but that's exactly what ruby-current does. So this might be an unrelated problem probably fixed elsewhere in ruby-current and just exposed when moving FUNCTION_CALL_MAY_RETURN_TWICE after getcontext(). Keeping FUNCTION_CALL_MAY_RETURN_TWICE before getcontext(), i.e. in the whole wrapping getcontext() in FUNCTION_CALL_MAY_RETURN_TWICE in ruby_setjmp() so it also solves the GCC bug on sparc64, seems to work as a workaround but I don't know why. Did you contact "akr"? Marius -- This mail was scanned by AntiVir Milter. This product is licensed for non-commercial use. See www.antivir.de for details.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060118023415.I22391>