I'm not surprised that Params::Classify fails when used more than once in the same process.

Here it declares a single data structure per process:

static struct rtype_metadata { char const *desc_noun, *keyword_pv; SV *keyword_sv; } rtype_metadata[RTYPE_COUNT] = { { "scalar", "SCALAR", NULL }, { "array", "ARRAY", NULL }, { "hash", "HASH", NULL }, { "code", "CODE", NULL }, { "format", "FORMAT", NULL }, { "io", "IO", NULL }, };

That data structure will eventually contain pointers to Perl variables, as set here:

rtypemeta->keyword_sv = newSVpvn_share(rtypemeta->keyword_pv, strlen(rtypemeta->keyword_pv), 0);

I don't believe that you can safely use Perl variables from one interpreter instance in a different instance of the interpreter.

You could try loading Params::Classify in multiple Perl "threads" (using threads.pm) and see if that also dies and file a bug against the module.

Or you could just get similar functionality in a way that doesn't require such a large chunk of XS code (since XS code is, by far, the single biggest source of core dumps in Perl -- because it is extremely hard to write robust XS code), especially XS code that entwines itself into everything by hooking 'entersub' and doing manipulations of the Perl opcodes.

When searching the module documentation for some hint of why it hooked 'entersub' and manipulated opcodes, I found none, but I did find:

This module is implemented in XS, with a pure Perl backup version for systems that can't handle XS.

So, if you really want Params::Classify features, you could use the non-XS implementation (you'll have to figure out how that is done).

Btw. have you tried that program?

No. I have no intention of even downloading Param::Classify, much less trying to reproduce your problem locally.

- tye        


In reply to Re^5: Multiple perl interpreters and Module::Runtime (XS--) by tye
in thread Multiple perl interpreters and Module::Runtime by daneus

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.