Re: XForms: segmentation fault

Ian Leonard (ian@eonsw.demon.co.uk)
Thu, 26 Mar 1998 20:13:41 +0000 (GMT)

# To subscribers of the xforms list from Ian Leonard <ian@eonsw.demon.co.uk> :

>From the keyboard of Dick Middleton comes:-
>
># To subscribers of the xforms list from Dick Middleton <dick@sqf.hp.com> :
>
>> # To subscribers of the xforms list from Chris <cgagne@videon.wave.ca> :
>
>> I keep getting a segmentation fault in one point of a program I'm writing
>> using xforms v0.88 in Linux. The segmentation fault occurs when I call
>> any fl function that opens up a new window. Ex. I have a
>> fl_show_question("Are you sure you want to quit?",1); When the program
>> calls this function my program seg faults (sometimes) -- I can cause a
>> segmentation fault pretty much when I want.
>
>When I get problems like this that look convincingly like problems with
>certain xforms objects or calls I go looking for memory access mistakes in my
>program. Invariably I find I'm using a buffer too small or a freed pointer
>or some stupid thing; not necessarily anything to do with the code that is
>actually failing. They can be very hard to find.
>

Indeed. Calls to malloc () are a similar source of trouble. If malloc() is
being used, a malloc debugger can be of great help. There are a few around.
I think there's a Gnu one and one called ElectricFence (I think). I use
one I have had for years called dbmalloc.

-- 
Ian

Ian Leonard eMail: ian@eonsw.demon.co.uk Phone Fax: +44 (0)1865 434757 Fax: +44 (0)1865 434758 19 Stapleton Road Headington, Oxford, OX3 7LX, UK

Please ignore spelling and punctuation - I did.

_________________________________________________ To unsubscribe, send the message "unsubscribe" to xforms-request@bob.usuf2.usuhs.mil or see http://bob.usuf2.usuhs.mil/mailserv/xforms.html XForms Home Page: http://bragg.phys.uwm.edu/xforms List Archive: http://bob.usuf2.usuhs.mil/mailserv/list-archives/