Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I am doing the porting of a new distro on my embedded platform, and I am experiencing problems while running a binary file on the new distro.
On the old one, an ngstrom with kernel 2.6.34 it was running without any problem.
On this new distro, yocto-gumstix, with kernel 3.18.18, gcc version 4.9.2, the program (compiled on the same machine) falls into Segmentation Fault upon execution..
gdb can read the source code of the file, but executing it (with the required arguments) and making a backtrace gives:
Code:
(gdb) r 1000
Starting program: /home/user/packages/tsc/tsc 1000
Cannot access memory at address 0x0
warning: Unable to find libthread_db matching inferior's thread library, thread debugging will not be available.
Program received signal SIGSEGV, Segmentation fault.
0x00000000 in ?? ()
(gdb) bt
#0 0x00000000 in ?? ()
#1 0xb68e9734 in __pthread_initialize_minimal () from /lib/libpthread.so.0
Cannot access memory at address 0x0
#2 0xb68e8d04 in ?? () from /lib/libpthread.so.0
Cannot access memory at address 0x0
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
(gdb)
So it seems /lib/libpthread.so.0 gives problems, but right now I have no idea about how to fix this issue...
Hi, the first message appears also when I am debugging a working program.
Static program also fails.. The program uses proprietary non opem source libs so I think the problem comes from there, because a simple program using pthreads, works perfectly..
The libraries are all present. From the output of ldd no one is missing..
gdeptrace-0.5.7/SCRIPTS/libdeps can trace more but requires experience
$ objdump -x -a progname
for each libname there, objdump it as well, recursively
manually insure each lib is right version: unfortunately you many not be able to. there are hacks releasing libs a small minor version apart that are incompatible with prev. version (in unix wares that are supposed to be bullet proof no less). another problem is they tend to install ontop "clobber" (by design, minor should be ok to do that: but it isn't, which is why some attack that way) which makes it very difficult for the casual developer to compile anything.
more than likely "usually" you'll find it's your own fault. maybe in /usr/include/xx you'll have libpthread.h of wrong version, or /usr/lib/libpthread.so point to wrong version of pthread
you should also know that it isn't "the linux community" doing it! it's their competitors (ex (unproven?) possibly microsoft workers in china owrking on usa grant funds - or anyone) who pose as contributors doing it.
Static program also fails.. The program uses proprietary non opem source libs so I think the problem comes from there, because a simple program using pthreads, works perfectly..
At least you know where to start looking further. Have you used the libs before in working programs that you made?
you should not use -lpthread but -pthread (without l) in general and should be used before almost any other flags (especially before your .cc files). -l<libs> should be moved at the end of the command.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.