[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: C program segfaults when run, not under GDB
- To: <milesteg(at-nospam)surfree.net.il>
- Subject: Re: C program segfaults when run, not under GDB
- From: Max Kovgan <smcmaugh(at-nospam)techst02.technion.ac.il>
- Date: Sun, 25 Nov 2001 12:16:21 +0200 (IST)
- Cc: <linux-il(at-nospam)linux.org.il>
- Delivered-To: linux.org.il-linux-il@linux.org.il
- In-Reply-To: <3C00BBB9.4060905@bezeqint.net>
- Sender: linux-il-bounce(at-nospam)cs.huji.ac.il
this line:
if (factor!=0) s1[c1]=s1[c1+factor];
tries to see behind the s1's end after the index (length_of_s1 - factor)
is reached.
this causes SIGSEG
it's not nice to ask people to debug your own homework :))))))
bye
-=O0~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~O0=-
"Beware the Jabberwock, my son!
The jaws that bite, the claws that catch!
Beware the Jubjub bird, and shun
The frumious Bandersnatch!"
[L.Carrol "Jabberwacky"]
On Sun, 25 Nov 2001, Eugene Romm wrote:
> Hello.
>
> I've written a procedure that's supposed to remove all occurances of
> string2 from string1 (parameters).
> For reasons I do not understand, the program compiles but segfaults when
> run from the command prompt, but silently executes without a warning
> when run under GDB. Attached is the program. Segfault occurs on line 29,
> as far as I can tell.
>
=================================================================
To unsubscribe, send mail to linux-il-request@linux.org.il with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail linux-il-request@linux.org.il