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

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

[Octave-bug-tracker] [bug #47400] panic on Ctrl+c with multithreaded ATL


From: Lachlan Andrew
Subject: [Octave-bug-tracker] [bug #47400] panic on Ctrl+c with multithreaded ATLAS or OpenBLAS
Date: Tue, 12 Jul 2016 02:08:33 +0000 (UTC)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:43.0) Gecko/20100101 Firefox/43.0

Follow-up Comment #9, bug #47400 (project octave):

If we just kill the openBLAS threads [using Rik's trick of popen("", "r")], it
causes problems on exit.

OpenBLAS has a hook that runs when we call exit ():


#0  0x00007feaea124787 in sched_yield ()
    at ../sysdeps/unix/syscall-template.S:81
#1  0x00007feaec43178d in blas_thread_shutdown_ () from /usr/lib/libblas.so.3
#2  0x00007feaec4309cb in blas_shutdown () from /usr/lib/libblas.so.3
#3  0x00007feaf3b09fcf in _dl_fini () at dl-fini.c:253
#4  0x00007feaea09aa91 in __run_exit_handlers (status=0, 
    listp=0x7feaea4075c8 <__exit_funcs>, 
    address@hidden) at exit.c:77
#5  0x00007feaea09ab15 in __GI_exit (status=<optimized out>) at exit.c:99
#6  0x00007feaf2da3e40 in octave_execute_interpreter ()
    at ../libinterp/octave.cc:1002
#7  0x0000000000401101 in main (argc=8, argv=0x7fffd43341d8)
    at ../src/main-cli.cc:92


It goes into a busy loop:


Single stepping until exit from function blas_thread_shutdown_,
which has no line number information.
sched_yield () at ../sysdeps/unix/syscall-template.S:81
81      in ../sysdeps/unix/syscall-template.S
(gdb) 
sched_yield () at ../sysdeps/unix/syscall-template.S:82
82      in ../sysdeps/unix/syscall-template.S
(gdb) 
0x00007feaec43178d in blas_thread_shutdown_ () from /usr/lib/libblas.so.3
(gdb) 
Single stepping until exit from function blas_thread_shutdown_,
which has no line number information.
sched_yield () at ../sysdeps/unix/syscall-template.S:81
81      in ../sysdeps/unix/syscall-template.S
(gdb) 
sched_yield () at ../sysdeps/unix/syscall-template.S:82
82      in ../sysdeps/unix/syscall-template.S


It looks like we will need to kill the threads through OpenBLAS itself.
However, as indicated by the thread Mike pointed to, that is not currently
possible.

If we can rely on the OS to do proper cleanup, then we could exit by sending
ourselves a KILL or some such.  A slightly neater approach would be to set a
timer for, say, 3 seconds before calling exit.  If the timer fires, then we
KILL ourselves.  It's ugly, but less ugly than a crash or hang.

    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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