Backtrace hopping between threads ?

Discussion in 'Ruby' started by Matthew Bloch, Apr 14, 2010.

  1. Hello, I just got this backtrace and don't understand something about
    it:

    F, [2010-04-14T14:19:11.039347 #28597] FATAL -- : can't clone NilClass
    (SystemExit)
    /usr/lib/ruby/1.8/rexml/text.rb:311:in `recvfrom'
    /usr/lib/mauvealert/lib/mauve/server.rb:158:in `receive_waiting_packets'
    /usr/lib/mauvealert/lib/mauve/server.rb:104:in `run'
    /usr/lib/mauvealert/lib/mauve/server.rb:91:in `loop'
    /usr/lib/mauvealert/lib/mauve/server.rb:91:in `run'
    /usr/lib/mauvealert/bin/mauveserver:32
    /usr/lib/mauvealert/bin/mauveserver:30:in `loop'
    /usr/lib/mauvealert/bin/mauveserver:30
    /usr/lib/mauvealert/mauve_starter.rb:22:in `load'
    /usr/lib/mauvealert/mauve_starter.rb:22

    Rather, I understand the exception, the line in server.rb:158 is this:

    packets = [@socket.recvfrom(65535)]

    @socket is just a UDPServer socket, and I'm wanting to read raw data.
    So I don't understand how the backtrace includes a call to REXML.

    Another Thread in the program is processing XMPP messages, that's the
    only code path that would use REXML, so I assume there is a bug in that
    part of the code, somehow the backtrace pops out in another Thread, and
    I've lost the original context.

    I don't have Thread.abort_on_exception set.

    Is this a backtrace that appears to "cross threads" or is there some
    legitimate reason a socket I/O call could call REXML? This is on
    Debian/lenny's ruby, 1.8.7 (2009-06-12 patchlevel 174) [x86_64-linux].

    --
    Matthew
    Matthew Bloch, Apr 14, 2010
    #1
    1. Advertising

  2. Matthew Bloch

    Roger Pack Guest


    > F, [2010-04-14T14:19:11.039347 #28597] FATAL -- : can't clone NilClass
    > (SystemExit)
    > /usr/lib/ruby/1.8/rexml/text.rb:311:in `recvfrom'

    ...
    > Another Thread in the program is processing XMPP messages, that's the
    > only code path that would use REXML, so I assume there is a bug in that
    > part of the code, somehow the backtrace pops out in another Thread, and
    > I've lost the original context.
    >
    > I don't have Thread.abort_on_exception set.
    >
    > Is this a backtrace that appears to "cross threads" or is there some
    > legitimate reason a socket I/O call could call REXML? This is on
    > Debian/lenny's ruby, 1.8.7 (2009-06-12 patchlevel 174) [x86_64-linux].


    In Ruby, if the main thread exits "the whole program exits"
    before "the whole program exits", though, it raises this exception on
    each still running thread. Kind of like "get ready to die."
    I think that's the way it is, anyway, and I'm pretty sure the program
    still terminates if the threads rescue that exception, which makes me
    wonder how that all works exactly, but HTH.
    -rp
    --
    Posted via http://www.ruby-forum.com/.
    Roger Pack, Apr 15, 2010
    #2
    1. Advertising

  3. On Fri, 2010-04-16 at 05:26 +0900, Roger Pack wrote:
    > [snip]
    >
    > In Ruby, if the main thread exits "the whole program exits"
    > before "the whole program exits", though, it raises this exception on
    > each still running thread. Kind of like "get ready to die."
    > I think that's the way it is, anyway, and I'm pretty sure the program
    > still terminates if the threads rescue that exception, which makes me
    > wonder how that all works exactly, but HTH.


    Thanks, I will try some experiments to see if I can get it to behave
    that way again.

    --
    Matthew
    Matthew Bloch, Apr 16, 2010
    #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. Paolo Pantaleo

    Getting backtrace on an axception

    Paolo Pantaleo, Jun 10, 2006, in forum: Python
    Replies:
    0
    Views:
    314
    Paolo Pantaleo
    Jun 10, 2006
  2. Rafal 'Raf256' Maj

    Coredump/backtrace

    Rafal 'Raf256' Maj, Apr 11, 2005, in forum: C Programming
    Replies:
    2
    Views:
    589
    Thomas Maier-Komor
    Apr 12, 2005
  3. NeoTrantor
    Replies:
    2
    Views:
    331
    NeoTrantor
    Mar 30, 2007
  4. symbol table for backtrace

    , Nov 26, 2007, in forum: C Programming
    Replies:
    3
    Views:
    376
    jacob navia
    Nov 26, 2007
  5. Hynek Hanke

    pythonic backtrace with gdb

    Hynek Hanke, Jan 23, 2008, in forum: Python
    Replies:
    1
    Views:
    501
    Dieter Maurer
    Jan 24, 2008
Loading...

Share This Page