4Xsake has asked for the wisdom of the Perl Monks concerning the following question:
This is a strange one... I embedded perl into a c program and all was working well. I used the example from O'Reilly's Programming Perl which seems to be the same as other examples I've seen on the web...
int main( int argc, char** argv, char** env ) { PERL_SYS_INIT3( &argc, &argv, &env ); my_perl = perl_alloc(); perl_construct( my_perl ); PL_exit_flags |= PERL_EXIT_DESTRUCT_END; perl_parse( my_perl, NULL, argc, argv, ( char** )NULL ); perl_run( my_perl ); perl_destruct( my_perl ); perl_free( my_perl ); PERL_SYS_TERM(); }
This WAS working!
I then installed other bits and bobs onto my Angstrom Linux Dist (Gumstix) such as Apache, PHP, FileZilla, Proftpd and all their endless dependencies and almost filled my 2GB micro SD bootable disk (about 90% full).
I then tried to run the embedded perl app (which was working) and I got a Segmentation Fault immediately and now get it every time I try to run the app.
I've 'make clean'd perl and re-installed from source but still the same. The strange thing is, perl seems to works fine, I can run %perl myPerlScript.pl no problems at all but when I run my embedded perl app I get Segmentation Fault. What could have changed???
I've not included too much detail here since to be honest I'm not sure what information will be of any use (remember, this WAS working).
I'm a perl and linux newbie.
Thanks for any help.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: perlembed segmentation fault
by aitap (Curate) on Jul 25, 2012 at 09:23 UTC | |
by 4Xsake (Initiate) on Jul 26, 2012 at 08:23 UTC | |
by prashantktyagi (Scribe) on Jul 25, 2012 at 09:57 UTC | |
by 4Xsake (Initiate) on Jul 25, 2012 at 11:03 UTC | |
by 4Xsake (Initiate) on Jul 25, 2012 at 10:44 UTC | |
by aitap (Curate) on Jul 25, 2012 at 12:29 UTC |