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

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

[Octave-bug-tracker] [bug #50400] exit() in forked child doesn't return


From: Olaf Till
Subject: [Octave-bug-tracker] [bug #50400] exit() in forked child doesn't return
Date: Sat, 25 Feb 2017 11:42:15 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0

URL:
  <http://savannah.gnu.org/bugs/?50400>

                 Summary: exit() in forked child doesn't return
                 Project: GNU Octave
            Submitted by: i7tiol
            Submitted on: Sat 25 Feb 2017 04:42:14 PM UTC
                Category: Interpreter
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: None
                  Status: None
             Assigned to: None
         Originator Name: Olaf Till
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: dev
        Operating System: GNU/Linux

    _______________________________________________________

Details:

dev branch, 2bed6d6bb2e2, 2017-02-24 11:43:56-0800
with QT, started with ./run-octave, with or without option --no-gui.

After fork (i.e. the fork builtin), exit() in the child makes the child (and
so the parents waitpid()) hang. Reproduce with:


function demo_exit_hangs ()
  if ((pid = fork) > 0)
    ## parent
    waitpid (pid);
  elseif (pid < 0)
    ## error
    error ("could not fork");
  else
    ## child
    exit (0);
  endif
endfunction


Backtrace of the hanging child:


#0  pthread_cond_wait@@GLIBC_2.3.2 ()
    at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
#1  0x00007f44ab041eab in QWaitCondition::wait(QMutex*, unsigned long) ()
   from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#2  0x00007f44b07e1fd1 in octave_qt_link::do_confirm_shutdown
(this=0x12ba1b0)
    at libgui/src/octave-qt-link.cc:65
#3  0x00007f44aff3b458 in octave_link::confirm_shutdown ()
    at libinterp/corefcn/octave-link.h:96
#4  0x00007f44aff3656c in Fquit (args=...)
    at libinterp/corefcn/interpreter.cc:224


so it waits for some mutex in QT.

exit(0) in an unforked session works o.k..




    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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