bugGNU Octave - Bugs: bug #43043, Segfault with CTRL-C

 
 

bug #43043: Segfault with CTRL-C

Submitted by:  Ceral Paquet <octavebugs>
Submitted on:  Thu 21 Aug 2014 05:26:14 PM UTC  
 
Category: LibrariesSeverity: 3 - Normal
Priority: 5 - NormalItem Group: None
Status: Wont FixAssigned to: None
Originator Name: Open/Closed: Closed
Release: 3.8.2Operating System: GNU/Linux

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

(Jump to the original submission Jump to the original submission)

Wed 27 Aug 2014 05:35:40 AM UTC, comment #6:

So I'm not sure if Octave can do much on this bug, marking as won't fix. I'm not sure what's going on or what you're comparing, to be honest, but it looks like the problem is that OpenBLAS cannot be interrupted while performing some operation across multiple threads. I am unable to reproduce this myself, using OpenBLAS 0.2.10 on Debian testing, 30 or so times Ctrl-C and no segfault.

Octave's part in this is to detect the user interrupt and break out of the stack of whatever BLAS library routine is executing at the time. This works for standard BLAS, and I suppose is expected to work with any BLAS drop-in replacement.

See the following, might be the same problem and may be something that gets fixed in OpenBLAS:

Mike Miller <mtmiller>
Project Administrator
Fri 22 Aug 2014 11:47:47 AM UTC, comment #5:

Setting OMP_NUM_THREADS=1 fixed it. Also my code runs faster...

This is a little strange as I've seen the code run faster on a 8 core machine (MATLAB+MKL). Any idea what's going on? Of course I'm happy - thanks Mike - but also a little sad ;)

Ceral Paquet <octavebugs>
Thu 21 Aug 2014 08:43:11 PM UTC, comment #4:

That stack listing seems to point to OpenBLAS. Are you using OpenBLAS intentionally? Do you still see a segfault with OMP_NUM_THREADS=1 set in your environment? Or are you able to test with a different BLAS library?

Mike Miller <mtmiller>
Project Administrator
Thu 21 Aug 2014 08:08:16 PM UTC, comment #3:

Great! I got one. This is the output. Any ideas what I can try next? :)

...
Program received signal SIGSEGV, Segmentation fault.
0x00007fc62d3c6d60 in ?? ()
(gdb) continue
Continuing.

Program received signal SIGINT, Interrupt.

Program received signal SIGSEGV, Segmentation fault.
0x00007fc62d3c6d60 in ?? ()
(gdb) where
#0 0x00007fc62d3c6d60 in ?? ()
#1 0x00007fc62b4d5faf in blas_thread_server ()
from /home/cp/octave-build/octave-3.8.2/liboctave/.libs/liboctave.so.2
#2 0x00007fc6297ca0a4 in start_thread (arg=0x7fc61ef64700)
at pthread_create.c:309
#3 0x00007fc6294fefbd in clone ()
at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
(gdb)

Ceral Paquet <octavebugs>
Thu 21 Aug 2014 06:55:22 PM UTC, comment #2:

You should be able to get gdb to not stop and instead pass the interrupt signal on to the Octave process by issuing the following commands at the gdb prompt:

John W. Eaton <jwe>
Project Administrator
Thu 21 Aug 2014 05:33:01 PM UTC, comment #1:

Narrowing down further, I commented out all the display commands and it still occurs.

im = convn(data,X,'same');
%imagesc(dot(im,im,3))
%title(num2str(j))
%drawnow

Must be something to do with convn and CTRL-C.

Ceral Paquet <octavebugs>
Thu 21 Aug 2014 05:26:14 PM UTC, original submission:

This is an issue I was seeing on 32-bit version 3.8.1 on my old beater computer but I am also seeing it on 64-bit 3.8.2 on my new computer.

I am seeing a lot of crashes after using CTRL-C to interrupt a running program. Not every time but if I start and stop enough times (less than 10) then it will exit rudely with no message. This is with octave-cli, not related to the GUI.

I recompiled without optimizations and with debugging symbols + gdb, as described here: http://wiki.octave.org/Debugging_Octave

However it seems CTRL-C doesn't really interrupt octave in the gdb environment, rather it passes control to the gdb prompt. So it wasn't possible to replicate the bug and get a decent bug report.

The following script produces the problem, if you start and stop it (e.g. at the octave prompt type weird_bug2 then after a few seconds press CTRL-C, then repeat). On my system it will segfault after 2-10 tries.

%-----------------------------------------------
function weird_bug2()

data = randn(1000,1000,4)+i*randn(1000,1000,4);
X = randn(7,7,4)+i*randn(7,7,4);

for j = 1:100

im = convn(data,X,'same');
imagesc(dot(im,im,3))
title(num2str(j))
drawnow

end
%------------------------------------------------

The only other clue I have is that is only happens with complex variables (data, X).

Ceral Paquet <octavebugs>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Digest:
   bug dependencies.

 

Carbon-Copy List
  • -unavailable- added by mtmiller (Posted a comment)
  • -unavailable- added by jwe (Posted a comment)
  • -unavailable- added by octavebugs (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 13 Mar 2016 10:15:27 PM UTCmtmillerDependencies-=>bugs #47400 is dependent
    Wed 27 Aug 2014 05:35:40 AM UTCmtmillerCategoryNone=>Libraries
      StatusNone=>Wont Fix
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1