Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 543782 - sci-mathematics/octave-3.8.2 segfaults: not linked pthread
Summary: sci-mathematics/octave-3.8.2 segfaults: not linked pthread
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Gentoo Science Mathematics related packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-03-19 12:17 UTC by Markus
Modified: 2016-01-16 19:14 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Markus 2015-03-19 12:17:02 UTC
sci-mathematics/octave-3.8.2 USE="X curl glpk imagemagick java opengl qhull qrupdate readline sparse zlib -doc -fftw -gnuplot -gui -hdf5 -jit -postscript -static-libs"

"octave" just segfaults. ldd does not show libpthread.

Editing the ebuild to do "filter-flags -Wl,--as-needed" fixes the issue.


I first reduced the problem to the vanilla octave-3.8.2.tar.bz2, just export LDFLAGS="-Wl,--as-needed" and "./configure --disable-gui --without-magick && make"

This can probably be fixed in the octave build system.

Reproducible: Always
Comment 1 Andrew Savchenko gentoo-dev 2015-03-25 22:39:24 UTC
Please provide a full backtrace as described below:
https://wiki.gentoo.org/wiki/Bugzilla_HOWTO#Debugging_using_GDB
Comment 2 Markus 2015-03-26 09:39:27 UTC
octave => "Segmentation fault"
LD_PRELOAD="/lib64/libpthread.so.0" octave => works

Backtrace with gdb ("thread apply all bt full"):

Thread 1 (process 7420):
#0  0x0000000000000000 in ?? ()
No symbol table info available.
#1  0x00007ffff7d37361 in std::locale::_S_initialize() () from /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.2/libstdc++.so.6
No symbol table info available.
#2  0x00007ffff7d373a3 in std::locale::locale() () from /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.2/libstdc++.so.6
No symbol table info available.
#3  0x00007ffff7d341a4 in std::ios_base::Init::Init() () from /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.2/libstdc++.so.6
No symbol table info available.
#4  0x000000000040198e in __static_initialization_and_destruction_0 (__initialize_p=1, __priority=65535) at /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.2/include/g++-v4/iostream:74
No locals.
#5  _GLOBAL__sub_I__Z17display_availableRSs () at main.cc:655
No locals.
#6  0x0000000000402015 in __libc_csu_init (argc=argc@entry=1, argv=argv@entry=0x7fffffffdae8, envp=0x7fffffffdaf8) at elf-init.c:88
        i = 1
#7  0x00007ffff7944f1f in __libc_start_main (main=0x400fa0 <main(int, char**)>, argc=1, argv=0x7fffffffdae8, init=0x401fd0 <__libc_csu_init>, fini=<optimized out>, rtld_fini=<optimized out>, 
    stack_end=0x7fffffffdad8) at libc-start.c:245
        result = <optimized out>
        unwind_buf = {cancel_jmp_buf = {{jmp_buf = {4200870, 140737351973808, 140737351513312, 140737347170105, 140737351760912, 1, 1, 140737351950442}, mask_was_saved = -1}}, priv = {pad = {0x1, 0x1c, 
              0x401fd0 <__libc_csu_init>, 0x7fffffffdae8}, data = {prev = 0x1, cleanup = 0x1c, canceltype = 4202448}}}
        not_first_call = <optimized out>
#8  0x00000000004019cf in _start ()
No symbol table info available.
Comment 3 Markus 2015-03-26 10:05:31 UTC
LD_DEBUG=all octave
...
     24930:     initialize program: octave
     24930:
     24930:     symbol=_ZNSt8ios_base4InitC1Ev;  lookup in file=octave [0]
     24930:     symbol=_ZNSt8ios_base4InitC1Ev;  lookup in file=/usr/lib64/libX11.so.6 [0]
     24930:     symbol=_ZNSt8ios_base4InitC1Ev;  lookup in file=/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.2/libstdc++.so.6 [0]
     24930:     binding file octave [0] to /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.2/libstdc++.so.6 [0]: normal symbol `_ZNSt8ios_base4InitC1Ev' [GLIBCXX_3.4]
     24930:     symbol=_ZNSt6localeC1Ev;  lookup in file=octave [0]
     24930:     symbol=_ZNSt6localeC1Ev;  lookup in file=/usr/lib64/libX11.so.6 [0]
     24930:     symbol=_ZNSt6localeC1Ev;  lookup in file=/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.2/libstdc++.so.6 [0]
     24930:     binding file /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.2/libstdc++.so.6 [0] to /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.2/libstdc++.so.6 [0]: normal symbol `_ZNSt6localeC1Ev' [GLIBCXX_3.4]
     24930:     symbol=pthread_once;  lookup in file=octave [0]
     24930:     symbol=pthread_once;  lookup in file=/usr/lib64/libX11.so.6 [0]
     24930:     symbol=pthread_once;  lookup in file=/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.2/libstdc++.so.6 [0]
     24930:     symbol=pthread_once;  lookup in file=/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.2/libgcc_s.so.1 [0]
     24930:     symbol=pthread_once;  lookup in file=/lib64/libc.so.6 [0]
     24930:     symbol=pthread_once;  lookup in file=/usr/lib64/libxcb.so.1 [0]
     24930:     symbol=pthread_once;  lookup in file=/lib64/libdl.so.2 [0]
     24930:     symbol=pthread_once;  lookup in file=/lib64/libm.so.6 [0]
     24930:     symbol=pthread_once;  lookup in file=/lib64/ld-linux-x86-64.so.2 [0]
     24930:     symbol=pthread_once;  lookup in file=/usr/lib64/libXau.so.6 [0]
     24930:     symbol=pthread_once;  lookup in file=/usr/lib64/libXdmcp.so.6 [0]
Segmentation fault


Notice "pthread_once" is not bound.
Comment 4 David Seifert gentoo-dev 2016-01-15 20:41:16 UTC
Markus, could you please retry emerging sci-mathematics/octave-3.8.2, this time with LDFLAGS set to

LDFLAGS="-Wl,--as-needed -Wl,-O1 -Wl,--hash-style=gnu -Wl,--sort-common -Wl,--no-undefined"

and see if fails in the linking steps? A missing pthread link would cause the compile phase to fail with -Wl,--no-undefined in shared object files.
Comment 5 Markus 2016-01-16 19:14:18 UTC
Just tried the vanilla ebuild from portage. But after like ten month I dont get that error anymore. The system evolved, so I have no clue what could have caused that.