bugGNU Octave - Bugs: bug #62144, Crash on exit using OpenBlas built...

 
 

bug #62144: Crash on exit using OpenBlas built with USE_TLS=1 but not an Octave bug

Submitter:  Arun Giridhar <arungiridhar>
Submitted:  Sun 06 Mar 2022 04:29:40 PM 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:  Open/Closed:  * Closed
Release:  * dev Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Sun 13 Mar 2022 12:43:07 PM UTC, comment #3: 

IIUC, there is nothing Octave can do to avoid this issue. A user would need to make sure that Octave and all of its dependencies consistently link with either libgomp or libomp, or use the other work-around mentioned by Arun. (But I'm not sure if it is a good idea to mix libgomp and libomp even with that work-around...)

Closing as invalid.

Markus Mützel <mmuetzel>
Group administrator
Sun 13 Mar 2022 02:26:11 AM UTC, comment #2: 

This report can be closed. For anyone who might get the same error, the two things to try out are:

  • recompile OpenBlas with USE_TLS=0, or


  • recompile Octave using the same compiler used for OpenBlas.


In particular, compiling Octave with clang and compiling OpenBlas with gcc (usually the system default) is problematic in this instance due to Clang choosing to link Octave with both OMP and GOMP. Gcc links with only GOMP so there is no segfault there.

Arun Giridhar <arungiridhar>
Group Member
Sun 06 Mar 2022 04:38:52 PM UTC, comment #1: 

Bug report submitted upstream at https://github.com/xianyi/OpenBLAS/issues/3564

Arun Giridhar <arungiridhar>
Group Member
Sun 06 Mar 2022 04:29:40 PM UTC, original submission:  

This is a near-repeat of bug #61742 that I am adding here to get a bug number so I can report upstream to OpenBlas. The previous bug was for OpenBlas 0.3.19 and this one is for OpenBlas 0.3.20.

This is not an Octave bug and no action is needed from Octave devs.

There is a crash on exiting Octave when using OpenBlas built with the USE_TLS=1 flag that comes standard with some Linux distros like Arch, Manjaro and other Arch derivatives.

The test is as follows, when using multithreaded OpenBlas:


$ octave
octave:1> n = 64; A = ones(n,n); B = A^2; assert (all (B(:) == n))
octave:2> exit
### This will exit normally in all circumstances, because multithreading is not used for n <= 64

$ octave
octave:1> n = 65; A = ones(n,n); B = A^2; assert (all (B(:) == n))
octave:2> exit
### This will crash with a segfault if USE_TLS=1 was used in building OpenBlas, and exit normally otherwise


No action is needed from the Octave dev team. I will be submitting a bug report upstream to OpenBlas linking to this report.

The solution as before is to not use USE_TLS=1 for OpenBlas, or if your distro's OpenBlas PKGBUILD installation script already comes with it, to change it to USE_TLS=0. This package still uses the problematic USE_TLS=1 setting as of now: https://aur.archlinux.org/packages/openblas-lapack/

Arun Giridhar <arungiridhar>
Group Member

 

(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 arungiridhar (Submitted the item)
  •  

    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 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2022-03-13 mmuetzel StatusNone Invalid / Not an Octave Bug
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-4b48.
    Corresponding source code