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.


In reply to perlembed segmentation fault by 4Xsake

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.