* Problem with Guile on ia64 (possibly "getcontext" related)
@ 2006-07-15 22:24 Rob Browning
2006-07-16 2:54 ` Keith Owens
0 siblings, 1 reply; 4+ messages in thread
From: Rob Browning @ 2006-07-15 22:24 UTC (permalink / raw)
Cc: guile-devel
Guile 1.6.8 is crashing on ia64 with an illegal instruction whenever
it tries to execute call-with-current-continuation. For those who
don't know, call-with-current-continuation captures the current state
of the computation; it's a language feature somewhat similar to
setjmp.
The crash seems to be right around an asm "getcontext" call, and after
looking around, I found these two links:
http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/144939
http://lists.freebsd.org/pipermail/freebsd-sparc64/2006-January/003739.html
They appear claim that adding a dummy (non-executed) setjmp just after
the getcontext call will fix the problem because gcc recognizes
setjmp, but not getcontext, and makes appropriate arrangements.
So I tried adding a dummy setjmp just after the getcontext call, and
that does fix the problem.
However, even though this worked, I'd still prefer to have a better
idea that this is the right fix before adopting it. Is that likely?
The relevant function is scm_make_continuation which you can find
here:
http://cvs.savannah.gnu.org/viewcvs/guile/guile-core/libguile/continuations.c?rev=1.38.2.7&root=guile&only_with_tag=branch_release-1-6&view=markup
Versions:
Debian libc6.1 2.3.6-15
Debian gcc (GCC) 4.1.2 20060708 (prerelease) (Debian 4.1.1-8)
Thanks
--
Rob Browning
rlb @defaultvalue.org and @debian.org; previously @cs.utexas.edu
GPG starting 2002-11-03 = 14DD 432F AE39 534D B592 F9A0 25C8 D377 8C7E 73A4
_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Problem with Guile on ia64 (possibly "getcontext" related)
2006-07-15 22:24 Problem with Guile on ia64 (possibly "getcontext" related) Rob Browning
@ 2006-07-16 2:54 ` Keith Owens
2006-07-19 1:40 ` Rob Browning
0 siblings, 1 reply; 4+ messages in thread
From: Keith Owens @ 2006-07-16 2:54 UTC (permalink / raw)
Cc: linux-ia64, guile-devel
Rob Browning (on Sat, 15 Jul 2006 15:24:31 -0700) wrote:
>
>Guile 1.6.8 is crashing on ia64 with an illegal instruction whenever
>it tries to execute call-with-current-continuation. For those who
>don't know, call-with-current-continuation captures the current state
>of the computation; it's a language feature somewhat similar to
>setjmp.
>
>The crash seems to be right around an asm "getcontext" call, and after
>looking around, I found these two links:
>
> http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/144939
> http://lists.freebsd.org/pipermail/freebsd-sparc64/2006-January/003739.html
>
>They appear claim that adding a dummy (non-executed) setjmp just after
>the getcontext call will fix the problem because gcc recognizes
>setjmp, but not getcontext, and makes appropriate arrangements.
>
>So I tried adding a dummy setjmp just after the getcontext call, and
>that does fix the problem.
>
>However, even though this worked, I'd still prefer to have a better
>idea that this is the right fix before adopting it. Is that likely?
>>
>The relevant function is scm_make_continuation which you can find
>here:
>
> http://cvs.savannah.gnu.org/viewcvs/guile/guile-core/libguile/continuations.c?rev=1.38.2.7&root=guile&only_with_tag=branch_release-1-6&view=markup
Wild guess, based on no data. Add '__attribute__ ((returns_twice))' to
the definition of ia64_getcontext. That should remove the need to use
setjmp.
-
To unsubscribe from this list: send the line "unsubscribe linux-ia64" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Problem with Guile on ia64 (possibly "getcontext" related)
2006-07-16 2:54 ` Keith Owens
@ 2006-07-19 1:40 ` Rob Browning
2006-07-19 2:11 ` Keith Owens
0 siblings, 1 reply; 4+ messages in thread
From: Rob Browning @ 2006-07-19 1:40 UTC (permalink / raw)
Cc: linux-ia64, guile-devel
Keith Owens <kaos@ocs.com.au> writes:
> Wild guess, based on no data. Add '__attribute__ ((returns_twice))' to
> the definition of ia64_getcontext. That should remove the need to use
> setjmp.
That also seems to fix the crash.
So would it be correct to say that the likely problem is just that
because Guile calls getcontext via asm, gcc doesn't know that the call
needs to be handled specially?
Thanks
--
Rob Browning
rlb @defaultvalue.org and @debian.org; previously @cs.utexas.edu
GPG starting 2002-11-03 = 14DD 432F AE39 534D B592 F9A0 25C8 D377 8C7E 73A4
-
To unsubscribe from this list: send the line "unsubscribe linux-ia64" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Problem with Guile on ia64 (possibly "getcontext" related)
2006-07-19 1:40 ` Rob Browning
@ 2006-07-19 2:11 ` Keith Owens
0 siblings, 0 replies; 4+ messages in thread
From: Keith Owens @ 2006-07-19 2:11 UTC (permalink / raw)
Cc: linux-ia64, guile-devel
Rob Browning (on Tue, 18 Jul 2006 18:40:07 -0700) wrote:
>Keith Owens <kaos@ocs.com.au> writes:
>
>> Wild guess, based on no data. Add '__attribute__ ((returns_twice))' to
>> the definition of ia64_getcontext. That should remove the need to use
>> setjmp.
>
>That also seems to fix the crash.
Good.
>So would it be correct to say that the likely problem is just that
>because Guile calls getcontext via asm, gcc doesn't know that the call
>needs to be handled specially?
Exactly right.
_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2006-07-19 2:11 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-15 22:24 Problem with Guile on ia64 (possibly "getcontext" related) Rob Browning
2006-07-16 2:54 ` Keith Owens
2006-07-19 1:40 ` Rob Browning
2006-07-19 2:11 ` Keith Owens
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).