Perl

NAVIGATION
CATEGORIES
REFERRENCE
LINKS
  • perlbug AutoReply: embedding perl makes programs calling random() crash

    4 answers - 203 bytes - related search similar search Add To My Delicious Add To My Stumble Upon Add To My Google Mark Add To My Facebook Add To My Digg Add To My Reddit

    The same thing is true for crypt: programs using crypt start to crash, as
    crypt_r again requires an initialised struct crypt_data.
    (and, btw., crypt_r and random_r are both gnu libc extensions)
  • No.1 | | 391 bytes | |

    Wed, Aug 30, 2006 at 05:59:43PM +0200, Marc Lehmann wrote:
    The same thing is true for crypt: programs using crypt start to crash, as
    crypt_r again requires an initialised struct crypt_data.

    This sounds like this needs the bzero-ing done for BSD, and the
    pain that that was. Let me take a look into this one.

    Steve Peters
    steve (AT) fisharerojo (DOT) org
  • No.2 | | 1034 bytes | |

    Wed, Aug 30, 2006 at 11:48:27AM -0500, Steve Peters <steve (AT) fisharerojo (DOT) orgwrote:
    crypt_r again requires an initialised struct crypt_data.

    This sounds like this needs the bzero-ing done for BSD, and the
    pain that that was. Let me take a look into this one.

    in this case, bzero works (glibc requires only data->initialized to be
    zero, though), while for random_r, a call to initstate_r is required.

    however, the real problem is that perl redefines those symbols in
    the first place (i guess this is not your current concern, I am just
    clarifying this for the bug report itself).

    for example:

    #include <time.h>

    int main(void)
    {
    time_t t = 0;
    return ctime (&t);
    }

    "works", but when adding #include "perl.h" suddenly segfaults.

    the requirement to initialise a perl interpreter just to be able to call
    standard functions like localtime or crypt is the real, and rather big,
    bug that makes embedding perl almost impossible.
  • No.3 | | 1245 bytes | |

    Wed, Aug 30, 2006 at 08:30:03PM +0200, Marc Lehmann wrote:
    Wed, Aug 30, 2006 at 11:48:27AM -0500, Steve Peters <steve (AT) fisharerojo (DOT) orgwrote:
    crypt_r again requires an initialised struct crypt_data.

    This sounds like this needs the bzero-ing done for BSD, and the
    pain that that was. Let me take a look into this one.

    in this case, bzero works (glibc requires only data->initialized to be
    zero, though), while for random_r, a call to initstate_r is required.

    however, the real problem is that perl redefines those symbols in
    the first place (i guess this is not your current concern, I am just
    clarifying this for the bug report itself).

    for example:

    #include <time.h>

    int main(void)
    {
    time_t t = 0;
    return ctime (&t);
    }

    "works", but when adding #include "perl.h" suddenly segfaults.

    the requirement to initialise a perl interpreter just to be able to call
    standard functions like localtime or crypt is the real, and rather big,
    bug that makes embedding perl almost impossible.

    Would changing the Perl headers so that they only do the redefinition inside
    the Perl source code resolve this?

    Nicholas Clark
  • No.4 | | 1104 bytes | |

    Thu, Aug 31, 2006 at 09:37:01AM +0100, Nicholas Clark <nick (AT) ccl4 (DOT) orgwrote:
    the requirement to initialise a perl interpreter just to be able to call
    standard functions like localtime or crypt is the real, and rather big,
    bug that makes embedding perl almost impossible.

    Would changing the Perl headers so that they only do the redefinition inside
    the Perl source code resolve this?

    Extremely likely. In my case certainly. It would also reduce bloat at the
    same time :)

    However, there could be perl functions that are being called before a perl
    instance has created the neccessary thread state for its replacement
    functions.

    I have no idea wether such functions exist, or wether there are other valid
    reasons to call any perl function without having a perl interpreter.
    wether there are interactions with multiplicity.

    However, in all _my_ embedding needs so far, this would solve the problem.

    I would have stumbled on this earlier, but this was in fact the first time I
    (had to) build with a thread-enabled perl :->

Re: perlbug AutoReply: embedding perl makes programs calling random() crash


max 4000 letters.
Your nickname that display:
In order to stop the spam: 3 + 2 =
QUESTION ON "Perl"

EMSDN.COM