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

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

[Octave-bug-tracker] [bug #49515] Octave aborts on exit under some condi


From: Mike Miller
Subject: [Octave-bug-tracker] [bug #49515] Octave aborts on exit under some conditions with --eval CODE
Date: Thu, 3 Nov 2016 00:13:23 +0000 (UTC)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:49.0) Gecko/20100101 Firefox/49.0

Follow-up Comment #14, bug #49515 (project octave):

Like I said, with or without the explicit call to Octave's exit() function,
the only difference is where the interpreter crashes.

I don't think you've looked at octave:;interpreter yet, there are 7 calls to
clean_up_and_exit() from different code paths depending on whether Octave was
called with --eval or not, whether Octave was called with a script file or
not, whether --persist was given or not, whether it's running interactively or
not, whether the code that was in a script or --eval called exit or not.

If you run


$ octave --eval "exit(0);"


then octave::interpreter::clean_up_and_exit is called from within the
octave::interpreter::execute_eval_option_code method (line 795).

If you run


$ octave --eval "true;"


then octave::interpreter::clean_up_and_exit is called from the
octave::interpreter::execute method (line 692) instead.

If either of these calls to clean_up_and_exit returns, bad things happen.

I think I've answered your question, whether or not the --eval script calls
exit() explicitly, Octave attempts to exit by signaling the octave_link, and
then the interpreter continues to run and accesses invalid memory because the
main thread has exited.

Both of these should end in a single call to clean_up_and_exit that never
returns.

    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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