From: Andrew J. Cosgriff ! (andrewc@aurora.cc.monash.edu.au)
Date: 01/07/93


From: andrewc@aurora.cc.monash.edu.au (Andrew J. Cosgriff !)
Subject: Re: Segmentation fault??? Just what is it?
Date: Thu, 7 Jan 1993 08:49:50 GMT

KK4D%MARIST.bitnet@YaleVM.YCC.Yale.Edu (me) writes:

>I compiled mpeg_play and it worked fine, at about 300+K, so I recompiled
>and relinked it with the shared libraries, 160ishK, but when I try to
>run it I get a segmentation fault. I've seen this before. Pardon my
>ignorance, but what is it and why? I have been able to compile and
>run other progs. with the shared libraries.

Be easy on me, guys, I'm no guru (yeah, I know it'll be answered by someone
more knowledgeable, but I thought I may as well anyway, just in case...)

A Seg Fault occurs when you try to access somewhere outside the memory bounds
of your process (usually a case of pointers being used incorrectly...:( )

In recent versions of Linux, the kernel checks against programs that try to
write to their code area, which is where string constants are held - some
programs will write to string constants, and can usually get away with it
(but not since 0.98p4 in Linux)

If this is the case, add -fwritable-strings to the gcc call and it'll be ok

But this sounds kinda weird if it only works statically....
I can't help you with that bit..

Happy learning !

Cos !

-- 
===============================================================================
 * Andrew J. Cosgriff ! *                   #include <std_witty_quote.h>
#define HERE cc.monash.edu.au               #include <std_disclaimer.h>
Hassle me at :      andrewc@aurora.HERE ; andrewc@lindblat.HERE ; cos@yoyo.HERE