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: Sat, 17 Dec 2016 20:34:16 -0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:49.0) Gecko/20100101 Firefox/49.0

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

Yes, you are right, all of the confirm_shutdown handshaking comes way before
the code that I'm looking at. I don't see any relationship to the state of the
interpreter or the GUI to this part of the code that you are pointing at.

The confirm_shutdown back-and-forth happens when the quit() function is called
or when the user tells the GUI to exit.

In the condition that I am debugging, that has already passed, there is no GUI
running so there is nothing to check, the signal is immediately sent back, the
interpreter thread is awakened, and the clean_up_and_exit function is called.

At the state of the program I am debugging, the interpreter thread has done
all of its flush output, close open file descriptors, run all atexit hooks,
and is either supposed to call exit() itself or tell the Qt main thread to
call exit() (by calling QApplication::exit()).

I don't know exactly what is causing the interpreter thread to wake up or
break out of its nanosleep early, because every time I try to use gdb to set a
breakpoint on the sleep function, the race condition does not appear and the
program exits cleanly, it's a heisenbug.

I'm not sure it matters now, I think the takeaway is that we should do
whatever is necessary to make sure that the clean_up_and_exit method never
returns or else the interpreter will be dereferencing an invalid object
(itself).

    _______________________________________________________

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]