Bug #1345
closedRuby 1.9.1-p0 is incomatible with linux distributions that do not have NPTL thearding enabled.
Description
=begin
For example older redhat's upto RH enterprise linux 2.1 do not have NPTL.
The symptom is that the ruby just hangs.
If I've understood correctly the old linux posix thread implementation do not support
forking, exec* functions in threads.
Here is what is happening
cat rubythreadtest.rb:
File = File.new("threadtest_result.txt", "w")
file.puts "Calling Process.daemon"
file.flush
Process.daemon(true, false)
file.puts "Running external program with " file.flush file.puts
./ruby -v`
file.flush
exit
[root@pike ruby-1.9.1-p0]# ./ruby threadtest.rb
[root@pike ruby-1.9.1-p0]# ps -aef | grep ruby
root 23828 1 0 11:02 ? 00:00:00 ./ruby threadtest.rb
root 23832 17257 0 11:03 pts/2 00:00:00 grep ruby
[root@pike ruby-1.9.1-p0]# cat threadtest_result.txt
Calling Process.daemon
Running external program with `
[root@pike ruby-1.9.1-p0]# kill 23828
[root@pike ruby-1.9.1-p0]# ps -aef | grep ruby
root 23828 1 0 11:02 ? 00:00:00 ./ruby threadtest.rb
root 23835 17257 0 11:03 pts/2 00:00:00 grep ruby
[root@pike ruby-1.9.1-p0]# kill -9 23828
[root@pike ruby-1.9.1-p0]# ps -aef | grep ruby
root 23837 17257 0 11:03 pts/2 00:00:00 grep ruby
[root@pike ruby-1.9.1-p0]# cat /etc/issue
Red Hat Linux release 7.2 (Enigma)
Kernel \r on an \m
root@atf:/data/ruby/bin# ./ruby threadtest.rb
root@atf:/data/ruby/bin# ps -aef | grep ruby
root 5700 5509 0 12:14 pts/0 00:00:00 grep ruby
root@atf:/data/ruby/bin# cat threadtest_result.txt
Calling Process.daemon
Running external program with `
ruby 1.9.1p0 (2009-01-30 revision 21907) [i386-linux]
root@atf:/data/ruby/bin# cat /etc/issue
Ubuntu 8.10 \n \l
Fro RH 7.2 I needed to disable ext/openssl and patch the
vm_dump.c as follows:
--- vm_dump_orig.c Wed Apr 1 11:32:06 2009
+++ vm_dump.c Wed Apr 1 08:41:52 2009
@@ -10,7 +10,7 @@
#include "ruby/ruby.h"
-#include "vm_core.h"
+#include "vm_core.h"
#define MAX_POSBUF 128
@@ -564,7 +564,9 @@
}
VALUE rb_make_backtrace(void);¶
+#if HAVE_BACKTRACE
+#include <execinfo.h>
+#endif
void
rb_vm_bugreport(void)
{
@@ -589,7 +591,6 @@
}
#if HAVE_BACKTRACE
-/* #in */clude <execinfo.h>
#define MAX_NATIVE_TRACE 1024
{
static void *trace[MAX_NATIVE_TRACE];
=end
Updated by yugui (Yuki Sonoda) almost 16 years ago
- Status changed from Open to Rejected
=begin
Ruby 1.9 does not support LinuxThreads. A maintainer for such platform is wanted.
=end