[#25936] [Bug:1.9] [rubygems] $LOAD_PATH includes bin directory — Nobuyoshi Nakada <nobu@...>

Hi,

10 messages 2009/10/05

[#25943] Disabling tainting — Tony Arcieri <tony@...>

Would it make sense to have a flag passed to the interpreter on startup that

16 messages 2009/10/05

[#26028] [Bug #2189] Math.atanh(1) & Math.atanh(-1) should not raise an error — Marc-Andre Lafortune <redmine@...>

Bug #2189: Math.atanh(1) & Math.atanh(-1) should not raise an error

14 messages 2009/10/10

[#26222] [Bug #2250] IO::for_fd() objects' finalization dangerously closes underlying fds — Mike Pomraning <redmine@...>

Bug #2250: IO::for_fd() objects' finalization dangerously closes underlying fds

11 messages 2009/10/22

[#26244] [Bug #2258] Kernel#require inside rb_require() inside rb_protect() inside SysV context fails — Suraj Kurapati <redmine@...>

Bug #2258: Kernel#require inside rb_require() inside rb_protect() inside SysV context fails

24 messages 2009/10/22

[#26361] [Feature #2294] [PATCH] ruby_bind_stack() to embed Ruby in coroutine — Suraj Kurapati <redmine@...>

Feature #2294: [PATCH] ruby_bind_stack() to embed Ruby in coroutine

42 messages 2009/10/27

[#26371] [Bug #2295] segmentation faults — tomer doron <redmine@...>

Bug #2295: segmentation faults

16 messages 2009/10/27

[ruby-core:26246] [Bug #2258] Kernel#require inside rb_require() inside rb_protect() inside SysV context fails

From: Suraj Kurapati <redmine@...>
Date: 2009-10-23 03:13:15 UTC
List: ruby-core #26246
Issue #2258 has been updated by Suraj Kurapati.

File extconf.rb added
File main.c added

Hi,

I am attaching updated "extconf.rb" and "main.c" files
which now support Ruby 1.8 and native ucontext.h location.

With these updated files, I have found that the example
test case fails in the same way on Ruby 1.8.6 and 1.8.7
(see output below) as it does for Ruby 1.9.1 and 1.9.2.

Thanks for your consideration.



                        Ruby 1.8.7

###############################################################
# ruby -v extconf.rb && sed -i 's,-shared,,g' Makefile
###############################################################

ruby 1.8.7 (2009-06-12 patchlevel 174) [i686-linux]
checking for ruby_init() in -lruby-static... yes
checking for ruby_sysinit()... no
checking for sys/ucontext.h... yes
creating Makefile
/home/sun/.multiruby/install/1.8.7-p174/lib/ruby/1.8/mkmf.rb:1345: warning: global variable `$preload' not initialized

###############################################################
# make && ./main.so
###############################################################

gcc -I. -I. -I/home/sun/.multiruby/install/1.8.7-p174/lib/ruby/1.8/i686-linux -I. -DHAVE_SYS_UCONTEXT_H  -D_FILE_OFFSET_BITS=64  -fPIC -g -O2  -fPIC   -c main.c
gcc  -o main.so main.o -L. -L/home/sun/.multiruby/install/1.8.7-p174/lib -Wl,-R/home/sun/.multiruby/install/1.8.7-p174/lib -L.  -rdynamic -Wl,-export-dynamic    -Wl,-R -Wl,/home/sun/.multiruby/install/1.8.7-p174/lib -L/home/sun/.multiruby/install/1.8.7-p174/lib -lruby -lruby-static  -lrt -ldl -lcrypt -lm   -lc
Main: relay_from_main_to_ruby() begin
Ruby: context begin
Ruby: relay 0
Ruby: relay_from_ruby_to_main() begin
Main: relay_from_main_to_ruby() end
Main: relay_from_main_to_ruby() begin
Ruby: relay_from_ruby_to_main() end
Ruby: relay 1
Ruby: relay_from_ruby_to_main() begin
Main: relay_from_main_to_ruby() end
Main: relay_from_main_to_ruby() begin
Ruby: relay_from_ruby_to_main() end
Ruby: relay 2
Ruby: relay_from_ruby_to_main() begin
Main: relay_from_main_to_ruby() end
Main: relay_from_main_to_ruby() begin
Ruby: relay_from_ruby_to_main() end
Ruby: require 'hello' begin
~~~~> Hello World!  The time is Thu Oct 22 20:05:28 -0700 2009.
~~~~> Doing relay from ./hello.rb:3
Ruby: relay_from_ruby_to_main() begin
Main: relay_from_main_to_ruby() end
Main: relay_from_main_to_ruby() begin
Ruby: relay_from_ruby_to_main() end
~~~~> OMG, back from main!! :-)
Segmentation fault




                        Ruby 1.8.6

###############################################################
# ruby -v extconf.rb && sed -i 's,-shared,,g' Makefile
###############################################################

ruby 1.8.6 (2009-08-04 patchlevel 383) [i686-linux]
checking for ruby_init() in -lruby-static... yes
checking for ruby_sysinit()... no
checking for sys/ucontext.h... yes
creating Makefile
/home/sun/.multiruby/install/1.8.6-p383/lib/ruby/1.8/mkmf.rb:1136: warning: global variable `$preload' not initialized

###############################################################
# make && ./main.so
###############################################################

gcc  -o main.so main.o -L. -L/home/sun/.multiruby/install/1.8.6-p383/lib -Wl,-R/home/sun/.multiruby/install/1.8.6-p383/lib -L.  -rdynamic -Wl,-export-dynamic    -Wl,-R -Wl,/home/sun/.multiruby/install/1.8.6-p383/lib -L/home/sun/.multiruby/install/1.8.6-p383/lib -lruby -lruby-static  -lrt -ldl -lcrypt -lm   -lc
Main: relay_from_main_to_ruby() begin
Ruby: context begin
Ruby: relay 0
Ruby: relay_from_ruby_to_main() begin
Main: relay_from_main_to_ruby() end
Main: relay_from_main_to_ruby() begin
Ruby: relay_from_ruby_to_main() end
Ruby: relay 1
Ruby: relay_from_ruby_to_main() begin
Main: relay_from_main_to_ruby() end
Main: relay_from_main_to_ruby() begin
Ruby: relay_from_ruby_to_main() end
Ruby: relay 2
Ruby: relay_from_ruby_to_main() begin
Main: relay_from_main_to_ruby() end
Main: relay_from_main_to_ruby() begin
Ruby: relay_from_ruby_to_main() end
Ruby: require 'hello' begin
~~~~> Hello World!  The time is Thu Oct 22 20:04:01 -0700 2009.
~~~~> Doing relay from ./hello.rb:3
Ruby: relay_from_ruby_to_main() begin
Main: relay_from_main_to_ruby() end
Main: relay_from_main_to_ruby() begin
Ruby: relay_from_ruby_to_main() end
~~~~> OMG, back from main!! :-)
Segmentation fault

----------------------------------------
http://redmine.ruby-lang.org/issues/show/2258

----------------------------------------
http://redmine.ruby-lang.org

In This Thread