Bug 78087 - Execution of compiled pkg-config-0.28 on Synology DS712+ results in a Segmentation fault (core dump)
Summary: Execution of compiled pkg-config-0.28 on Synology DS712+ results in a Segment...
Status: RESOLVED MOVED
Alias: None
Product: pkg-config
Classification: Unclassified
Component: src (show other bugs)
Version: unspecified
Hardware: x86-64 (AMD64) Linux (All)
: high blocker
Assignee: pkg-config
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-29 16:46 UTC by hdisseldorp
Modified: 2018-08-25 12:55 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

Description hdisseldorp 2014-04-29 16:46:48 UTC
After a successful creation of pkg-config-0.28. I get a segmentation fault when I try to execute the compiled program. Here are the steps I took to compile the program.

I have downloaded pkg-config-0.28.tar.gz into a local tmp directory.
I executed the following commands:
    1) tar xvzf pkg-config-0.28.tar.gz
    2) cd pkg-config-0.28
    3) env LDFLAGS="-L/opt/lib" ./configure --prefix=/usr/local
    4) make install
    5) /usr/local/pkg-config --version
    6) Segmentation fault (core dumped)

Al this is run on a Synology DS712+ NAS server on which I installed ipkg, to be able to install additional (development) packages. I guess that the segmentation fault is caused by linking with the wrong library (versions).

The reason I need an updated version of pkg-config is to be able to compile the latest ruby version. The current pkg-config version (0.15) don't recognize the "URL' tag.

Can somebody help me out with this problem?

Kind regards,
Harry
Comment 1 Jeff Crouse 2014-05-12 22:47:06 UTC
I am also having this problem. Have you found a solution?
Comment 2 Dan Nicholson 2014-09-27 23:30:05 UTC
Sorry for the slow reply. Any chance you can run this through gdb? You should be able to do this all from the tarball directory. Something like this:

tar -xf pkg-config-0.28.tar.gz
cd pkg-config-0.28
env LDFLAGS="-L/opt/lib" ./configure --prefix=/usr/local
make
gdb --args ./pkg-config --version

Then within gdb once it crashes, run "bt" to get a backtrace. Thanks. Without a backtrace, it's hard to figure out why it would crash so easily.
Comment 3 Peter 2014-10-27 10:00:53 UTC
The problem still occurs. I have a DiskStation D1812+. Please check the build output. Gdb is not helpful, it says: No stack. Please advise...

Kind regards,
Peter


DiskStation> cd pkg-config-0.28/
DiskStation> make clean
Making clean in .
make[1]: Entering directory `/volume1/rubyapps/install/pkg-config-0.28'
 rm -f pkg-config
test -z "*.gcda *.gcno *.gcov" || rm -f *.gcda *.gcno *.gcov
rm -rf .libs _libs
rm -f *.o
rm -f *.lo
make[1]: Leaving directory `/volume1/rubyapps/install/pkg-config-0.28'
Making clean in check
make[1]: Entering directory `/volume1/rubyapps/install/pkg-config-0.28/check'
rm -rf .libs _libs
rm -f *.lo
make[1]: Leaving directory `/volume1/rubyapps/install/pkg-config-0.28/check'
DiskStation> env LDFLAGS="-L/opt/lib" ./configure --prefix=/usr/local
checking for a BSD-compatible install... /opt/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /opt/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking how to print strings... printf
checking for style of include used by make... GNU
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking dependency style of gcc... gcc3
checking for a sed that does not truncate output... /opt/bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /opt/i686-linux-gnu/bin/ld
checking if the linker (/opt/i686-linux-gnu/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /opt/bin/nm -B
checking the name lister (/opt/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 32768
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking how to convert x86_64-unknown-linux-gnu file names to x86_64-unknown-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-unknown-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /opt/i686-linux-gnu/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /opt/bin/nm -B output from gcc object... ok
checking for sysroot... no
./configure: line 6188: /usr/bin/file: No such file or directory
checking for mt... no
checking if : is a manifest tool... no
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... no
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/opt/i686-linux-gnu/bin/ld) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking whether make supports nested variables... yes
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking dependency style of gcc... (cached) gcc3
checking for ln... ln
checking dirent.h usability... yes
checking dirent.h presence... yes
checking for dirent.h... yes
checking for unistd.h... (cached) yes
checking sys/wait.h usability... yes
checking sys/wait.h presence... yes
checking for sys/wait.h... yes
checking malloc.h usability... yes
checking malloc.h presence... yes
checking for malloc.h... yes
checking for bash... /opt/bin/bash
checking for default search path for .pc files... ${libdir}/pkgconfig:${datadir}/pkgconfig
checking for system include path to avoid -I flags... /usr/include
checking for system library path to avoid -L flags... /usr/lib:/lib
configure: creating ./config.lt
config.lt: creating libtool
checking whether to list both direct and indirect dependencies... no
checking for Win32... no
checking if internal glib should be used... no
checking for pkg-config... /opt/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for GLIB... yes
checking if host- prefixed tool should be installed... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating check/Makefile
config.status: creating check/config.sh
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing depfiles commands
config.status: executing libtool commands
DiskStation> make
make  all-recursive
make[1]: Entering directory `/volume1/rubyapps/install/pkg-config-0.28'
Making all in .
make[2]: Entering directory `/volume1/rubyapps/install/pkg-config-0.28'
  CC       pkg.o
  CC       parse.o
  CC       main.o
  CCLD     pkg-config
make[2]: Leaving directory `/volume1/rubyapps/install/pkg-config-0.28'
Making all in check
make[2]: Entering directory `/volume1/rubyapps/install/pkg-config-0.28/check'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/volume1/rubyapps/install/pkg-config-0.28/check'
make[1]: Leaving directory `/volume1/rubyapps/install/pkg-config-0.28'
DiskStation> gdb --args ./pkg-config --version


dlopen failed on 'libthread_db.so.1' - libthread_db.so.1: cannot open shared object file: No such file or directory
GDB will not be able to debug pthreads.

GNU gdb 6.8
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-linux-gnu"...
(gdb) bt
No stack.
(gdb)
Comment 4 Peter 2014-10-27 10:59:10 UTC
One more remark: I tried building older versions and the latest version that would still run is 0.25. All newer version cause a segmentation fault.

Regards,
Peter
Comment 5 Dan Nicholson 2014-11-11 19:31:47 UTC
(In reply to Peter from comment #3)
> DiskStation> gdb --args ./pkg-config --version
> 
> 
> dlopen failed on 'libthread_db.so.1' - libthread_db.so.1: cannot open shared
> object file: No such file or directory
> GDB will not be able to debug pthreads.
> 
> GNU gdb 6.8
> Copyright (C) 2008 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
> and "show warranty" for details.
> This GDB was configured as "i686-linux-gnu"...
> (gdb) bt
> No stack.
> (gdb)

That's unfortunate about the failure with pthreads. I believe you'd have to install the dev package for libc (likely glibc).

Still, there's probably enough here to work with. You just have to run the program. When you get the (gdb) prompt, type "run". It will run until the segfault. Then type "bt".

Thanks.
Comment 6 Alain Fawaz 2016-01-22 16:33:06 UTC
this is with 0.29, but I think it is similar 
any idea ? 

SNas:/c/downloads/ruby/pkg-config-0.29> gdb --args ./pkg-config --version

dlopen failed on 'libthread_db.so.1' - libthread_db.so.1: cannot open shared object file: No such file or directory
GDB will not be able to debug pthreads.

GNU gdb 6.8
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-linux-gnu"...
(gdb) run
Starting program: /volume1/c/downloads/ruby/pkg-config-0.29/pkg-config --version

Program received signal SIGSEGV, Segmentation fault.
0x080518b0 in strncmp@@GLIBC_2.0 ()
(gdb) bt
#0  0x080518b0 in strncmp@@GLIBC_2.0 ()
#1  0xf774d63c in ?? () from /lib/ld-linux.so.2
#2  0xf773f5f0 in ?? ()
#3  0xf773fa78 in ?? ()
#4  0x00000000 in ?? ()
Comment 7 Dan Nicholson 2016-01-23 02:00:46 UTC
That's very helpful, but it appears that pkg-config has been stripped and the backtrace doesn't show where this is being triggered from. Could you try to rebuild pkg-config with CFLAGS="-g -O0" passed on the configure command line? That will leave the debugging symbols in the binary.
Comment 8 GitLab Migration User 2018-08-25 12:55:17 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/pkg-config/pkg-config/issues/31.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.