You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
segmentation fault observed while executing lapack-test on ppc64le #1645
Can you run broken command (one near "did not work") separately?
then (with single thread to keep backtraces short)
$ script
$ OPENBLAS_NUM_THREADS=1 gdb XXX/testprog
gdb> run <input.in >output.out
.... CRASH .... SEGV ....
gdb> bt
...Here comes interesting stuff...
gdb> q
$ Ctrl-D
... file is typescript
and attach "interesting" part from gdb output
also if it does not crash every time roll through like 10x to see if backtrace content (call chain) does not change, which may indicate e.g. stack corruption
start with one, probably it is some generic problem that single fix fixes rest of crashes
Edit - I mean PPC only for now as no problem on x86
Looks like it fails right away when we hit the fortran code because the MAIN__ function tries to allocate a ~10MB stack frame:
(gdb) where
#0 0x0000000010001e34 in MAIN__ ()
#1 0x00007ffff7995100 in generic_start_main.isra.0 () from /lib64/libc.so.6
#2 0x00007ffff79952f4 in __libc_start_main () from /lib64/libc.so.6
#3 0x0000000000000000 in ?? ()
(gdb) x/20i MAIN__
[...]
0x10001e2c <MAIN__+24>: lis r0,-157
0x10001e30 <MAIN__+28>: ori r0,r0,9056
=> 0x10001e34 <MAIN__+32>: stdux r1,r1,r0
(gdb) info registers r0 r1
r0 0xffffffffff632360 18446744073699271520
r1 0x7fffffffed30 140737488350512
(r1 is the stack frame pointer on ppc64le. The lis/ori is constructing the size of the frame in r0 (157 * 2^16 - 9056), and then the stdux would establish the new frame and linkage back to previous.)
I think the PROGRAM level stuff in zchkee.f will be MAIN__ here. I quite a few local variables being defined there, but haven't walked them to see if they'd amount to ~10MB.
Do you get same problem with:
Fedora EPEL OpenBLAS 0.30.0 binary RPM?
Using SCL compilers i.e gcc/gfortran 7.3.1?
Somebody should have noticed the fact no gfortran produce ever worked....
It turns out I see this on x86 as well, at least in a CentOS 7 docker container on an Ubuntu 16.04 host.
I installed OpenBLAS 0.3.0 from EPEL (including -devel) and tried to make lapack-test straight away using the example make.inc. That build failed due to lack of libtmglib.a, so I make; make lapack-test.
So I'm not certain whether the lapack bits were built against the EPEL-provided OpenBLAS, or the one I'd just built.
And again it seems because MAIN__ is trying to create a ~10MB stack frame while the stack ulimit is only 8MB:
(gdb) where
#0 0x0000000000401fb3 in MAIN__ ()
#1 0x0000000000401e3d in main ()
(gdb) x/20i MAIN__
...
0x401fa1 <MAIN__+17>: sub $0x9cdcd8,%rsp
0x401fa8 <MAIN__+24>: lea 0x614ed0(%rsp),%r15
0x401fb0 <MAIN__+32>: mov %r15,%rdi
=> 0x401fb3 <MAIN__+35>: callq 0x4018e0 <memset@plt>
...
(gdb) print 0x9cdcd8
$1 = 10280152
(I assume the crash is delayed to the callq on x86 because that will want to write at the current stack pointer value, vs occuring at the stack-growing stdwu on Power which writes to the stack then.)
At any rate, the problem isn't limited to Power, and the new suggestion in the FAQ works for both Power and x86 platforms:
Activity
brada4 commentedon Jun 29, 2018
Is it same with single threaded version?
deepali-c commentedon Jun 29, 2018
Yes I do see similar exceptions with
OMP_NUM_THREADS=1as well.brada4 commentedon Jun 29, 2018
Can you run broken command (one near "did not work") separately?
then (with single thread to keep backtraces short)
and attach "interesting" part from gdb output
also if it does not crash every time roll through like 10x to see if backtrace content (call chain) does not change, which may indicate e.g. stack corruption
start with one, probably it is some generic problem that single fix fixes rest of crashes
Edit - I mean PPC only for now as no problem on x86
hartb commentedon Jun 29, 2018
I work with @deepali-c
The test I see segfaulting is several different runs of
xeigtstz:Looks like it fails right away when we hit the fortran code because the
MAIN__function tries to allocate a ~10MB stack frame:(r1 is the stack frame pointer on ppc64le. The
lis/oriis constructing the size of the frame in r0 (157 * 2^16 - 9056), and then thestduxwould establish the new frame and linkage back to previous.)I think the
PROGRAMlevel stuff inzchkee.fwill beMAIN__here. I quite a few local variables being defined there, but haven't walked them to see if they'd amount to ~10MB.martin-frbg commentedon Jun 29, 2018
That code is taken directly from the netlib reference implementation (https://github.com/Reference-LAPACK/lapack) so if the stack size is actually the source of the problem I think it would have been noticed elsewhere. (Or perhaps the default stack size limit is smaller on your ppc64le than on other
platforms, can you check and/or adjust it with
ulimit?)hartb commentedon Jun 29, 2018
Ah; that's it! The default ulimit in the environment we're running in (ppc64le in a RHEL 7.5 docker container on RHEL 7.5 host) is 8MB:
Setting
$ ulimit -s unlimitedallows the test to succeed.Thank you!
brada4 commentedon Jun 30, 2018
Do you get same problem with:
Fedora EPEL OpenBLAS 0.30.0 binary RPM?
Using SCL compilers i.e gcc/gfortran 7.3.1?
Somebody should have noticed the fact no gfortran produce ever worked....
martin-frbg commentedon Jun 30, 2018
@brada4 I expect few people run the full lapack-test. Closing for now, please reopen if you encounter a test that still fails.
martin-frbg commentedon Jul 1, 2018
Added to the FAQ now
hartb commentedon Jul 2, 2018
It turns out I see this on x86 as well, at least in a CentOS 7 docker container on an Ubuntu 16.04 host.
I installed OpenBLAS 0.3.0 from EPEL (including
-devel) and tried tomake lapack-teststraight away using the examplemake.inc. That build failed due to lack oflibtmglib.a, so Imake; make lapack-test.So I'm not certain whether the lapack bits were built against the EPEL-provided OpenBLAS, or the one I'd just built.
That build succeeded and then:
And again it seems because
MAIN__is trying to create a ~10MB stack frame while the stack ulimit is only 8MB:(I assume the crash is delayed to the
callqon x86 because that will want to write at the current stack pointer value, vs occuring at the stack-growingstdwuon Power which writes to the stack then.)At any rate, the problem isn't limited to Power, and the new suggestion in the FAQ works for both Power and x86 platforms:
https://github.com/xianyi/OpenBLAS/wiki/Faq#xeigtst
Thank you!