#1077 ✓not-applicable
mpd

edge causing core dumps

Reported by mpd | October 5th, 2009 @ 01:32 AM

as of commit 6b9ab6d8b945b73308d99b0fbdc6f074902eb1d9 I am getting

Illegal instruction: 4 (core dumped)

when running tests.

This is probably a Ruby bug but the only thing that's changed is dm-core. I'm not sure if this is the appropriate place for this, but someone else may hit it as well.

$ ruby -v
ruby 1.8.7 (2009-04-08 patchlevel 160) [i386-freebsd7]

Comments and changes to this ticket

  • Dan Kubb (dkubb)

    Dan Kubb (dkubb) October 5th, 2009 @ 12:36 PM

    • State changed from “new” to “unconfirmed”

    I just tried running the specs on 1.8.7 with the same patchlevel, using SQLite3, and it passed.

    Can you try to run the specs with individual adapters and perhaps we can narrow this down a bit?

    ADAPTERS="in_memory" rake spec
    ADAPTERS="yaml"      rake spec
    ADAPTERS="sqlite3"   rake spec
    ADAPTERS="mysql"     rake spec
    ADAPTERS="postgres"  rake spec
    

    The first two adapters above are pure ruby, and aside from ruby bugs, they should never dump core. The last three use the DataObjects adapters. Feel free to skip any that you don't have installed on your system.

  • mpd

    mpd October 5th, 2009 @ 08:08 PM

    in memory: no failures
    yaml: 1 failure, backtrace at http://gist.github.com/202667 , Not sure if this is related. I don't use YAML in my project.
    sqlite3: no failures.

    mysql and postgres are not installed on this machine

    I think i'm going to recompile Ruby with symbols so I can get a meaningful backtrace.

  • mpd

    mpd October 5th, 2009 @ 08:18 PM

    And no-go on the backtrace:

    
    $ gdb -core ruby18.core 
    GNU gdb 6.1.1 [FreeBSD]
    Copyright 2004 Free Software Foundation, Inc.
    GDB is free software, covered by the GNU General Public License, and you are
    welcome to change it and/or distribute copies of it under certain conditions.
    Type "show copying" to see the conditions.
    There is absolutely no warranty for GDB.  Type "show warranty" for details.
    This GDB was configured as "i386-marcel-freebsd".
    Core was generated by `ruby18'.
    Program terminated with signal 4, Illegal instruction.
    #0  0x33cad2fc in ?? ()
    (gdb) bt
    #0  0x33cad2fc in ?? ()
    Cannot access memory at address 0xbf9ffeb0
    
  • mpd

    mpd October 6th, 2009 @ 11:12 PM

    and when you invoke gdb correctly, you get symbols.

    long backtrace with little info at http://gist.github.com/203736 for the interested.

  • mpd

    mpd October 7th, 2009 @ 12:02 AM

    here's a small script that pops the coredump.

    sorry it uses sweatshop, and that may be part of the problem.

    http://gist.github.com/203774

  • Dan Kubb (dkubb)

    Dan Kubb (dkubb) October 7th, 2009 @ 01:05 PM

    • State changed from “unconfirmed” to “not-applicable”

    @mpd: Your script has an infinite loop. In order to create a Bar, it needs to call Baz.make, which calls Bar.make, and so on until it explodes. There's also an infinite loop between Foo and Bar.

    What's likely happening is your ruby is exploding before returning the SystemStackError exception that my copy of ruby is doing.

  • mpd

    mpd October 7th, 2009 @ 02:02 PM

    hm, weird. It worked until the above listed commit and did what I expected it to do, including dm 0.9.

    I'll just update the fixtures i guess.

  • mpd

    mpd October 8th, 2009 @ 02:38 AM

    The coredump itself here is the result of FreeBSD's tiny thread stack. Good luck trying to increase it.

    Digging into the code on this one... it's happening somewhere around or within save_parents, but not sure what's setting it off. Anything that might resemble a loop has been removed from fixtures, and fixtures instances are created and populated as expected.

    This is popping when I am saving an updated association on an instance (as opposed to a property, which works as expected). It does dump core if you attempt to set the association id as you would a property, however.

    Will check this out on other platforms tomorrow.

  • mpd

    mpd October 11th, 2009 @ 05:50 PM

    An trace of the actual exception thrown is at http://gist.github.com/207932

    I thought I saw another ticket with a similar issue recently, but after searching I can't find it.

    The method in characters.rb is nothing special:

    
    def login(user_id, character_id)
      user = User.get(user_id)
      char = Character.get(character_id)
      raise NotFound unless user and character
      raise Unauthorized unless char.user == user and user == session.user
      user.update(:current_character => char)
      redirect resource(:main)
    end
    

    It is a Merb app but there doesn't seem to be anything Merb-specific about this.

    Line 77 is the 'raise Unauthorized' line.

    User has n characters, and Character belongs to user.
    User also belongs_to a current_character of class Character.

    My attempts to come up with a toy example have been fruitless so far.

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

People watching this ticket

Referenced by

Pages