bugGNU Octave - Bugs: bug #60762, Repeatable crash on exit when...

 
 

bug #60762: Repeatable crash on exit when OPENBLAS_NUM_THREADS is set to 6

Submitter:  None
Submitted:  Thu 10 Jun 2021 12:19:02 AM UTC
   
 
Category:  Libraries Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Segfault, Bus Error, etc.
Status:  Invalid / Not an Octave Bug Assigned to:  None
Originator Name:  Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * dev
Operating System:  * GNU/Linux Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 15 Jun 2021 12:16:51 PM UTC, comment #5: 

Afaict, Octave doesn't do anything directly with OPENBLAS_NUM_THREADS or any of the other variables.
If setting one of the variables causes a crash on exit but setting the other does not, that might be an issue in upstream OpenBLAS.
It might be worth reporting upstream(?).

Anyway, closing as invalid. If it should turn out that this is actually an issue in Octave, we can re-open the report.

Markus Mützel <mmuetzel>
Group administrator
Thu 10 Jun 2021 06:15:19 PM UTC, comment #4: 

I think I found the problem. Quoting from here: https://github.com/xianyi/OpenBLAS


The priorities are OPENBLAS_NUM_THREADS > GOTO_NUM_THREADS > OMP_NUM_THREADS.

If you compile this library with USE_OPENMP=1, you should set the OMP_NUM_THREADS environment variable; OpenBLAS ignores OPENBLAS_NUM_THREADS and GOTO_NUM_THREADS when compiled with USE_OPENMP=1.


The distro sets OpenBlas to build using USE_OPENMP=1, and tuning OMP_NUM_THREADS before calling Octave has a 20% difference in performance without crashing but changing OPENBLAS_NUM_THREADS on a library built with USE_OPENMP=1 causes a crash.

Either way, Octave itself is not affected by this OpenBlas library behavior.

Anonymous
Thu 10 Jun 2021 03:01:27 PM UTC, comment #3: 

This is on Octave 7, and there are no errors while building Octave, and nothing unusual in make check. This is on Manjaro Linux.

Anonymous
Thu 10 Jun 2021 02:55:29 AM UTC, comment #2: 

@OP: Which Linux distribution do you use?

With Octave "dev" you mean "Octave 7"?

Does "./bootstrap", "./configure", "make", "make check" show anything suspicious?

Kai Torben Ohlhus <siko1056>
Group Member
Thu 10 Jun 2021 12:30:12 AM UTC, comment #1: 

The issue is most likely is with openblas binary you are using.

Dmitri.
--

Dmitri A. Sergatskov <dasergatskov>
Thu 10 Jun 2021 12:19:02 AM UTC, original submission:  

While testing the effect of OPENBLAS_NUM_THREADS I found this repeatable crash on exit. It does not affect anything on the user side except crashing on exit when that environment variable is touched, and the user-size solution is to not mess with that variable. This bug report is to bring it to the devs' attention in case it's a bigger problem.

For reference, this is on a CPU with 6 cores and 12 threads. The OpenBLAS version is 0.3.15 and installed from the distro package.

Abnormal exit when using OPENBLAS_NUM_THREADS=6:

$ OPENBLAS_NUM_THREADS=6 octave -q    ### <------ THIS LINE IS THE ONLY DIFFERENCE IN INPUT
octave:1> load bench
octave:2> whos
Variables visible from the current scope:

variables in scope: top scope

   Attr Name        Size                     Bytes  Class
   ==== ====        ====                     =====  =====
        adj       528x528                  1115136  single

Total is 278784 elements using 1115136 bytes

octave:3> bak = adj;
octave:4> tic; for i = 1:1e3, A = bak; for j = 1:10, A = min (A+A^2, 1); end; end; toc
Elapsed time is 11.3746 seconds.
octave:5> tic; for i = 1:1e3, A = bak; for j = 1:10, A = min (A+A^2, 1); end; end; toc
Elapsed time is 11.3877 seconds.
octave:6> exit                        ### <------ CRASH HERE
fatal: caught signal Segmentation fault -- stopping myself...
Segmentation fault (core dumped)


Normal operation leaving OPENBLAS_NUM_THREADS to its default:

$ octave -q                           ### <------ THIS LINE IS THE ONLY DIFFERENCE IN INPUT
octave:1> load bench
octave:2> whos
Variables visible from the current scope:

variables in scope: top scope

   Attr Name        Size                     Bytes  Class
   ==== ====        ====                     =====  =====
        adj       528x528                  1115136  single

Total is 278784 elements using 1115136 bytes

octave:3> bak = adj;
octave:4> tic; for i = 1:1e3, A = bak; for j = 1:10, A = min (A+A^2, 1); end; end; toc
Elapsed time is 11.3243 seconds.
octave:5> tic; for i = 1:1e3, A = bak; for j = 1:10, A = min (A+A^2, 1); end; end; toc
Elapsed time is 11.3759 seconds.
octave:6> exit                        ### <------ NORMAL EXIT


Anonymous

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by mmuetzel (Posted a comment)
  • -email is unavailable- added by siko1056 (Posted a comment)
  • -email is unavailable- added by dasergatskov (Posted a comment)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2021-06-15 mmuetzel CategoryNone Libraries
        StatusNone Invalid / Not an Octave Bug
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code