Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

segmentation fault

Posted on 2002-05-09
9
982 Views
Last Modified: 2012-05-04
Maybe someone can help
I have an application.  all object files are compiled into object files, there are about 17 static libraries. the problem is at final link, the loader i guess, produces a segmentation fault.  The exact error is

collect2:ld terminated with signal 11 [segmentation fault]
*** Error code 1

There is core dump, but I don't know what to do with it.
0
Comment
Question by:ragaMuffin
9 Comments
 
LVL 51

Expert Comment

by:ahoffmann
ID: 6999490
could you pleas post the tail of the coredump, use something like:
   tail -50 core
or
   strings cor|tail -50

if the result is just your environment (that which you get with the printenv command), please use 100 instead of 50, and remove the environment from the output
0
 

Author Comment

by:ragaMuffin
ID: 7006122
okay I looked at the core using your strings core |tail -50, but I don't see anything in it.  it simply has COMPILER_PATH which is correct
LIBRARY_PATH which is correct
COLLECT_GCC_OPTIONS which are correct
and then the last line simply says
/usr/bin/ld
i am using version 2.96 and ld is 2.10

PS.  Sorry I can not post file because it contain information about my apps, hosts, configurations, etc etc etc.  what i can tell you is I have many libraries, all build on redhat, but most of them reside on other unix/linux platforms, Sun, hp, sgi, true64, alpha, all configured using clearcase tools.  I do have a cross compiler in some and others do an rsh to linux and build there.
this target is i686

0
 
LVL 5

Accepted Solution

by:
garboua earned 300 total points
ID: 7006631
there is no known bugs in binutil, version that you specified, nor it is a gcc problem, since you say the collect gcc option are correct.  I am assuming you understood the core dump.
two options:
1. check your objects "build on other system?"
it could be one of the cross compiler, don't trust them.  try to test the objects from other platfroms or just  do a file on them and see what you get. something like sparc mips etc etc etc is NOT GOOD.  what you are looking for is "intel" since your target is i386.
2. this is what I would do FIRST, download binutils-2.12 and installed, this is your gas ld etc etc.  easy download, run ./configure and make install.   makesure you uninstall your old version first.  THIS Might fix you problem, if not back to #1

Gooood luck
0
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
LVL 51

Expert Comment

by:ahoffmann
ID: 7006935
I also assume that there is a lib in wrong format, probably from other platform.
Pass the -v and -WL,v options to gcc, then check the output, it should show you all the libraries to be linked with full path. For each lib use the file command to get the information of the lib
0
 
LVL 5

Expert Comment

by:bryanh
ID: 7008723
It wouldn't hurt to narrow the scope of the problem too.  You say there are 17 static libraries, plus multiple regular object files?  What if you cut some of them out?  Does Ld still segfault?  If not, and you instead fail due to unresolved references, you might try substituting a file with dummy definitions and see if the link completes.

It would help if you would post the link commands (assuming you're linking with gcc, that would be the result of the options ahoffman suggests).

I didn't understand about library residing on other platforms.  Don't they all have to reside, in one way or another, on the system on which you do the link?
0
 

Author Comment

by:ragaMuffin
ID: 7009889
bryanh,
this is a very large application and it actaully uses most of the library function.  an attempt to isolate libraries generated PAGES and PAGES of unresolved depend, :-) I'm a step a head of you :-).  Seriously, it is not productive at all to dummy out hundreds of functions, and they are literally hundreds function in each lib.

garboua, ahoffmann
you guys kinda saying the same thing, so I will try to check each library format.
I downloaded the latest binutils and gcc and will be installed tonight.  if that does not fix the problem --> to checking each library I go.
will keep U guys posted.
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 7010347
a simple
  file libwhatever.so
command should be sufficient, usually ;-)

addiditional comment to bryanh's suggestion:
  to omit some libs at the linking stage may give a hint if the problem is one of the libs, or the linker itself

ragaMuffin, are you using a lot of global variables in you libs?
0
 

Author Comment

by:ragaMuffin
ID: 7010716
only the globals produced by the gui builder, less that 20. No globals used by application manager AND
the new combination of binutils-2.12 and gcc-3.0.4 did the trick.  
thank you all.
0
 

Author Comment

by:ragaMuffin
ID: 7010718
only the globals produced by the gui builder, less that 20. No globals used by application manager AND
the new combination of binutils-2.12 and gcc-3.0.4 did the trick.  
thank you all.
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question