[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Ruby & gprof and thread.so undefined reference to rb_thread_critical

John Carter

3/28/2007 2:39:00 AM

1 Answer

M. Edward (Ed) Borasky

3/28/2007 3:09:00 AM

0

John Carter wrote:
> So I was sitting there glaring at the screen whilst my script went off
> and did lots and lots.....
> ....and started to think wonder how I could make it a little faster....
>
> After all, I have thrown every trick in the
> http://www.rubygarden.org:3000/Ruby/page/show/RubyOp...
> book at the Ruby level (indeed I wrote a most of that)
>
> Now I started to wonder if I could tweak Ruby itself to run a little
> faster...
>
> So profile first...
>
> CFLAGS='-p -pg -O2' LDFLAGS='-p -pg' ./configure
> --program-suffix=-profile
> make CFLAGS='-p -pg -O2' LDFLAGS='-p -pg'
> su
> make install CFLAGS='-p -pg -O2' LDFLAGS='-p -pg'
>
> It seems to work and run for the basic stuff, lets hit the Big Script...
>
> Oh dear!
> undefined reference to rb_thread_critical in thread.so
>
> Oh, dear.
>
> Here's the shortest bit that triggers it...
>
> irb-profile -rthread
> /usr/local/lib/ruby/1.8/i686-linux/thread.so:
> /usr/local/lib/ruby/1.8/i686-linux/thread.so: undefined symbol:
> rb_thread_critical - /usr/local/lib/ruby/1.8/i686-linux/thread.so
> (LoadError)
> from /usr/local/lib/ruby/1.8/thread.rb:5
> from
> /usr/local/lib/ruby/1.8/irb/init.rb:252:in `require'
> from
> /usr/local/lib/ruby/1.8/irb/init.rb:252:in `load_modules'
> from
> /usr/local/lib/ruby/1.8/irb/init.rb:250:in `each'
> from
> /usr/local/lib/ruby/1.8/irb/init.rb:250:in `load_modules'
> from
> /usr/local/lib/ruby/1.8/irb/init.rb:21:in `setup'
> from /usr/local/lib/ruby/1.8/irb.rb:54:in
> `start'
> from /usr/local/bin/irb-profile:13
>
> Anyone with any guesses what to do?
>
>
> John Carter Phone : (64)(3) 358 6639
> Tait Electronics Fax : (64)(3) 359 4632
> PO Box 1645 Christchurch Email : john.carter@tait.co.nz
> New Zealand
>
>
>
1. Recompile without the -O2 and see if it goes away. "Normally", when
one compiles for profiling, one uses "-g -pg" which forces *no*
optimization.
2. If the recompiled (and stock Ruby) work, it's a GCC problem. If the
recompiled doesn't work and the stock Ruby does, check your
configuration parameters on your profiling build.

Incidentally, I've done a few tests with a profiling Ruby and I've never
hit anything like this, but nothing I've done goes anywhere near threading.

By the way, what version of GCC are you using? And are you building the
non-profiling Ruby from source too?

--
M. Edward (Ed) Borasky, FBG, AB, PTA, PGS, MS, MNLP, NST, ACMC(P)
http://borasky-research.blo...

If God had meant for carrots to be eaten cooked, He would have given rabbits fire.