Strange segfault on Linux with test-unit

Discussion in 'Ruby' started by Daniel Berger, May 9, 2005.

  1. Hi all,

    Ruby 1.8.2 (built with --enable-pthread)
    Suse Linux 9.3 Pro
    sys-proctable 0.7.0

    I've getting some strange behavior with the test cases for the Linux
    version of sys-proctable. There are two test cases in particular that
    are the issue: tc_linux.rb and tc_all.rb.

    Running the tc_linux.rb script causes a segfault. Now, tc_linux.rb
    does a 'require "tc_all"' internally. If I comment that out, then
    running tc_linux.rb works fine.

    Initially, I thought that must mean there's a problem in tc_all.rb.
    But, if I run tc_all.rb by itself, it works fine as well. So, each
    test case works fine individually, but fails if I try to have one
    require the other internally.

    Within linux.c I commented out all of the code for ProcTable.ps and
    ProcTable.fields, having them do nothing except return nil. After
    that, I ran tc_linux.rb again and got this error:

    /usr/local/lib/ruby/1.8/test/unit.rb:285: [BUG] Segmentation fault
    ruby 1.8.2 (2004-12-25) [i686-linux]

    Aborted

    Where line 285, part of the at_exit definition, is: exit
    Test::Unit::AutoRunner.run($0 != "-e" && $0)

    Any ideas on this one?

    Regards,

    Dan
    Daniel Berger, May 9, 2005
    #1
    1. Advertising

  2. Daniel Berger

    ts Guest

    >>>>> "D" == Daniel Berger <> writes:

    D> Any ideas on this one?

    Don't copy proctable.so in the directory sys ?


    Guy Decoux

    p.s. : don't ask me why ...
    ts, May 9, 2005
    #2
    1. Advertising

  3. ts wrote:
    > >>>>> "D" == Daniel Berger <> writes:

    >
    > D> Any ideas on this one?
    >
    > Don't copy proctable.so in the directory sys ?
    >
    >
    > Guy Decoux
    >
    > p.s. : don't ask me why ...


    You're right. Actually, I added a File.delete("sys/proctable.so")
    before the copy in tc_linux.rb and that seems to fix it. Curious.

    Thanks.

    Dan
    Daniel Berger, May 10, 2005
    #3
  4. Daniel Berger

    Paul Brannan Guest

    On Mon, May 09, 2005 at 11:09:51PM +0900, ts wrote:
    > p.s. : don't ask me why ...


    Because you don't know the answer or you don't know how to explain?

    I am curious why this helps.

    Paul
    Paul Brannan, May 10, 2005
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. VvanN
    Replies:
    5
    Views:
    478
    Phlip
    Apr 28, 2006
  2. Bill David
    Replies:
    2
    Views:
    261
    Arne Vajhøj
    Jun 18, 2008
  3. Andrey Vul
    Replies:
    8
    Views:
    673
    Richard Bos
    Jul 30, 2010
  4. Bill Mosteller
    Replies:
    0
    Views:
    209
    Bill Mosteller
    Oct 22, 2009
  5. timr
    Replies:
    2
    Views:
    154
Loading...

Share This Page