develooper Front page | perl.perl5.porters | Postings from September 2001

Segfault on vmem.h free

Thread Next
From:
Arthur Bergman
Date:
September 27, 2001 04:36
Subject:
Segfault on vmem.h free
Message ID:
030101c14749$3fa66a20$21000a0a@vogw2kdev
Hi,

I am getting a segfault in VMem::Free(void* p) inside perl_clone. I have two ideas what could cause this, one is that VMem needs to
be protected by the locks it provide (doesn't seem to be that way right now) or the following is at fault.

It happens after 15 perl_clones when I try to Safefree the param in perl_clone line

    h = new CPerlHost(*(CPerlHost*)PL_sys_intern.internal_host);
    proto_perl = perl_clone_using(proto_perl, flags,
                        h->m_pHostperlMem,
                        h->m_pHostperlMemShared,
                        h->m_pHostperlMemParse,
                        h->m_pHostperlEnv,
                        h->m_pHostperlStdIO,
                        h->m_pHostperlLIO,
                        h->m_pHostperlDir,
                        h->m_pHostperlSock,
                        h->m_pHostperlProc
    );
    proto_perl->Isys_intern.internal_host = h;

Since perl_clone is doing allocs and frees shouldn't it be doing it on the proto_perl->Isys_intern.internal_host.
The same problem occurs with

..\perl.exe -le "while(1) { if(fork()) { print 'fork'; sleep }}"

One possible solution would be to send in host as a parameter instead (?)

Arthur


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About