Re: XForms: seg fault

vsexton (
Mon, 22 Jun 1998 18:26:33 -0500

# To subscribers of the xforms list from vsexton <> :

> >
> > > >> I have no idea why this line is giving me a seg fault
> > > >> fl_set_input (fdui_output->output_field,"");
> I forgot to show you guys this important code block;
> fdui->output_field = obj = fl_add_input(FL_NORMAL_INPUT,10,10,530,250,"");
> fl_set_object_boxtype(obj,FL_SHADOW_BOX);
> fl_set_object_color(obj,FL_TOP_BCOL,FL_LEFT_BCOL);
> fl_set_object_lsize(obj,FL_MEDIUM_SIZE);
> and I have tried this with normal input and multiline input fields..

The definitions you show seem ok. I suspect that the cause may actually be occuring
before the point you get the seg fault. Check to be sure that all of your pointers
are declared properly and assigned a valid value before they are referenced. Try
starting at the line you get the seg fault at, and go backwards through your program,
checking all pointers to be sure that they are declared properly, initialized (or
assigned a value before you reference their value), that they are malloc'd if needed,
and that they are in scope. The scope is usually caught by the compiler, but check
just in case. Be especially careful to check any global pointers. I have a hunch
you are referencing a declared pointer before it is initialized or malloc'd, and are
therefore overwriting memory.

Hope it helps, lost pointers can be the hardest to trace.


To unsubscribe, send the message "unsubscribe" to or see
XForms Home Page:
List Archive: