LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 11-27-2020, 09:05 AM   #1
mostlyharmless
Senior Member
 
Registered: Jan 2008
Distribution: Arch/Manjaro, might try Slackware again
Posts: 1,851
Blog Entries: 14

Rep: Reputation: 284Reputation: 284Reputation: 284
lock in libpthread occurs only on one Arch installation only with gcc-fortran


So, I have an unusual problem I first thought was a gfortran compiler bug. As far as can tell, however, it is specific to one machine's Arch install, and I can't reproduce it on another with Debian, or Manjaro, with the same kernel and compiler...(else I'd report it on GCC bugzilla)

So I'm posting it in General; it's a puzzle!

Using either 5.7.x, 5.8.x, or 5.9.x kernels on Arch and GNU Fortran (GCC) 10.2.0, we have a program calling a function as part of a write statement, where the function also has a write statement.

Code:
PROGRAM bugs
USE badwrite
 x=AC(0)  
 write(*,*) 'x: ',x  ! this works
 write (*,*) '0: ',AC(0)  !this does not  
STOP
END

MODULE badwrite 
 CONTAINS
 function AC(m2) result(c) 
 INTEGER,INTENT(IN) :: m2
 write(*,*) m2    !killer statement with lapack or other linked library
 c = m2+3
 end function AC
END MODULE badwrite
compiled with
gfortran -c -llapack badwrite.f90
gfortran -llapack badwrite.f90 bugs.f90

should result in
0
x: 3.0000000
0: 0
3.00000000

However with the -llapack library (or the blas library, and possibly other external libraries)
the result is
0
x: 3.000000

(program hangs here)

Adding the -ggdb flag, running in gdb and interrupting with ^C results in
Code:
 
Starting program: /home/me/build/bugs.lib90/a.out 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
           0
 x:    3.00000000    
^C
Program received signal SIGINT, Interrupt.
0x00007ffff6baddb0 in __lll_lock_wait () from /usr/lib/libpthread.so.0
Apparently the two writes are deadlocked?

Conditions:

(1) Only happens with an external library linked in, so

gfortran -c badwrite.f90
gfortran badwrite.f90 bugs.f90

runs normally without hanging

(2) Removing the write statement in the function AC also removes the hang.

(3) Separating the writes, as in the first statement with x=AC(0) then write(*,*) x, removes the deadlock/hang

(4) Another machine running the same kernel/gfortran version under Manjaro does not have the hang

(5) The problem does not occur with pgfortran (aka nvfortran) 20.7-0 LLVM on the machine in question.

(6) Changing kernels on the same machine does not solve the problem.

(7) Reinstalling packages with pacman, rebooting does not solve the problem.

In conclusion, it does seem to be a gcc-fortran bug with a race condition, but what triggers it on this machine is beyond me. I'd rather not reinstall the whole system, which is otherwise working perfectly.

Any ideas? I'm going to boot a live version of Manjaro on this hardware to see if it's a weird CPU bug.
 
Old 11-28-2020, 03:28 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,876

Rep: Reputation: 7315Reputation: 7315Reputation: 7315Reputation: 7315Reputation: 7315Reputation: 7315Reputation: 7315Reputation: 7315Reputation: 7315Reputation: 7315Reputation: 7315
I wouldn't say it is a CPU bug. Also I wouldn't try to reinstall the system - without knowing the reason.
You need to get (and post) the full stack trace, not only the current line. And also would be nice to see the other threads (if there were any).
strace also may help to gather info....
 
1 members found this post helpful.
Old 11-28-2020, 11:54 AM   #3
mostlyharmless
Senior Member
 
Registered: Jan 2008
Distribution: Arch/Manjaro, might try Slackware again
Posts: 1,851

Original Poster
Blog Entries: 14

Rep: Reputation: 284Reputation: 284Reputation: 284
Thank you very much for replying. I was not hopeful, thinking I'd just have someone post that I had a broken system and should reinstall!

I did try booting the live version, and as expected by you and me, the bug vanished.. so not a hardware issue.

Could you tell me how to get the full stack trace, or point me to some relatively easy to understand instructions? I tried compiling with -fbacktrace, but have no idea what do with it, I also looked at https://gcc.gnu.org/onlinedocs/gcc-4...ugging-Options, which I found overwhelming.

I don't know what you mean by other threads. As you might surmise, I'm a bit of a Neanderthal coder (no insult meant to our ancestors). I found this bug/problem by putting "write" statements in my code as a means of debugging some code. So my level of debugging sophistication is limited.

I also have no idea how to use strace. I ran the fortran executable in one terminal, found its PID in another terminal and ran strace -p {the process PID} with the result

futex(0x564398e4a950, FUTEX_WAIT_PRIVATE, 2, NULL
 
Old 11-28-2020, 12:03 PM   #4
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,876

Rep: Reputation: 7315Reputation: 7315Reputation: 7315Reputation: 7315Reputation: 7315Reputation: 7315Reputation: 7315Reputation: 7315Reputation: 7315Reputation: 7315Reputation: 7315
Code:
strace -o <output file> -f <your program>
will save the strace output of the full execution. You can Ctrl^C as usual and check the result.
here you can find some info about backtrace (sometimes called stack trace): https://senarvi.github.io/stack-trace-with-gdb/

by the way if you could run it from the live version:
I would compare the libraries used (see ldd)

Last edited by pan64; 11-28-2020 at 12:05 PM.
 
1 members found this post helpful.
Old 11-28-2020, 12:24 PM   #5
mostlyharmless
Senior Member
 
Registered: Jan 2008
Distribution: Arch/Manjaro, might try Slackware again
Posts: 1,851

Original Poster
Blog Entries: 14

Rep: Reputation: 284Reputation: 284Reputation: 284
Here's the result of strace -o stack.txt -f ./a.out

I'm not sure why the AMDAPPSDK is involved, I do not believe it is installed anymore, though it was at some point in the past. [EDIT: just an old environment statement still in .bashrc under LD_LIBRARY_PATH]

Code:
67094 execve("./a.out", ["./a.out"], 0x7ffdf3842798 /* 54 vars */) = 0
67094 brk(NULL)                         = 0x557300d7c000
67094 arch_prctl(0x3001 /* ARCH_??? */, 0x7fffe1fbb850) = -1 EINVAL (Invalid argument)
67094 access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
67094 openat(AT_FDCWD, "/home/me/AMDAPPSDK-2.9-1/lib/x86_64/tls/x86_64/x86_64/liblapack.so.3", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
67094 stat("/home/me/AMDAPPSDK-2.9-1/lib/x86_64/tls/x86_64/x86_64", 0x7fffe1fba9f0) = -1 ENOENT (No such file or directory)
67094 openat(AT_FDCWD, "/home/me/AMDAPPSDK-2.9-1/lib/x86_64/tls/x86_64/liblapack.so.3", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
67094 stat("/home/me/AMDAPPSDK-2.9-1/lib/x86_64/tls/x86_64", 0x7fffe1fba9f0) = -1 ENOENT (No such file or directory)
67094 openat(AT_FDCWD, "/home/me/AMDAPPSDK-2.9-1/lib/x86_64/tls/x86_64/liblapack.so.3", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
67094 stat("/home/me/AMDAPPSDK-2.9-1/lib/x86_64/tls/x86_64", 0x7fffe1fba9f0) = -1 ENOENT (No such file or directory)
67094 openat(AT_FDCWD, "/home/me/AMDAPPSDK-2.9-1/lib/x86_64/tls/liblapack.so.3", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
67094 stat("/home/me/AMDAPPSDK-2.9-1/lib/x86_64/tls", 0x7fffe1fba9f0) = -1 ENOENT (No such file or directory)
67094 openat(AT_FDCWD, "/home/me/AMDAPPSDK-2.9-1/lib/x86_64/x86_64/x86_64/liblapack.so.3", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
67094 stat("/home/me/AMDAPPSDK-2.9-1/lib/x86_64/x86_64/x86_64", 0x7fffe1fba9f0) = -1 ENOENT (No such file or directory)
67094 openat(AT_FDCWD, "/home/me/AMDAPPSDK-2.9-1/lib/x86_64/x86_64/liblapack.so.3", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
67094 stat("/home/me/AMDAPPSDK-2.9-1/lib/x86_64/x86_64", 0x7fffe1fba9f0) = -1 ENOENT (No such file or directory)
67094 openat(AT_FDCWD, "/home/me/AMDAPPSDK-2.9-1/lib/x86_64/x86_64/liblapack.so.3", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
67094 stat("/home/me/AMDAPPSDK-2.9-1/lib/x86_64/x86_64", 0x7fffe1fba9f0) = -1 ENOENT (No such file or directory)
67094 openat(AT_FDCWD, "/home/me/AMDAPPSDK-2.9-1/lib/x86_64/liblapack.so.3", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
67094 stat("/home/me/AMDAPPSDK-2.9-1/lib/x86_64", 0x7fffe1fba9f0) = -1 ENOENT (No such file or directory)
67094 openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
67094 fstat(3, {st_mode=S_IFREG|0644, st_size=260871, ...}) = 0
67094 mmap(NULL, 260871, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f6f66a45000
67094 close(3)                          = 0
67094 openat(AT_FDCWD, "/usr/lib/liblapack.so.3", O_RDONLY|O_CLOEXEC) = 3
67094 read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0 9\3\0\0\0\0\0"..., 832) = 832
67094 fstat(3, {st_mode=S_IFREG|0755, st_size=7168624, ...}) = 0
67094 mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f6f66a43000
67094 mmap(NULL, 7171376, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f6f6636c000
67094 mmap(0x7f6f66398000, 6262784, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2c000) = 0x7f6f66398000
67094 mmap(0x7f6f66991000, 704512, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x625000) = 0x7f6f66991000
67094 mmap(0x7f6f66a3d000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x6d0000) = 0x7f6f66a3d000
67094 close(3)                          = 0
67094 openat(AT_FDCWD, "/usr/lib/libgfortran.so.5", O_RDONLY|O_CLOEXEC) = 3
67094 read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0000\335\1\0\0\0\0\0"..., 832) = 832
67094 fstat(3, {st_mode=S_IFREG|0755, st_size=11808080, ...}) = 0
67094 mmap(NULL, 2918976, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f6f660a3000
67094 mprotect(0x7f6f660c0000, 2789376, PROT_NONE) = 0
67094 mmap(0x7f6f660c0000, 2580480, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1d000) = 0x7f6f660c0000
67094 mmap(0x7f6f66336000, 204800, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x293000) = 0x7f6f66336000
67094 mmap(0x7f6f66369000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2c5000) = 0x7f6f66369000
67094 close(3)                          = 0
67094 openat(AT_FDCWD, "/usr/lib/libm.so.6", O_RDONLY|O_CLOEXEC) = 3
67094 read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\260\363\0\0\0\0\0\0"..., 832) = 832
67094 fstat(3, {st_mode=S_IFREG|0755, st_size=1332096, ...}) = 0
67094 mmap(NULL, 1331224, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f6f65f5d000
67094 mmap(0x7f6f65f6c000, 638976, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xf000) = 0x7f6f65f6c000
67094 mmap(0x7f6f66008000, 626688, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xab000) = 0x7f6f66008000
67094 mmap(0x7f6f660a1000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x143000) = 0x7f6f660a1000
67094 close(3)                          = 0
67094 openat(AT_FDCWD, "/usr/lib/libgcc_s.so.1", O_RDONLY|O_CLOEXEC) = 3
67094 read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0 0\0\0\0\0\0\0"..., 832) = 832
67094 fstat(3, {st_mode=S_IFREG|0644, st_size=594704, ...}) = 0
67094 mmap(NULL, 103144, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f6f65f43000
67094 mmap(0x7f6f65f46000, 69632, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x3000) = 0x7f6f65f46000
67094 mmap(0x7f6f65f57000, 16384, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x14000) = 0x7f6f65f57000
67094 mmap(0x7f6f65f5b000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x17000) = 0x7f6f65f5b000
67094 close(3)                          = 0
67094 openat(AT_FDCWD, "/usr/lib/libquadmath.so.0", O_RDONLY|O_CLOEXEC) = 3
67094 read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0 0\0\0\0\0\0\0"..., 832) = 832
67094 fstat(3, {st_mode=S_IFREG|0755, st_size=1250952, ...}) = 0
67094 mmap(NULL, 303152, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f6f65ef8000
67094 mmap(0x7f6f65efb000, 188416, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x3000) = 0x7f6f65efb000
67094 mmap(0x7f6f65f29000, 98304, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x31000) = 0x7f6f65f29000
67094 mmap(0x7f6f65f41000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x48000) = 0x7f6f65f41000
67094 close(3)                          = 0
67094 openat(AT_FDCWD, "/usr/lib/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
67094 read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\220\202\2\0\0\0\0\0"..., 832) = 832
67094 pread64(3, "\6\0\0\0\4\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0"..., 784, 64) = 784
67094 pread64(3, "\4\0\0\0\20\0\0\0\5\0\0\0GNU\0\2\0\0\300\4\0\0\0\3\0\0\0\0\0\0\0", 32, 848) = 32
67094 pread64(3, "\4\0\0\0\24\0\0\0\3\0\0\0GNU\0\207\360\21\247\344\314?\306\nT\320\323\335i\16t"..., 68, 880) = 68
67094 fstat(3, {st_mode=S_IFREG|0755, st_size=2159552, ...}) = 0
67094 pread64(3, "\6\0\0\0\4\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0"..., 784, 64) = 784
67094 mmap(NULL, 1868448, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f6f65d2f000
67094 mmap(0x7f6f65d55000, 1363968, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x26000) = 0x7f6f65d55000
67094 mmap(0x7f6f65ea2000, 311296, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x173000) = 0x7f6f65ea2000
67094 mmap(0x7f6f65eee000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1be000) = 0x7f6f65eee000
67094 mmap(0x7f6f65ef4000, 12960, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f6f65ef4000
67094 close(3)                          = 0
67094 openat(AT_FDCWD, "/usr/lib/libcblas.so", O_RDONLY|O_CLOEXEC) = 3
67094 read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0 [\0\0\0\0\0\0"..., 832) = 832
67094 fstat(3, {st_mode=S_IFREG|0755, st_size=145960, ...}) = 0
67094 mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f6f65d2d000
67094 mmap(NULL, 148896, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f6f65d08000
67094 mmap(0x7f6f65d0d000, 102400, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x5000) = 0x7f6f65d0d000
67094 mmap(0x7f6f65d26000, 20480, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1e000) = 0x7f6f65d26000
67094 mmap(0x7f6f65d2b000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x22000) = 0x7f6f65d2b000
67094 close(3)                          = 0
67094 openat(AT_FDCWD, "/usr/lib/libblas.so.3", O_RDONLY|O_CLOEXEC) = 3
67094 read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0000\224\0\0\0\0\0\0"..., 832) = 832
67094 fstat(3, {st_mode=S_IFREG|0755, st_size=134840, ...}) = 0
67094 mmap(NULL, 137768, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f6f65ce6000
67094 mmap(0x7f6f65cee000, 77824, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x8000) = 0x7f6f65cee000
67094 mmap(0x7f6f65d01000, 20480, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1b000) = 0x7f6f65d01000
67094 mmap(0x7f6f65d06000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1f000) = 0x7f6f65d06000
67094 close(3)                          = 0
67094 openat(AT_FDCWD, "/usr/lib/libatlas.so", O_RDONLY|O_CLOEXEC) = 3
67094 read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\200\t\5\0\0\0\0\0"..., 832) = 832
67094 fstat(3, {st_mode=S_IFREG|0755, st_size=6733672, ...}) = 0
67094 mmap(NULL, 6736680, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f6f65679000
67094 mprotect(0x7f6f656c2000, 6402048, PROT_NONE) = 0
67094 mmap(0x7f6f656c2000, 6070272, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x49000) = 0x7f6f656c2000
67094 mmap(0x7f6f65c8c000, 327680, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x613000) = 0x7f6f65c8c000
67094 mmap(0x7f6f65cdd000, 36864, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x663000) = 0x7f6f65cdd000
67094 close(3)                          = 0
67094 openat(AT_FDCWD, "/usr/lib/libpthread.so.0", O_RDONLY|O_CLOEXEC) = 3
67094 read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0000\201\0\0\0\0\0\0"..., 832) = 832
67094 pread64(3, "\4\0\0\0\24\0\0\0\3\0\0\0GNU\0\307Y\373z\3054\277z\21\35\225\341\273\304<\223"..., 68, 824) = 68
67094 fstat(3, {st_mode=S_IFREG|0755, st_size=158744, ...}) = 0
67094 mmap(NULL, 135600, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f6f65657000
67094 mmap(0x7f6f6565e000, 65536, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x7000) = 0x7f6f6565e000
67094 mmap(0x7f6f6566e000, 20480, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x17000) = 0x7f6f6566e000
67094 mmap(0x7f6f65673000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1b000) = 0x7f6f65673000
67094 mmap(0x7f6f65675000, 12720, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f6f65675000
67094 close(3)                          = 0
67094 mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f6f65655000
67094 arch_prctl(ARCH_SET_FS, 0x7f6f656562c0) = 0
67094 mprotect(0x7f6f65eee000, 12288, PROT_READ) = 0
67094 mprotect(0x7f6f65673000, 4096, PROT_READ) = 0
67094 mprotect(0x7f6f660a1000, 4096, PROT_READ) = 0
67094 mprotect(0x7f6f65cdd000, 20480, PROT_READ) = 0
67094 mprotect(0x7f6f65f5b000, 4096, PROT_READ) = 0
67094 mprotect(0x7f6f65f41000, 4096, PROT_READ) = 0
67094 mprotect(0x7f6f66369000, 8192, PROT_READ) = 0
67094 mprotect(0x7f6f65d06000, 4096, PROT_READ) = 0
67094 mprotect(0x7f6f65d2b000, 4096, PROT_READ) = 0
67094 mprotect(0x7f6f66a3d000, 4096, PROT_READ) = 0
67094 mprotect(0x557300d4b000, 4096, PROT_READ) = 0
67094 mprotect(0x7f6f66ab1000, 4096, PROT_READ) = 0
67094 munmap(0x7f6f66a45000, 260871)    = 0
67094 set_tid_address(0x7f6f65656590)   = 67094
67094 set_robust_list(0x7f6f656565a0, 24) = 0
67094 rt_sigaction(SIGRTMIN, {sa_handler=0x7f6f6565eb90, sa_mask=[], sa_flags=SA_RESTORER|SA_SIGINFO, sa_restorer=0x7f6f6566b0f0}, NULL, 8) = 0
67094 rt_sigaction(SIGRT_1, {sa_handler=0x7f6f6565ec30, sa_mask=[], sa_flags=SA_RESTORER|SA_RESTART|SA_SIGINFO, sa_restorer=0x7f6f6566b0f0}, NULL, 8) = 0
67094 rt_sigprocmask(SIG_UNBLOCK, [RTMIN RT_1], NULL, 8) = 0
67094 prlimit64(0, RLIMIT_STACK, NULL, {rlim_cur=8192*1024, rlim_max=RLIM64_INFINITY}) = 0
67094 brk(NULL)                         = 0x557300d7c000
67094 brk(0x557300d9d000)               = 0x557300d9d000
67094 fstat(0, {st_mode=S_IFCHR|0620, st_rdev=makedev(0x88, 0), ...}) = 0
67094 fstat(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(0x88, 0), ...}) = 0
67094 fstat(2, {st_mode=S_IFCHR|0620, st_rdev=makedev(0x88, 0), ...}) = 0
67094 rt_sigaction(SIGQUIT, {sa_handler=0x7f6f660c1a60, sa_mask=[QUIT], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7f6f65d6c6a0}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
67094 rt_sigaction(SIGILL, {sa_handler=0x7f6f660c1a60, sa_mask=[ILL], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7f6f65d6c6a0}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
67094 rt_sigaction(SIGABRT, {sa_handler=0x7f6f660c1a60, sa_mask=[ABRT], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7f6f65d6c6a0}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
67094 rt_sigaction(SIGFPE, {sa_handler=0x7f6f660c1a60, sa_mask=[FPE], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7f6f65d6c6a0}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
67094 rt_sigaction(SIGSEGV, {sa_handler=0x7f6f660c1a60, sa_mask=[SEGV], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7f6f65d6c6a0}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
67094 rt_sigaction(SIGBUS, {sa_handler=0x7f6f660c1a60, sa_mask=[BUS], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7f6f65d6c6a0}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
67094 rt_sigaction(SIGSYS, {sa_handler=0x7f6f660c1a60, sa_mask=[SYS], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7f6f65d6c6a0}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
67094 rt_sigaction(SIGTRAP, {sa_handler=0x7f6f660c1a60, sa_mask=[TRAP], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7f6f65d6c6a0}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
67094 rt_sigaction(SIGXCPU, {sa_handler=0x7f6f660c1a60, sa_mask=[XCPU], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7f6f65d6c6a0}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
67094 rt_sigaction(SIGXFSZ, {sa_handler=0x7f6f660c1a60, sa_mask=[XFSZ], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7f6f65d6c6a0}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
67094 write(1, "           0\n", 13)    = 13
67094 write(1, " x:    3.00000000    \n", 22) = 22
67094 futex(0x557300d7e950, FUTEX_WAIT_PRIVATE, 2, NULL) = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
67094 --- SIGINT {si_signo=SIGINT, si_code=SI_KERNEL} ---
67094 +++ killed by SIGINT +++
The result of "ldd a.out" is
Code:
	linux-vdso.so.1 (0x00007ffdca1f9000)
	liblapack.so.3 => /usr/lib/liblapack.so.3 (0x00007f7faa7f2000)
	libgfortran.so.5 => /usr/lib/libgfortran.so.5 (0x00007f7faa529000)
	libm.so.6 => /usr/lib/libm.so.6 (0x00007f7faa3e3000)
	libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x00007f7faa3c9000)
	libquadmath.so.0 => /usr/lib/libquadmath.so.0 (0x00007f7faa37e000)
	libc.so.6 => /usr/lib/libc.so.6 (0x00007f7faa1b5000)
	libcblas.so => /usr/lib/libcblas.so (0x00007f7faa18e000)
	libblas.so.3 => /usr/lib/libblas.so.3 (0x00007f7faa16c000)
	/lib64/ld-linux-x86-64.so.2 => /usr/lib64/ld-linux-x86-64.so.2 (0x00007f7faaf10000)
	libatlas.so => /usr/lib/libatlas.so (0x00007f7fa9aff000)
	libpthread.so.0 => /usr/lib/libpthread.so.0 (0x00007f7fa9add000)
I checked ldd a.out on the other computer running Manjaro, and got the same result without libcblas or the last three entries, all of which are probably related to libatlas installed on this machine but not the other one.

Last edited by mostlyharmless; 11-28-2020 at 12:53 PM. Reason: found soemthing out
 
Old 11-28-2020, 12:32 PM   #6
mostlyharmless
Senior Member
 
Registered: Jan 2008
Distribution: Arch/Manjaro, might try Slackware again
Posts: 1,851

Original Poster
Blog Entries: 14

Rep: Reputation: 284Reputation: 284Reputation: 284
I also tried "backtrace" under gdb and got this:
Code:
#0  0x00007ffff6baedb0 in __lll_lock_wait () from /usr/lib/libpthread.so.0
#1  0x00007ffff6ba7743 in pthread_mutex_lock () from /usr/lib/libpthread.so.0
#2  0x00007ffff7852940 in __gthread_mutex_lock (__mutex=0x55555555b950) at ../libgcc/gthr-default.h:749
#3  get_gfc_unit (n=6, do_create=1) at /build/gcc/src/gcc/libgfortran/io/unit.c:395
#4  0x00007ffff785105d in data_transfer_init (dtp=0x7fffffffdef0, read_flag=0) at /build/gcc/src/gcc/libgfortran/io/transfer.c:2851
#5  0x0000555555555215 in __badwrite_MOD_ac ()
#6  0x0000555555555391 in MAIN__ ()
#7  0x0000555555555412 in main ()
which was identical to running
Code:
gdb -q \
>       -batch \
>       -ex 'set print thread-events off' \
>       -ex 'handle SIGALRM nostop pass' \
>       -ex 'handle SIGCHLD nostop pass' \
>       -ex 'run' \
>       -ex 'thread apply all backtrace' \
>       --args \
> ./a.out
with the addtional lines below showing only one thread, as expected.
Code:
Program received signal SIGINT, Interrupt.
0x00007ffff6baedb0 in __lll_lock_wait () from /usr/lib/libpthread.so.0

Thread 1 (Thread 0x7ffff6b9b2c0 (LWP 68386) "a.out"):
So, a lot more information, thanks again for your help. Very interesting stuff in these traces, but to me, still pretty opaque.

Last edited by mostlyharmless; 11-28-2020 at 12:38 PM. Reason: additional info
 
Old 11-28-2020, 01:38 PM   #7
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,876

Rep: Reputation: 7315Reputation: 7315Reputation: 7315Reputation: 7315Reputation: 7315Reputation: 7315Reputation: 7315Reputation: 7315Reputation: 7315Reputation: 7315Reputation: 7315
ok, thanks
would be nice to see how this strace looks like when it works. I do not really understand why futex was involved.
the other thing you can check is the libraries:
if the libs used by a.out are identical in the two cases (the output of ldd). At first you would need to check the size of them by ls -l /usr/lib/whatever
 
1 members found this post helpful.
Old 11-28-2020, 02:46 PM   #8
mostlyharmless
Senior Member
 
Registered: Jan 2008
Distribution: Arch/Manjaro, might try Slackware again
Posts: 1,851

Original Poster
Blog Entries: 14

Rep: Reputation: 284Reputation: 284Reputation: 284
Here's the stacktrace from the working machine:
Code:
execve("./a.out", ["./a.out"], 0x7ffd9c5b6b90 /* 55 vars */) = 0
brk(NULL)                               = 0x56202bd20000
arch_prctl(0x3001 /* ARCH_??? */, 0x7ffec8167170) = -1 EINVAL (Invalid argument)
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=181910, ...}) = 0
mmap(NULL, 181910, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f650cddf000
close(3)                                = 0
openat(AT_FDCWD, "/usr/lib/liblapack.so.3", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\20P\2\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=6952688, ...}) = 0
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f650cddd000
mmap(NULL, 7088344, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f650c71a000
mmap(0x7f650c739000, 6131712, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1f000) = 0x7f650c739000
mmap(0x7f650cd12000, 679936, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x5f8000) = 0x7f650cd12000
mmap(0x7f650cdb8000, 20480, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x69d000) = 0x7f650cdb8000
mmap(0x7f650cdbd000, 129240, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f650cdbd000
close(3)                                = 0
openat(AT_FDCWD, "/usr/lib/libgfortran.so.5", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0000\335\1\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=11808080, ...}) = 0
mmap(NULL, 2918976, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f650c451000
mprotect(0x7f650c46e000, 2789376, PROT_NONE) = 0
mmap(0x7f650c46e000, 2580480, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1d000) = 0x7f650c46e000
mmap(0x7f650c6e4000, 204800, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x293000) = 0x7f650c6e4000
mmap(0x7f650c717000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2c5000) = 0x7f650c717000
close(3)                                = 0
openat(AT_FDCWD, "/usr/lib/libm.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\260\363\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=1332096, ...}) = 0
mmap(NULL, 1331224, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f650c30b000
mmap(0x7f650c31a000, 638976, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xf000) = 0x7f650c31a000
mmap(0x7f650c3b6000, 626688, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xab000) = 0x7f650c3b6000
mmap(0x7f650c44f000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x143000) = 0x7f650c44f000
close(3)                                = 0
openat(AT_FDCWD, "/usr/lib/libgcc_s.so.1", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0 0\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0644, st_size=594704, ...}) = 0
mmap(NULL, 103144, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f650c2f1000
mmap(0x7f650c2f4000, 69632, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x3000) = 0x7f650c2f4000
mmap(0x7f650c305000, 16384, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x14000) = 0x7f650c305000
mmap(0x7f650c309000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x17000) = 0x7f650c309000
close(3)                                = 0
openat(AT_FDCWD, "/usr/lib/libquadmath.so.0", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0 0\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=1250952, ...}) = 0
mmap(NULL, 303152, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f650c2a6000
mmap(0x7f650c2a9000, 188416, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x3000) = 0x7f650c2a9000
mmap(0x7f650c2d7000, 98304, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x31000) = 0x7f650c2d7000
mmap(0x7f650c2ef000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x48000) = 0x7f650c2ef000
close(3)                                = 0
openat(AT_FDCWD, "/usr/lib/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\220\202\2\0\0\0\0\0"..., 832) = 832
pread64(3, "\6\0\0\0\4\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0"..., 784, 64) = 784
pread64(3, "\4\0\0\0\20\0\0\0\5\0\0\0GNU\0\2\0\0\300\4\0\0\0\3\0\0\0\0\0\0\0", 32, 848) = 32
pread64(3, "\4\0\0\0\24\0\0\0\3\0\0\0GNU\0\207\360\21\247\344\314?\306\nT\320\323\335i\16t"..., 68, 880) = 68
fstat(3, {st_mode=S_IFREG|0755, st_size=2159552, ...}) = 0
pread64(3, "\6\0\0\0\4\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0"..., 784, 64) = 784
mmap(NULL, 1868448, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f650c0dd000
mmap(0x7f650c103000, 1363968, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x26000) = 0x7f650c103000
mmap(0x7f650c250000, 311296, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x173000) = 0x7f650c250000
mmap(0x7f650c29c000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1be000) = 0x7f650c29c000
mmap(0x7f650c2a2000, 12960, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f650c2a2000
close(3)                                = 0
openat(AT_FDCWD, "/usr/lib/libblas.so.3", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0 1\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=349936, ...}) = 0
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f650c0db000
mmap(NULL, 352272, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f650c084000
mprotect(0x7f650c087000, 335872, PROT_NONE) = 0
mmap(0x7f650c087000, 319488, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x3000) = 0x7f650c087000
mmap(0x7f650c0d5000, 12288, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x51000) = 0x7f650c0d5000
mmap(0x7f650c0d9000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x54000) = 0x7f650c0d9000
close(3)                                = 0
mmap(NULL, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f650c081000
arch_prctl(ARCH_SET_FS, 0x7f650c081740) = 0
mprotect(0x7f650c29c000, 12288, PROT_READ) = 0
mprotect(0x7f650c44f000, 4096, PROT_READ) = 0
mprotect(0x7f650c309000, 4096, PROT_READ) = 0
mprotect(0x7f650c2ef000, 4096, PROT_READ) = 0
mprotect(0x7f650c717000, 8192, PROT_READ) = 0
mprotect(0x7f650c0d9000, 4096, PROT_READ) = 0
mprotect(0x7f650cdb8000, 16384, PROT_READ) = 0
mprotect(0x56202bc29000, 4096, PROT_READ) = 0
mprotect(0x7f650ce38000, 4096, PROT_READ) = 0
munmap(0x7f650cddf000, 181910)          = 0
brk(NULL)                               = 0x56202bd20000
brk(0x56202bd41000)                     = 0x56202bd41000
fstat(0, {st_mode=S_IFCHR|0620, st_rdev=makedev(0x88, 0), ...}) = 0
fstat(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(0x88, 0), ...}) = 0
fstat(2, {st_mode=S_IFCHR|0620, st_rdev=makedev(0x88, 0), ...}) = 0
rt_sigaction(SIGQUIT, {sa_handler=0x7f650c46fa60, sa_mask=[QUIT], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7f650c11a6a0}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
rt_sigaction(SIGILL, {sa_handler=0x7f650c46fa60, sa_mask=[ILL], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7f650c11a6a0}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
rt_sigaction(SIGABRT, {sa_handler=0x7f650c46fa60, sa_mask=[ABRT], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7f650c11a6a0}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
rt_sigaction(SIGFPE, {sa_handler=0x7f650c46fa60, sa_mask=[FPE], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7f650c11a6a0}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
rt_sigaction(SIGSEGV, {sa_handler=0x7f650c46fa60, sa_mask=[SEGV], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7f650c11a6a0}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
rt_sigaction(SIGBUS, {sa_handler=0x7f650c46fa60, sa_mask=[BUS], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7f650c11a6a0}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
rt_sigaction(SIGSYS, {sa_handler=0x7f650c46fa60, sa_mask=[SYS], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7f650c11a6a0}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
rt_sigaction(SIGTRAP, {sa_handler=0x7f650c46fa60, sa_mask=[TRAP], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7f650c11a6a0}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
rt_sigaction(SIGXCPU, {sa_handler=0x7f650c46fa60, sa_mask=[XCPU], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7f650c11a6a0}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
rt_sigaction(SIGXFSZ, {sa_handler=0x7f650c46fa60, sa_mask=[XFSZ], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7f650c11a6a0}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
write(1, "           0\n", 13)          = 13
write(1, " x:    3.00000000    \n", 22) = 22
write(1, " 0:            0\n", 17)      = 17
write(1, "   3.00000000    \n", 18)     = 18
exit_group(0)                           = ?
+++ exited with 0 +++
The libraries reported by ldd are NOT identical because atlas-lapack is installed on the problem machine.
e.g ls -l /usr/lib/liblapack.so.3

working computer lrwxrwxrwx 1 root root 18 May 16 2020 /usr/lib/liblapack.so.3 -> liblapack.so.3.9.0
broken computer lrwxrwxrwx 1 root root 20 Aug 1 10:58 /usr/lib/liblapack.so.3 -> libptlapack.so.3.9.0

I'm installing atlas-lapack on the working machine to see if I can reproduce the bug, at which point it's reportable to bugzilla.

[SOLVED] repeatable bug to file on bugzilla!

Last edited by mostlyharmless; 11-28-2020 at 02:58 PM.
 
Old 11-29-2020, 03:05 AM   #9
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,876

Rep: Reputation: 7315Reputation: 7315Reputation: 7315Reputation: 7315Reputation: 7315Reputation: 7315Reputation: 7315Reputation: 7315Reputation: 7315Reputation: 7315Reputation: 7315
you are right. As you can see there is no futex call in that strace log. That would be a good starting point to find that bug (not for you, just in general).
 
Old 02-21-2021, 10:17 AM   #10
mostlyharmless
Senior Member
 
Registered: Jan 2008
Distribution: Arch/Manjaro, might try Slackware again
Posts: 1,851

Original Poster
Blog Entries: 14

Rep: Reputation: 284Reputation: 284Reputation: 284
Yes, it's solved, just a few thoughts:

Ultimately the reason given for this bug was that the nested "write (*,*)" statements made by the direct function call to AC are considered "recurrent" calls to the write(*,*) function. Apparently the fortran standard does not allow recurrent calls to "I/O", so the behaviour of the program is undefined... I would make the distinction between a nested call and a recurrent call, but apparently the writers of the gfortran compiler do not interpret the fortran standard that way.

While that is a technically valid answer, it's not a particularly graceful way for the gfortran compiler to "handle" or ("not handle") the situation, particularly since it only occurs with linkage to a particular library! It just seems sloppy. This lack of grace seems to me to be a development that coincides temporally with the fork/rewrite of gfortran back in the early 2000's. I had a similar non-excuse from bugzilla for the -fbounds-check parameter to not work in some circumstances. Apparently if your code has errors (like an out of bounds error) the compiler is free to hang the process or do whatever -- even if the explicit purpose of the fbounds-check is to check for out of bounds errors in your code. In fact, one responder on bugzilla said that if given incorrect code the compiler was free to reformat your disk. Perhaps it was said somewhat in jest, but that seems to reflect the underlying attitude accurately. I can't know for sure but it seems to me that the writers of g77 would never had such a notion, or at least not proffered it as a defense.

As an aside and a bit of a rant or whine: the writers of g77 were old, like me; the discourtesy of the culture is wearing on me.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
deian yum lock [ ERR] Reading state information E: Could not get lock /var/lock/aptit jayakumar01 Linux - Server 1 12-05-2011 11:26 AM
how to use libpthread.so.0 file for my target system compiler arm-none..-gcc shakthi Linux - Software 2 06-21-2011 04:45 PM
g77 in gcc 4.1.0 not found only gfortran fortran 95 compiler! I need fortran 77. TheBrick Linux - Software 3 07-04-2007 06:39 AM
does linux fortran compiler in fedora 4 support VAX FORTRAN? terrence Programming 17 08-31-2005 08:59 AM
what's the difference between libpthread.so and libpthread.a? mmiglia Linux - Software 1 09-16-2004 07:53 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 05:07 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration