[Gllug] How can writing a single character (successfully) to

t.clarke tim at seacon.co.uk
Mon Oct 23 21:11:04 UTC 2006


A favourite for causing segment violations is trying to write to an array
initialised by the compiler (which is placed in the text segment be default
using gcc).  The same code will work fine if compiled with some other
compilers, where the initailised array-string is plonked into bss or
whatever!    Might be interesting to compile the program with
-fwritable-strings and see whether it still does the same thing!
Course it could be something completely different,  lol !!

This particular gotcha caught me out when porting a SCO developed program
into Linux.

Tim
-------------- next part --------------
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug


More information about the GLLUG mailing list