This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Core Dump , when running ./a.out
- To: Help-gcc at gnu dot org
- Subject: Re: Core Dump , when running ./a.out
- From: aaboulhosn at entpm2 dot prod dot fedex dot com
- Date: Wed, 28 Feb 2001 07:44:14 -0600
Hello Folks
I have a problem when I ran my program it cores dump,
I will appreciate it if you give some help solving this problem.
Here is my program , bb.cc
#include <iostream.h>
main()
{
count << "this is a test\n";
}
1) I compile my program : /usr/local/bin/g++ bb.cc
2) when I run it : ./a.out
it cores dump
3) I tried to debug it :
adb ./a.out
It gave me this message:
core file = core -- program "a.out" on platform i86pc
SIGSEGV: Seqmentation Fault
------------------------------------------------------------
when, I compile my : aa.c
and run it,
it does not core dump for a C program
it cores dump only for a C++ only
Thank you
AREF Aboulhosn
---------------------- Forwarded by AREF ABOULHOSN/F47621C/VEND/FEDEX on
02/28/2001 08:35 AM ---------------------------
AREF ABOULHOSN
02/27/2001 01:24 PM
To: help-gcc@gnu.org
cc:
Subject: Re: Core Dump , when running ./a.out
Hello Folks
I tried all the procedures that is described below,
when, I use : setenv LD_LIBRARY_PATH=/usr/ucblib
I cannot use : vi anymore, because , in my PATH, (vi) is under /usr/bin.
I troed all the options.
when, I compile and run it (cores dump), and the core dumb is coming from
: #include <iostream.h>
it created a core file but, I cold not know , where is the core coming
from.
I tried to use :
gdb ./a.out (and several) gdb is not exist on my system(even not
dbx), or several others.
my program is very simple:
#include <iostream.h>
main()
{
count << "this is a test\n";
}
---------------------- Forwarded by AREF ABOULHOSN/F47621C/VEND/FEDEX on
02/27/2001 09:00 AM ---------------------------
David Berthelot <davidb@Magma-DA.COM>@Magma-DA.COM on 02/26/2001 02:08:00
PM
Sent by: davidb@Magma-DA.COM
To: aaboulhosn@entpm2.prod.fedex.com
cc:
Subject: Re: Core Dump , when running ./a.out
aaboulhosn@entpm2.prod.fedex.com wrote:
> I compiled my bb.cc program
> using /usr/local/bin/g++ bb.cc
>
> I tried to compile with : bb.cpp. bb.c, bb.cc, bb.C almost all the
> options.
It should have no influence.
> when I run my ./a.out file
> it gives me the following message:
>
> /usr/ucblib/libucb.so.1 not found
Ok so far, it is a problem of shared libraries.
> So I resolve this problem by usig : ld -R /usr/ucblib
> BUT, now, when , I run ./a.out , it complains : core dump
Ok, can you try that:
(use tcsh):
tcsh > setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/usr/ucblib
tcsh > /usr/local/bin/g++ bb.cc
tcsh > a.out
If it doesn't work, try to debug and see where it crashes:
Compiling with debug ->
tcsh > /usr/local/bin/g++ -g bb.cc
tcsh > gdb a.out
(gdb) > run
> and my program looks like this:
>
> #include <iostream.h>
>
> main()
> {
> int a;
> a = 1;
>
> cout << " I am testing " << a;
> }
>
> I tried all the option , I change the path of the iostream.h file in my
> program to:
> #include "/my/path/iostream.h" for example.
It should have no effect, the headers are recognized, it is the library
(binary machine code that is not found).
Good luck,
David