Segmentation fault in hpricot executin from Apache-PHP


I'm really new in ruby but I need to use the premailer ruby
library/binary. I'd like excuting this binary for PHP.

I have installed latest ruby version in debian and then I have installed
libraries through gem. When I execute command in console with user root
or user www-data it's fine.

The problem is that when I call to ruby binary from PHP-Apache (exec,
system, shell_exec) ruby throws a segmentation fault in hpricot library.

Ruby version 1.9.2p0
Rubygems version 1.3.7
Hpricot version is 0.8.3
Premailer version 1.6.2

This is the error:

[BUG] Segmentation fault
ruby 1.9.2p0 (2010-08-18 revision 29036) [x86_64-linux]

-- control frame ----------
c:0010 p:---- s:0046 b:0046 l:000045 d:000045 CFUNC :scan
c:0009 p:0074 s:0041 b:0041 l:000040 d:000040 METHOD
c:0008 p:0030 s:0034 b:0034 l:000033 d:000033 METHOD
c:0007 p:0123 s:0028 b:0028 l:000027 d:000027 METHOD
c:0006 p:0264 s:0023 b:0023 l:000022 d:000022 METHOD
c:0005 p:---- s:0018 b:0018 l:000017 d:000017 FINISH
c:0004 p:---- s:0016 b:0016 l:000015 d:000015 CFUNC :new
c:0003 p:0263 s:0011 b:0011 l:000698 d:0000d0 EVAL
c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH
c:0001 p:0000 s:0002 b:0002 l:000698 d:000698 TOP


-- Ruby level backtrace information

-- C level backtrace information
ruby(rb_vm_bugreport+0xa9) [0x52b1a9]
ruby [0x56ea56]
ruby(rb_bug+0xb1) [0x56ebd1]
ruby [0x4b93ff]
/lib/ [0x7f9e39b6ba80]
ruby [0x51e007]
ruby [0x51f5a9]
ruby [0x524858]
ruby [0x51ad5a]
ruby(rb_class_new_instance+0x32) [0x455302]
ruby [0x51e007]
ruby [0x51f5a9]
ruby [0x524858]
ruby(rb_iseq_eval_main+0x288) [0x524bd8]
ruby [0x41a753]
ruby(ruby_run_node+0x36) [0x41c446]
ruby(main+0x4d) [0x41999d]
/lib/ [0x7f9e38f601a6]
ruby [0x419889]

You may have encountered a bug in the Ruby interpreter or extension
Bug reports are welcome.
For details:

Thanks in advance.

Posted via

I am facing the same. Did you get the solution?

No, and I'm really lost :frowning:

If you find any workaround let me know please.



Posted via