Hello,

2013/12/11 V=EDt Ondruch <v.ondruch / gmail.com>:
> When building Ruby for Fedora Rawhide, which ships glibc-2.18.90, the
> test suite SIGABRTs when running on ARM. I originally reported the
> issue against glibc [1] and now the discussion continues on glibc ML
> [2]. Would anybody with more expertise how Ruby is using
> setjmp/longjmp (and possibly makecontext/restorecontext) care to join
> the discussion to help resolve the issue (prior glibc developers
> declare the bug as Ruby's bug)?


I glanced over the discussion.
I know I should send this mail to that thread,
but sorry for my laziness to investigate about the subscription.


Ruby's GC is indeed exploiting setjmp to dump the registers to the heap.
AFAIK this is a common hack for implementing a conservative GC.
For example, Boehm GC also uses it.

Unfortunately, the hack won't work when jmp_buf is mangled.
It is mysterious if it works in other targets that use mangling...
Boehm GC uses getcontext or _builtin_unwind_init instead of setjmp
when they are available.  The former is not available in some platforms,
and the latter is an extension of GCC, though.

The following link shows a brief explanation about the topic.
("Additional requirements for a basic port" section)

http://www.hpl.hp.com/personal/Hans_Boehm/gc/porting.html

I think Ruby can use the same strategy of Boehm GC.
I guess it is not so hard to implement it, but I could be wrong
because I didn't read the Boehm GC's source code.

--=20
Yusuke Endoh <mame / tsg.ne.jp>