# To subscribers of the xforms list from Steve Lamont <spl@ncmir.ucsd.edu> :
> I have a possibly trivial question. I am using fl_exe_command to run a
> program from within my xforms application. Occasionally it happens that
> this external program crashes with a seg fault and this causes also a
> crash of my xforms application program. I was wondering if there is a
> simple way to avoid it ( meaning the crash of xforms).
Hm. Another one I can't duplicate.
Here's my XForms code:
- - -
#include <stdio.h>
#include <forms.h>
int main( int argc, char **argv )
{
char *file;
fl_initialize(&argc, argv, "Try", 0, 0);
fl_show_command_log( FL_FULLBORDER );
fl_exe_command( "core_dumper", 1 );
while ( fl_do_forms() )
;
exit( 0 );
}
- - -
and here's the program that dumps core
#include <stdio.h>
int main( int argc, char **argv )
{
int *ptr = NULL;
fprintf( stderr, "Let's try to dereference this pointer!\n" );
*ptr = 1;
fprintf( stderr, "I'll bet we never got here!\n" );
}
- - -
I get the first message and then the expected
Segmentation fault - core dumped
in the command window but the caller just happily chugs along.
spl
_________________________________________________
To unsubscribe, send the message "unsubscribe" to
xforms-request@bob.usuhs.mil or see
http://bob.usuhs.mil/mailserv/xforms.html
XForms Home Page: http://world.std.com/~xforms
List Archive: http://bob.usuhs.mil/mailserv/list-archives/
This archive was generated by hypermail 2b29 : Fri Oct 13 2000 - 10:10:21 EDT