`make check' hangs, when the source directory is read-only

Discussion in 'Ruby' started by Міхаіл Т., Oct 20, 2009.

  1. Hello!

    I'm building platform-specific Ruby-binaries (1.8.7-p174) for each of
    our several platforms based on a single source-code directory, that's
    available read-only.

    The build is fine (except in the win32ole directory, which I had to
    remove). `make test' succeeds:

    # :/tmp/ruby-1.8.7-p174-x86_64-pc-linux-gnu (203) make test
    test succeeded

    However, when I try to `make check', I get:

    # :/tmp/ruby-1.8.7-p174-x86_64-pc-linux-gnu (204) make check
    test succeeded
    /miniruby -I/src/PUBruby/ruby-1.8.7-p174/lib -I.ext/common -I./-
    -r/src/PUBruby/ruby-1.8.7-p174/ext/purelib.rb
    /src/PUBruby/ruby-1.8.7-p174/runruby.rb --extout=.ext --
    "/src/PUBruby/ruby-1.8.7-p174/test/runner.rb"
    --basedir="/src/PUBruby/ruby-1.8.7-p174/test" --runner=console

    Launching `top' in another window I can see the ruby process spinning...
    I left it running for 3 hours, and it accumulated 3 hours of CPU time...

    Please, advise. Thanks!
    --
    Posted via http://www.ruby-forum.com/.
     
    Міхаіл Т., Oct 20, 2009
    #1
    1. Advertising

  2. > I'm building platform-specific Ruby-binaries (1.8.7-p174) for each of
    > our several platforms based on a single source-code directory, that's
    > available read-only.


    Actually, never mind... Something else must be wrong. I copied the
    source tree locally and ran the build there -- the most vanilla way to
    build things.

    `make check' -- as well as a single random test -- still spins...

    Running under strace shows:

    strace ./miniruby -I./lib -I.ext/common -I./- -r./ext/purelib.rb
    /runruby.rb --extout=.ext -- "./test/runner.rb" --basedir="./test"
    test/soap/test_basetype.rb
    ...
    lots of output
    ...
    open("/tmp/ruby-1.8.7-p174-x86_64-pc-linux-gnu/test/soap/test_basetype.rb",
    O_RDONLY) = 3
    fstat(3, {st_mode=S_IFREG|0644, st_size=27077, ...}) = 0
    close(3) = 0
    rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0
    open("/tmp/ruby-1.8.7-p174-x86_64-pc-linux-gnu/test/soap/test_basetype.rb",
    O_RDONLY) = 3
    close(3) = 0
    open("/tmp/ruby-1.8.7-p174-x86_64-pc-linux-gnu/test/soap/test_basetype.rb",
    O_RDONLY) = 3
    fstat(3, {st_mode=S_IFREG|0644, st_size=27077, ...}) = 0
    mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0)
    = 0x2b1f51586000
    read(3, "require 'test/unit'\nrequire 'soa"..., 4096) = 4096
    read(3, "34567890123456789012345678901234"..., 4096) = 4096
    <- HANG ->

    This is on an RHEL-5.4 machine (RedHat's own older version of Ruby NOT
    installed), x86_64. The configure was run thus:

    env CC=gcc44 CFLAGS="-O2 -pipe -march=nocona" ./configure
    --prefix=/usr/local/pub/ruby__1.8.7-p174
    --mandir=/usr/local/pub/ruby__1.8.7-p174/man --enable-pthread
    --disable-install-doc

    The C-compiler (gcc44) is gcc version 4.4.0 20090514 (Red Hat 4.4.0-6)
    (GCC).
    --
    Posted via http://www.ruby-forum.com/.
     
    Міхаіл Т., Oct 20, 2009
    #2
    1. Advertising

  3. gcc-4.4.x -O2 miscompiles Ruby (was: `make check' hangs)

    Міхаіл Т. wrote:
    > The C-compiler (gcc44) is gcc version 4.4.0 20090514 (Red Hat 4.4.0-6)
    > (GCC).


    Simply recompiling from scratch using gcc-4.1.2 solved the hanging
    problem for me. The check is now running (outputting a dot as
    progress-report).

    Alternatively, using gcc-4.4.0, but with less aggressive optimization
    (-O1 instead of -O2) avoids the problem as well.

    Increasing the compiler warnings level (-Wall), one can see a lot of
    negative comments, including a bunch of strict-aliasing violations...

    Indeed, this was is already discussed in:

    https://bugzilla.redhat.com/show_bug.cgi?id=489990

    The bug is in Ruby...

    The work-around is to disable strict-aliasing, when compiling. For gcc
    users, this is done with -fno-strict-aliasing after the -O2 optimization
    flag (see attached patch).

    After rebuilding this way, I can get `make check' to start and proceed
    (the errors it reports now are the same as with other compilers and
    platforms).

    Other (non-gcc) compilers are on their own...

    -mi

    Attachments:
    http://www.ruby-forum.com/attachment/4167/patch-Makefile.in

    --
    Posted via http://www.ruby-forum.com/.
     
    Міхаіл Т., Oct 21, 2009
    #3
    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. Davisro
    Replies:
    1
    Views:
    708
    Michael D. Ober
    Jun 14, 2004
  2. mit
    Replies:
    1
    Views:
    850
    Ramu Pulipati
    Jan 25, 2006
  3. keithb
    Replies:
    2
    Views:
    8,082
    keithb
    Jun 7, 2006
  4. Mark Asbach
    Replies:
    1
    Views:
    504
    Leo Kislov
    Nov 3, 2006
  5. Tim Shadel

    Gem hangs => TCPSocket.write hangs

    Tim Shadel, Jul 23, 2005, in forum: Ruby
    Replies:
    1
    Views:
    425
    Ville Mattila
    Jul 24, 2005
Loading...

Share This Page