public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* segmentation fault
@ 2000-05-28  8:45 wert ewrtert
  2000-05-28 14:52 ` Martin v. Loewis
  0 siblings, 1 reply; 22+ messages in thread
From: wert ewrtert @ 2000-05-28  8:45 UTC (permalink / raw)
  To: gcc-help

Hi all!

i've just installed glibc-2.1.3 and gcc-2.95.2. gcc works, but compiling:
 #include <iostream.h>
  int main(){
   cout << "geht nich!" << endl;
   return 0;
}
with g++ produces seg fault when it is run.

what is wrong here? Please help 
Thanks in Advance!

-- 
Sent through GMX FreeMail - http://www.gmx.net

^ permalink raw reply	[flat|nested] 22+ messages in thread
* Segmentation fault
@ 2010-03-25 11:45 beamendsltd
  2010-03-25 13:18 ` James Tebneff
                   ` (2 more replies)
  0 siblings, 3 replies; 22+ messages in thread
From: beamendsltd @ 2010-03-25 11:45 UTC (permalink / raw)
  To: gcc-help

Hi All,
I hope this is the right place for this....

I'm having a problem with a program in C that I wrote and have been
using for some time. All of a sudden it has started crashing with a
segmentation fault which I cannot track down.  Is the a way compiling in
some sort extra run-time options that would give a better indication of
what is causing the segmentation fault?

Thanks in advance!

Cheers
Richard

-- 
I have become....... comfortably numb.

^ permalink raw reply	[flat|nested] 22+ messages in thread
* Re: segmentation fault
@ 2009-07-11  7:20 Bill McEnaney
  0 siblings, 0 replies; 22+ messages in thread
From: Bill McEnaney @ 2009-07-11  7:20 UTC (permalink / raw)
  To: anandulle, gcc-help

Hi Anandulle,

Sometimes segmentation faults happen when the computer tries to follow a
null pointer.  If you're running a C program that you've compiled with
gcc's C compiler, please show us that C program because it may help us
tell what's causing the segmentation fault.

Bill

> 
> hi,
>          I want to know why do we get segmentation faults in gcc for
just c
> compiler 
> 
> -- 
> View this message in context:
http://www.nabble.com/segmentation-fault-tp24437763p24437763.html
> Sent from the gcc - Help mailing list archive at Nabble.com.
> 
> 

________________________________________________________________
Please visit a saintly hero:
http://www.jakemoore.org

^ permalink raw reply	[flat|nested] 22+ messages in thread
* segmentation fault
@ 2009-07-11  6:55 anandulle
  0 siblings, 0 replies; 22+ messages in thread
From: anandulle @ 2009-07-11  6:55 UTC (permalink / raw)
  To: gcc-help


hi,
         I want to know why do we get segmentation faults in gcc for just c
compiler 

-- 
View this message in context: http://www.nabble.com/segmentation-fault-tp24437763p24437763.html
Sent from the gcc - Help mailing list archive at Nabble.com.

^ permalink raw reply	[flat|nested] 22+ messages in thread
[parent not found: <20070605114929.9oalrlftyfc0gwkg@webmail1.covadhosting.biz>]
[parent not found: <fc.3b9aca00bfe9273b3b9aca003b27e9bf.44e9e6d@reflex.at>]
* segmentation fault
@ 2005-05-20 23:45 Garritt Page
  0 siblings, 0 replies; 22+ messages in thread
From: Garritt Page @ 2005-05-20 23:45 UTC (permalink / raw)
  To: gcc-help

Good afternoon,
How do I remedy segmentation fault?
Thank you


		
Discover Yahoo! 
Use Yahoo! to plan a weekend, have fun online and more. Check it out! 
http://discover.yahoo.com/

^ permalink raw reply	[flat|nested] 22+ messages in thread
* Segmentation fault
@ 2002-08-16 23:39 Lim Jiunn Bin
  0 siblings, 0 replies; 22+ messages in thread
From: Lim Jiunn Bin @ 2002-08-16 23:39 UTC (permalink / raw)
  To: gcc-help

Hi all,

I had compiled a C program under Soloris using gcc. But when I add a new 
source file, test.c, i will get a segmentation fault error.

The source code can compile with gcc, "gcc -o test.o test.c" without any 
problem. But if add the test.c to my Makefile, SSRCS variable and I 
compile my program with make. I will get a segmentation fault error 
after make try to link all object files. I had tried to debug the object 
file which is generate by the make command. I cannot access to a  
function in this object file (test.o) when i type "break function_name" 
in gdb. I get a message from gdb, " Cannot access memory at 0x8".  Why 
this situation happen?

If a the my new function to a existing file, then there will have no 
problem. Could anyone help me to solve this problem?

JB

^ permalink raw reply	[flat|nested] 22+ messages in thread
* Segmentation Fault
@ 2001-09-15 12:51 Paulo J. Matos aka PDestroy
  2001-09-15 13:18 ` Paulo J. Matos aka PDestroy
  2001-09-28 16:33 ` Alexandre Oliva
  0 siblings, 2 replies; 22+ messages in thread
From: Paulo J. Matos aka PDestroy @ 2001-09-15 12:51 UTC (permalink / raw)
  To: gcc-bugs, gcc-help

Hi,
I've tried to compile GCC 3.0.1 (full distro), in an AMD K7 Athlon
700MHZ, 128MGS RAM, Linux RedHat OS!
Consider that we have gcc-3.0.1.tar.gz in ~/ (home dir)
I have currently GCC 3.0.0 installed!
I've done the following:

# tar -xvzf gcc-3.0.1.tar.gz
# mkdir gcc-objs
# cd gcc-objs
# ../gcc-3.0.1/configure
Configuring for a i686-pc-linux-gnu host.
Created "Makefile" in /home/pdestroy/gcc-objs using "mt-frag"
Configuring libiberty...
creating cache ../config.cache
checking host system type... i686-pc-linux-gnu
checking build system type... i686-pc-linux-gnu
checking for ar... ar
<rest of configure lines supressed>
# make bootstrap
<supressing uninteresting lines>
gcc -c  -DIN_GCC    -g  -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wtraditional -pedantic -Wno-long-long  -DHAVE_CONFIG_H    -I. -I. -I../../gcc-3.0.1/gcc -I../../gcc-3.0.1/gcc/. -I../../gcc-3.0.1/gcc/config -I../../gcc-3.0.1/gcc/../include ../../gcc-3.0.1/gcc/final.c -o final.o
In file included from ../../gcc-3.0.1/gcc/system.h:85,
                 from ../../gcc-3.0.1/gcc/final.c:48:
../../gcc-3.0.1/include/safe-ctype.h:1: Internal error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL: http://www.gnu.org/software/gcc/bugs.html > for instructions.
make[2]: *** [final.o] Error 1

<desperately I tried the following>
# make bootstrap-lean
<supressing uninteresting lines>
./xgcc -B./ -B/usr/local/i686-pc-linux-gnu/bin/ -isystem /usr/local/i686-pc-linux-gnu/include -O2   -DIN_GCC    -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -isystem ./include  -fPIC -g1  -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED  -I. -I. -I../../gcc-3.0.1/gcc -I../../gcc-3.0.1/gcc/. -I../../gcc-3.0.1/gcc/config -I../../gcc-3.0.1/gcc/../include  -DL_ashrdi3 -c ../../gcc-3.0.1/gcc/libgcc2.c -o libgcc/./_ashrdi3.o
In file included from /usr/include/_G_config.h:14,
                 from /usr/include/libio.h:30,
                 from include/stdio.h:73,
                 from ../../gcc-3.0.1/gcc/tsystem.h:63,
                 from ../../gcc-3.0.1/gcc/libgcc2.c:37:
include/stddef.h:1: Internal error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL: http://www.gnu.org/software/gcc/bugs.html > for instructions.
make[3]: *** [libgcc/./_ashrdi3.o] Error 1


Another segmentation fault... :(

Any ideas on this or this is really a bug?

Best regards,
-- 
Paulo J. Matos aka PDestroy : pocm@rnl.ist.utl.pt
Instituto Superior Tecnico - Lisbon
Computer Science and Software Eng. - AI
 - > http://www.rnl.ist.utl.pt/~pocm

^ permalink raw reply	[flat|nested] 22+ messages in thread
* Segmentation fault
@ 1999-11-17  8:30 Sarose
  1999-11-17 16:12 ` hwidjaja
  1999-11-30 23:28 ` Sarose
  0 siblings, 2 replies; 22+ messages in thread
From: Sarose @ 1999-11-17  8:30 UTC (permalink / raw)
  To: help-gcc

OS: Redhat Linux 5.2
GCC: gcc-2.7.2.3-14

Problem:

This is my program using insertstring function

I get Segmentation fault

#include <stdio.h>
#include <string.h>

char *insertstring (char *strbuf,char *chrstoins,int pos)
{
memmove ((strbuf + pos)+ strlen (chrstoins),(strbuf + pos), strlen
((strbuf + pos))+1);
memcpy ((strbuf + pos), chrstoins, strlen (chrstoins));
return strbuf;
}
int main()
{
char *buffer;
char *test="<a href='index.html'>About Enet </a>";
char *test1="asdflaksdf";
buffer = insertstring(test,test1,1);
printf("%s",buffer);
return 0;
}

Compiling, Linking & OUTPUT
# gcc test1.c -o test
# ./test
Segmentation fault

I do suspect 'memmove' line of insertstring functions. But HOWTO fix it
still getting puzzle??

Hope I will get some help for your side.

--
Regards,
npguy



Sent via Deja.com http://www.deja.com/
Before you buy.

^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2010-03-25 11:45 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-05-28  8:45 segmentation fault wert ewrtert
2000-05-28 14:52 ` Martin v. Loewis
  -- strict thread matches above, loose matches on Subject: below --
2010-03-25 11:45 Segmentation fault beamendsltd
2010-03-25 13:18 ` James Tebneff
2010-03-25 13:58 ` Andrew Haley
2010-03-25 14:33 ` John (Eljay) Love-Jensen
2009-07-11  7:20 segmentation fault Bill McEnaney
2009-07-11  6:55 anandulle
     [not found] <20070605114929.9oalrlftyfc0gwkg@webmail1.covadhosting.biz>
2007-06-05 15:53 ` Andrew Haley
2007-06-05 15:56   ` Andrew Haley
     [not found] <fc.3b9aca00bfe9273b3b9aca003b27e9bf.44e9e6d@reflex.at>
2005-05-21  3:16 ` Antonio Coralles
2005-05-20 23:45 Garritt Page
2002-08-16 23:39 Segmentation fault Lim Jiunn Bin
2001-09-15 12:51 Segmentation Fault Paulo J. Matos aka PDestroy
2001-09-15 13:18 ` Paulo J. Matos aka PDestroy
2001-09-28 16:33 ` Alexandre Oliva
1999-11-17  8:30 Segmentation fault Sarose
1999-11-17 16:12 ` hwidjaja
1999-11-18  1:21   ` Sarose
1999-11-30 23:28     ` Sarose
1999-11-30 23:28   ` hwidjaja
1999-11-30 23:28 ` Sarose

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).