home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / os / linux / 23031 < prev    next >
Encoding:
Text File  |  1993-01-07  |  1.9 KB  |  46 lines

  1. Newsgroups: comp.os.linux
  2. Path: sparky!uunet!munnari.oz.au!bruce.cs.monash.edu.au!monu6!aurora.cc.monash.edu.au!andrewc
  3. From: andrewc@aurora.cc.monash.edu.au (Andrew J. Cosgriff !)
  4. Subject: Re: Segmentation fault??? Just what is it?
  5. Message-ID: <andrewc.726396590@aurora.cc.monash.edu.au>
  6. Sender: news@monu6.cc.monash.edu.au (Usenet system)
  7. Organization: Monash University, Melb., Australia.
  8. References: <9301070204.AA00285@deepthought.cs.utexas.edu>
  9. Date: Thu, 7 Jan 1993 08:49:50 GMT
  10. Lines: 34
  11.  
  12. KK4D%MARIST.bitnet@YaleVM.YCC.Yale.Edu (me) writes:
  13.  
  14. >I compiled mpeg_play and it worked fine, at about 300+K, so I recompiled
  15. >and relinked it with the shared libraries, 160ishK, but when I try to
  16. >run it I get a segmentation fault. I've seen this before.  Pardon my
  17. >ignorance, but what is it and why?  I have been able to compile and
  18. >run other progs. with the shared libraries.
  19.  
  20. Be easy on me, guys, I'm no guru (yeah, I know it'll be answered by someone
  21. more knowledgeable, but I thought I may as well anyway, just in case...)
  22.  
  23. A Seg Fault occurs when you try to access somewhere outside the memory bounds
  24. of your process (usually a case of pointers being used incorrectly...:( )
  25.  
  26. In recent versions of Linux, the kernel checks against programs that try to
  27. write to their code area, which is where string constants are held - some
  28. programs will write to string constants, and can usually get away with it
  29. (but not since 0.98p4 in Linux)
  30.  
  31. If this is the case, add -fwritable-strings to the gcc call and it'll be ok
  32.  
  33.  
  34. But this sounds kinda weird if it only works statically....
  35. I can't help you with that bit..
  36.  
  37. Happy learning !
  38.  
  39. Cos !
  40.  
  41. -- 
  42. -------------------------------------------------------------------------------
  43.  * Andrew J. Cosgriff ! *                   #include <std_witty_quote.h>
  44. #define HERE cc.monash.edu.au               #include <std_disclaimer.h>
  45. Hassle me at :      andrewc@aurora.HERE ; andrewc@lindblat.HERE ; cos@yoyo.HERE
  46.