* program compiled with g++ dumps core?
@ 1998-03-30 5:00 Colin Prepscius
1998-03-30 5:00 ` Andreas Trottmann
0 siblings, 1 reply; 4+ messages in thread
From: Colin Prepscius @ 1998-03-30 5:00 UTC (permalink / raw)
Programs I compile with g++ dump core after just about any i/o:
#include <stdio.h>
int main (void) {
cout << "Hello";
return 1;
}
yields:
HelloSegmentation fault (core dumped)
But if I do no i/o (like incrementing an int or something), it doesn't
fault.
This is with RedHat linux on a 533Mhz Microway Alpha, gcc version 2.7.
Anybody have any ideas?
thanks,
-Colin Prepscius
Programmer, Neurosurgery, UVA
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: program compiled with g++ dumps core?
1998-03-30 5:00 program compiled with g++ dumps core? Colin Prepscius
@ 1998-03-30 5:00 ` Andreas Trottmann
1998-03-30 5:00 ` Colin Prepscius
1998-03-30 5:00 ` Greg Lindahl
0 siblings, 2 replies; 4+ messages in thread
From: Andreas Trottmann @ 1998-03-30 5:00 UTC (permalink / raw)
In article <6foip1$afd$1@murdoch.acc.Virginia.EDU>,
Colin Prepscius <colin@broca.med.virginia.edu> wrote:
CP> #include <stdio.h>
Shouldn't this be iostream.h?
CP> int main (void) {
CP> cout << "Hello";
CP> return 1;
CP> }
CP> yields:
CP> HelloSegmentation fault (core dumped)
It yields
clockwork:~/src $ ./a.out
Helloclockwork:~/src $
for me :)
CP> This is with RedHat linux on a 533Mhz Microway Alpha, gcc version
CP> 2.7.
Which RedHat? I'm running 4.1 (on a 433 MHz Miata), and I've heard rumors
that c++ doesn't work well on 5.0 (that's one reason why I'm still running
4.1 :) )
Have you tried to look for update rpms for the C++ system?
--
Andreas Trottmann <andreas.trottmann@werft22.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: program compiled with g++ dumps core?
1998-03-30 5:00 ` Andreas Trottmann
@ 1998-03-30 5:00 ` Colin Prepscius
1998-03-30 5:00 ` Greg Lindahl
1 sibling, 0 replies; 4+ messages in thread
From: Colin Prepscius @ 1998-03-30 5:00 UTC (permalink / raw)
> CP> #include <stdio.h>
>
> Shouldn't this be iostream.h?
You're right. It was. My fault.
> Which RedHat? I'm running 4.1 (on a 433 MHz Miata), and I've heard
rumors
> that c++ doesn't work well on 5.0 (that's one reason why I'm still
running
> 4.1 :) )
Yeah, it's RedHat 5.0. Drat about the rumors.
I narrowed it down some more:
If the line:
...
cout << "Hello";
...
is changed to:
...
cout << "Hello" << endl;
...
it doesn't give me a segmentation fault or core dump. Weird.
-Colin
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: program compiled with g++ dumps core?
1998-03-30 5:00 ` Andreas Trottmann
1998-03-30 5:00 ` Colin Prepscius
@ 1998-03-30 5:00 ` Greg Lindahl
1 sibling, 0 replies; 4+ messages in thread
From: Greg Lindahl @ 1998-03-30 5:00 UTC (permalink / raw)
Andreas Trottmann <andreas.trottmann@werft22.com> writes:
> Have you tried to look for update rpms for the C++ system?
There are no updates available. For some people, using egcs is a
workaround. For others, explicitly linking the c library does the
trick (g++ -lc). For those of us who tickle egcs bugs and have more
extensive library problems, downgrading to 4.2 does the trick.
-- g
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~1998-03-30 5:00 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1998-03-30 5:00 program compiled with g++ dumps core? Colin Prepscius
1998-03-30 5:00 ` Andreas Trottmann
1998-03-30 5:00 ` Colin Prepscius
1998-03-30 5:00 ` Greg Lindahl
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox