segfault in tk/variable.rb

Discussion in 'Ruby' started by Tim Hunter, Jan 13, 2005.

  1. Tim Hunter

    Tim Hunter Guest

    Anybody else seen this? It's _extremely_ rare. I've seen it exactly twice,
    both times running the same program - a test/unit test suite using
    Tk::TestRunner. In the meantime I've run the program successfully dozens of
    times. This last time it happened when I ran the program immediately after
    issuing an `export -n ...' command.

    tim: ~/vslick/rvg/test> export -n debug_prim=
    tim: ~/vslick/rvg/test> ruby W3C*
    /home/software/ruby-1.8.2//lib/ruby/1.8/tk/variable.rb:321: [BUG]
    Segmentation fault
    ruby 1.8.2 (2004-12-25) [i686-linux]

    Aborted
     
    Tim Hunter, Jan 13, 2005
    #1
    1. Advertising

  2. Hi,

    From: Tim Hunter <>
    Subject: segfault in tk/variable.rb
    Date: Thu, 13 Jan 2005 09:31:16 +0900
    Message-ID: <ghjFd.16870$>
    > tim: ~/vslick/rvg/test> export -n debug_prim=
    > tim: ~/vslick/rvg/test> ruby W3C*
    > /home/software/ruby-1.8.2//lib/ruby/1.8/tk/variable.rb:321: [BUG]
    > Segmentation fault
    > ruby 1.8.2 (2004-12-25) [i686-linux]


    Could you tell me the value of TclTkLib::COMPILE_INFO ?
    --
    Hidetoshi NAGAI ()
     
    Hidetoshi NAGAI, Jan 13, 2005
    #2
    1. Advertising

  3. Tim Hunter

    Tim Hunter Guest

    Hidetoshi NAGAI wrote:

    > Hi,
    >
    > From: Tim Hunter <>
    > Subject: segfault in tk/variable.rb
    > Date: Thu, 13 Jan 2005 09:31:16 +0900
    > Message-ID: <ghjFd.16870$>
    >> tim: ~/vslick/rvg/test> export -n debug_prim=
    >> tim: ~/vslick/rvg/test> ruby W3C*
    >> /home/software/ruby-1.8.2//lib/ruby/1.8/tk/variable.rb:321: [BUG]
    >> Segmentation fault
    >> ruby 1.8.2 (2004-12-25) [i686-linux]

    >
    > Could you tell me the value of TclTkLib::COMPILE_INFO ?


    "tcltklib 2004-12-23 :: Ruby1.8.2 (2004-12-25) without pthread :: Tcl8.4.
    (without stub)/Tk8.4.5(without stub) with tcl_threads"
     
    Tim Hunter, Jan 13, 2005
    #3
  4. Hi,

    From: Tim Hunter <>
    Subject: Re: segfault in tk/variable.rb
    Date: Thu, 13 Jan 2005 11:46:21 +0900
    Message-ID: <GhlFd.10248$>
    > > Could you tell me the value of TclTkLib::COMPILE_INFO ?

    >
    > "tcltklib 2004-12-23 :: Ruby1.8.2 (2004-12-25) without pthread :: Tcl8.4.
    > (without stub)/Tk8.4.5(without stub) with tcl_threads"


    Possibly, the trouble depends on inconsistency of pthread support.
    Didn't you see the following messgase when compiling?

    *****************************************************************************
    **
    ** PTHREAD SUPPORT MODE ERRROR:
    **
    ** Ruby is not compiled with --enable-pthread, but your Tcl/Tk
    ** libararies seems to be compiled with "pthread support". This
    ** combination possibly cause "Hang-up" or "Segmentation Fault"
    ** frequently when Ruby/Tk is working. We NEVER recommend you to
    ** create the library under such combination of pthread support.
    **
    ** Please recompile Ruby with "--enable-pthread" configure option
    ** or recompile Tcl/Tk with "--disable-threads" configure option.
    **
    *****************************************************************************

    --
    Hidetoshi NAGAI ()
     
    Hidetoshi NAGAI, Jan 13, 2005
    #4
  5. Tim Hunter

    Tim Hunter Guest

    Hidetoshi NAGAI wrote:

    > Hi,
    >
    > From: Tim Hunter <>
    > Subject: Re: segfault in tk/variable.rb
    > Date: Thu, 13 Jan 2005 11:46:21 +0900
    > Message-ID: <GhlFd.10248$>
    >> > Could you tell me the value of TclTkLib::COMPILE_INFO ?

    >>
    >> "tcltklib 2004-12-23 :: Ruby1.8.2 (2004-12-25) without pthread :: Tcl8.4.
    >> (without stub)/Tk8.4.5(without stub) with tcl_threads"

    >
    > Possibly, the trouble depends on inconsistency of pthread support.
    > Didn't you see the following messgase when compiling?
    >
    >

    *****************************************************************************
    > **
    > ** PTHREAD SUPPORT MODE ERRROR:
    > **
    > ** Ruby is not compiled with --enable-pthread, but your Tcl/Tk
    > ** libararies seems to be compiled with "pthread support". This
    > ** combination possibly cause "Hang-up" or "Segmentation Fault"
    > ** frequently when Ruby/Tk is working. We NEVER recommend you to
    > ** create the library under such combination of pthread support.
    > **
    > ** Please recompile Ruby with "--enable-pthread" configure option
    > ** or recompile Tcl/Tk with "--disable-threads" configure option.
    > **
    >

    *****************************************************************************
    >


    Thank you for helping me.

    Hmmm...Why is the default for Ruby different from Tcl/Tk's default when I'm
    building them at the same time? I did not use --enable-pthread when
    building Ruby, so how did Tcl/Tk get --enable-threads?

    To be sure, I did a `make clean' and re-ran ./configure without the
    --enable-pthread option. When I ran `make' I did not get this message.

    Then I ran ./configure with --enable-pthread. When I ran `make' I _did_ get
    the message.

    Which is right?
     
    Tim Hunter, Jan 13, 2005
    #5
  6. From: Tim Hunter <>
    Subject: Re: segfault in tk/variable.rb
    Date: Fri, 14 Jan 2005 08:16:30 +0900
    Message-ID: <TiDFd.16990$>
    > Hmmm...Why is the default for Ruby different from Tcl/Tk's default when I'm
    > building them at the same time? I did not use --enable-pthread when
    > building Ruby, so how did Tcl/Tk get --enable-threads?


    Oh, I'm verry sorry. That is a bug of tcltklib/extconf.rb.
    When disable-pthread, the logical value of WITH_TCL_ENABLE_THREAD macro
    is inverted.
    Unless "ruby -r tk -e 'p Tk::pLATFORM["threaded"]'" shows "1",
    your tcl/tk which linked your ruby is NOT enable-threads.

    > To be sure, I did a `make clean' and re-ran ./configure without the
    > --enable-pthread option. When I ran `make' I did not get this message.
    >
    > Then I ran ./configure with --enable-pthread. When I ran `make' I _did_ get
    > the message.


    Probably, that is a warning message of inconsistency, isn't that?
    When ruby=>pthread-enable and tcl/tk=>thread-disable,
    output the warning message but succeed to compile.

    Well, if there are no consistency problems,
    I have to search the reason of your trouble.
    tk/variable.rb.321 is
    ---------------------------------------------------------------------------
    _fromUTF8(INTERP._set_global_var(@id, _get_eval_string(val, true)))
    ---------------------------------------------------------------------------
    I want to know which of _fromUTF8, _set_global_var and
    _get_eval_string raises SEGV.
    If you don't mind, could you check and report it?
    --
    Hidetoshi NAGAI ()
     
    Hidetoshi NAGAI, Jan 14, 2005
    #6
  7. Tim Hunter

    Tim Hunter Guest

    Hidetoshi NAGAI wrote:
    > Well, if there are no consistency problems,
    > I have to search the reason of your trouble.
    > tk/variable.rb.321 is
    >

    ---------------------------------------------------------------------------
    > _fromUTF8(INTERP._set_global_var(@id, _get_eval_string(val, true)))
    >

    ---------------------------------------------------------------------------
    > I want to know which of _fromUTF8, _set_global_var and
    > _get_eval_string raises SEGV.
    > If you don't mind, could you check and report it?


    I don't mind at all. Since the segv occurs only very rarely, it may be some
    time before I see it again. If it happens again I'll follow up.

    Thanks again for advising me.
     
    Tim Hunter, Jan 14, 2005
    #7
  8. Hi,

    From: Tim Hunter <>
    Subject: Re: segfault in tk/variable.rb
    Date: Sat, 15 Jan 2005 08:56:12 +0900
    Message-ID: <9_YFd.18554$>
    > Hidetoshi NAGAI wrote:
    > > Well, if there are no consistency problems,
    > > I have to search the reason of your trouble.
    > > tk/variable.rb.321 is
    > >

    > ---------------------------------------------------------------------------
    > > _fromUTF8(INTERP._set_global_var(@id, _get_eval_string(val, true)))
    > >

    > ---------------------------------------------------------------------------
    > > I want to know which of _fromUTF8, _set_global_var and
    > > _get_eval_string raises SEGV.
    > > If you don't mind, could you check and report it?

    >
    > I don't mind at all. Since the segv occurs only very rarely, it may be some
    > time before I see it again. If it happens again I'll follow up.


    Possibly fixed.
    I thought the problem depends on TclTkIp#_set_global_var.
    When the method calls the Tk interpreter during the Tk interpreter
    is being deleted, sometimes the current namespace of Tk interpreter
    points NULL.
    I added the current namespace check at checking deleted interpreter.
    I've committed the fix. Please see the latest CVS.
    --
    Hidetoshi NAGAI ()
     
    Hidetoshi NAGAI, Jan 25, 2005
    #8
    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. Vedran Vyroubal

    STL string segfault

    Vedran Vyroubal, Mar 3, 2004, in forum: C++
    Replies:
    5
    Views:
    1,390
    Vedran Vyroubal
    Mar 4, 2004
  2. Arthur J. O'Dwyer

    multiset segfault

    Arthur J. O'Dwyer, Jun 17, 2004, in forum: C++
    Replies:
    10
    Views:
    757
    Dave Townsend
    Jun 18, 2004
  3. mfglinux
    Replies:
    11
    Views:
    753
    Roberto Bonvallet
    Sep 12, 2007
  4. Andrey Vul
    Replies:
    8
    Views:
    715
    Richard Bos
    Jul 30, 2010
  5. David Filmer
    Replies:
    19
    Views:
    282
    Kevin Collins
    May 21, 2004
Loading...

Share This Page