octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #31861] crash with empty function line


From: John W. Eaton
Subject: [Octave-bug-tracker] [bug #31861] crash with empty function line
Date: Wed, 15 Dec 2010 06:00:44 +0000
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.15) Gecko/20101028 Iceweasel/3.5.15 (like Firefox/3.5.15)

Update of bug #31861 (project octave):

                  Status:               Confirmed => Fixed                  
             Open/Closed:                    Open => Closed                 

    _______________________________________________________

Follow-up Comment #18:

It doesn't really matter whether the function body is empty or not.  The real
bug is that we can't be calling functions while we are parsing another one,
and that happens when there is a function to be called via the
input_event_hook mechanism and we are defining a function at the command line
(thus, the input_event_hook functions are called while Octave is waiting for
input).

The reason this is related to the fltk graphics backend is that the function
that processes events for fltk is registered to be called via the
input_event_hook mechanism.

When a function is called this way, it changes the value of
symbol_table::current_scope and then when we finish parsing the function it
has an unexpected value.  It might be possible to fix this problem by pushing
a new scope on the call_stack for the new function we are parsing, but this
has some other problems.  For example, the parent scope would not be correct,
but maybe we could work around that problem by marking the function-parsing
scope as "fake" in some way so it would be skipped when looking for parent
scopes but still used when pushing/popping scopes to evaluate functions.

In any case, rather than try to fix that possibly difficult problem, I
checked in the following change:

http://hg.savannah.gnu.org/hgweb/octave/rev/b2191ebea12f

This simply prevents input_event_hook functions from being called while we
are parsing a function on the command line.  If that causes trouble and we
actually do need to call input_event_hook functions while parsing command-line
functions, then maybe I will attempt the other fix outlined above instead.

But for now, I consider this bug closed since the patch I checked in should
at least avoid the crash.

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?31861>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]