Making progress (I think)!

Hi,

Here's what I got:

    > ruby -e 'puts $:'
    /usr/local/lib/ruby/site_ruby/1.6
    /usr/local/lib/ruby/site_ruby/1.6/alpha-freebsd4
    /usr/local/lib/ruby/site_ruby
    /usr/local/lib/ruby/1.6
    /usr/local/lib/ruby/1.6/alpha-freebsd4
AND
    > ruby -r rbconfig -e 'puts Config::CONFIG["arch"]'
    alpha-freebsd4

SO
I added the 'delete_if' as follows:
    #!/usr/local/bin/ruby
    #
    # racc
    #
    #   Copyright (c) 1999-2001 Minero Aoki <aamine / loveruby.net>
    #
    #   This program is free software.
    #   You can distribute/modify this program under the terms of
    #   the GNU Lesser General Public License version 2 or later.
    #

    $.delete_if {|path|/alpha-freebsd4/=== path }

    ##### main -----------------------------------------------------

with the RESULT of

    felix# gdb ruby
    GNU gdb 4.18
(trimmed)
    This GDB was configured as "alpha-unknown-freebsd"...
    (no debugging symbols found)...
    (gdb) run -S racc rd/rdblockparser.ry
    Starting program: /usr/local/bin/ruby -S racc rd/rdblockparser.ry
    (no debugging symbols found)...(no debugging symbols found)...
    (no debugging symbols found)...(no debugging symbols found)...
    (no debugging symbols found)...(no debugging symbols found)...
    Program received signal SIGSEGV, Segmentation fault.
    0x1600eb488 in init_regs () from /usr/local/lib/libruby.so.16
    (gdb)

So (trying to take a leap) there could be a problem here with gdb? Or did I
miss something?

Again, thank you.

craig

"Minero Aoki" <aamine / mx.edit.ne.jp> wrote in message
news:20020125175119J.aamine / mx.edit.ne.jp...
> Hi,
>
>   In mail "Re: installing mod_ruby --> seg fault in ruby-rdtool"
>     "Craig Burgess" <craig / CheetahUSA.net> wrote:
>
> > Thank you for the guidance. Now my ignorance is going to show. I
couldn't
> > make the change to the racc file because I  couldn't find the string in
the
> > file. There was no reference in racc to "architecture" or "i686."  I
must be
> > missing something. Here is all that I could find which included "path"
>
> Don't mind. My description was insufficient.
> Here is the full description:
>
>   * Ruby searches libraries from its "load path".
>
>   * Ruby's load path is held in the $: (global variable).
>     It is an array of strings. You can display your ruby's
>     load path like this:
>
>         $ ruby -e 'puts $:'
>
>     On my linux box, this command prints these lines:
>
>         /usr/local/lib/ruby/site_ruby/1.6
>         /usr/local/lib/ruby/site_ruby/1.6/i686-linux
>         /usr/local/lib/ruby/site_ruby
>         /usr/local/lib/ruby/1.6
>         /usr/local/lib/ruby/1.6/i686-linux
>         .
>
>   * Ruby loads ruby extentions (ruby libraries which are written in C)
>     from same load pathes too, but by default, all extentions are placed
>     under the specific directories, such as
"/usr/local/lib/ruby/1.6/i686-linux".
>     I call it "architecture-dependent library path" (I call it ARCH path).
>     You can get your architecture name by this command:
>
>         $ ruby -r rbconfig -e 'puts Config::CONFIG["arch"]'
>
>     On my linux box, this command prints this line:
>
>         i686-linux
>
>     Now I know my ARCH path is
/usr/local/lib/ruby/site_ruby/1.6/i686-linux
>     and /usr/local/lib/ruby/1.6/i686-linux.
>
>   * Racc command (it may be /usr/local/bin/racc) is a ruby script,
>     so racc also searches its libraries from ruby's load path.
>
>   * Now I assume that your problem is caused by racc's ruby extentions.
>
>   * Racc can run without ruby extentions, bacause it have both of
>     ruby version code and C version code.
>
>   * Then, if racc works well without extentions, we can know that
>     the problem is in racc's extention. (ruby does not have any problems)
>
>   * Racc uses ruby version library when it fails to load ruby extentions.
>
>   * So removing ARCH pathes from ruby's load path results in racc uses
>     ruby version libraries. *I* can do this by following script:
>
>         $:.delete_if {|path| /i686-linux/ === path }
>
>     But "i686-linux" is different on your host, bacause ARCH path is
>     architecture dependent. So you must replace "i686-linux" by your
>     architecture name.
>
>   * Note that we must remove ARCH pathes in racc process itself,
>     before racc loads its extention libraries. Then we must
>     put above code in the beginning of the racc command file
>     (/usr/local/bin/racc).
>
>     I do not say "we must put code in the FIRST LINE" because
>     there's #! line. Second line is OK.
>
>
> > Unable to execute step #1, I moved on to attempt step #2.  Nothing
> > happened - should there have been some kind of result?
> >
> > felix# ruby test.rb
> > felix#
>
> Nothing happen is OK. This is a good result. It seems that ruby is
> innocent. Maybe racc's extention is wrong.
>
> -- Minero Aoki
>