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

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

[Octave-bug-tracker] [bug #37672] CTRL+C interrupt processing causes seg


From: Rik
Subject: [Octave-bug-tracker] [bug #37672] CTRL+C interrupt processing causes segfaults
Date: Fri, 10 Jun 2016 17:52:03 +0000 (UTC)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:43.0) Gecko/20100101 Firefox/43.0

Follow-up Comment #69, bug #37672 (project octave):

I can confirm two fixes to use for breaking pause() statements

1) setenv OMP_NUM_THREADS 1 in the shell before starting Octave.
2) execute system() command that returns output.

The first solution is mostly for multi-threaded BLAS libraries, but it also
works here indicating some dependence on threads.

The second case is pretty interesting.  A simple example that seems to reset
the interrupt handlers is


system ("", 1)


All this does is call system and ask for the output back.  Internally, it
seems that it is the creation of an iprocstream which probably resets things. 
This is more easily proved by the following which also works


fid = popen ("", "r");


and the code in file-io.cc is


  if (mode == "r")
    {
      octave_stream ips = octave_iprocstream::create (name);

      retval = octave_stream_list::insert (ips);
    }


Just for fun, I commented out the retval statement and it still works so it is
really the one statement to create an iprocstream that fixes things.

So, maybe jwe has an idea, but it seems that during the start-up sequence
there is a lot of forking/execing and maybe not all of the std::streams get
associated with the correct PID.



    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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