Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

1. I included this headers (forget post them last time).

#include <EXTERN.h> #include <perl.h>

2. I don't understand what it means, because I use cl compiler.

cc -o perl-interp perl-interp.c `perl -MExtUtils::Embed -e ccopts -e + ldopts

As I understand "perl -MExtUtils::Embed -e ccopts -e ldopts" are command arguments. But it doesn't help.

I'd added more information about my problem. Here it is:

------ platform - win32 (WinXP).

------ Memory protection - Paging

----- I use VC.NET 2003.

------ Output of 'perl -V'

Summary of my perl5 (revision 5 version 9 subversion 4) configuration: Platform: osname=MSWin32, osvers=5.1, archname=MSWin32-x86-multi-thread uname='' config_args='undef' hint=recommended, useposix=true, d_sigaction=undef useithreads=define, usemultiplicity=define useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=und +ef use64bitint=undef, use64bitall=undef, uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='cl', ccflags ='-nologo -GF -W3 -MD -Zi -DNDEBUG -O1 -DWIN32 -D +_CONSOLE -DNO_STRICT -DHAVE_DES_FCRYPT -DPERL_IMPLICIT_CONTEXT -DPER +L_IMPLICIT_SYS -DUSE_PERLIO -DPERL_MSVCRT_READFIX', optimize='-MD -Zi -DNDEBUG -O1', cppflags='-DWIN32' ccversion='13.10.3077', gccversion='', gccosandvers='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234 d_longlong=undef, longlongsize=8, d_longdbl=define, longdblsize=10 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='__int64 +', lseeksize=8 alignbytes=8, prototype=define Linker and Libraries: ld='link', ldflags ='-nologo -nodefaultlib -debug -opt:ref,icf -l +ibpath:"c:\perl\lib\CORE" -machine:x86' libpth=\lib libs= oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib + comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib netap +i32.lib uuid.lib ws2_32.lib mpr.lib winmm.lib version.lib odbc32.lib odbccp32 +.lib msvcrt.lib perllibs= oldnames.lib kernel32.lib user32.lib gdi32.lib winspool +.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib n +etapi32.lib uuid.lib ws2_32.lib mpr.lib winmm.lib version.lib odbc32.lib odbccp32 +.lib msvcrt.lib libc=msvcrt.lib, so=dll, useshrplib=yes, libperl=perl59.lib gnulibc_version='' Dynamic Linking: dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' ' cccdlflags=' ', lddlflags='-dll -nologo -nodefaultlib -debug -opt: +ref,icf -libpath:"c:\perl\lib\CORE" -machine:x86' Characteristics of this binary (from libperl): Compile-time options: MULTIPLICITY PERL_DONT_CREATE_GVSV PERL_IMPLICIT_CONTEXT PERL_IMPLICIT_SYS PERL_MALLOC_WRAP PL_OP_SLAB_ALLOC USE_ITHREADS USE_LARGE_FILES USE_PERLIO Built under MSWin32 Compiled at Mar 12 2007 14:54:36 @INC: D:/Irina/3rdparty/perl/lib .

------

Run form VC 2003

Debug tracing:

Unhandled exception at 0x7c901230 in perlInterpreter.exe: User breakpoint.

------

Debug runnng (Ctrl+F5) output:

Hi, I'm 1.

Hi, I'm 2.

Attempt to free unreferenced glob pointers, Perl interpreter: 0x8623b4 during global destruction.

Unbalanced string table refcount: (1) for -e during global destruction.

------

Run from FAR output:

Hi, I'm 1

Hi, I'm 2

Free to wrong pool 882c40 not 882c3f during global destruction.

------ Full code:

#include "stdafx.h"//empt #include <EXTERN.h> #include <perl.h> static PerlInterpreter *my_perl; #define SAY_HELLO "-e", "print qq(Hi, I'm $^X\n)" int main(int argc, char **argv) { PerlInterpreter *one_perl, *two_perl; char *one_args[] = { "one_perl", SAY_HELLO }; char *two_args[] = { "two_perl", SAY_HELLO }; PERL_SYS_INIT3(&argc,&argv,&env); one_perl = perl_alloc(); my_perl = one_perl; PERL_SET_CONTEXT(one_perl); perl_construct(one_perl); PERL_SET_CONTEXT(one_perl); perl_parse(one_perl, NULL, 3, one_args, (char **)NULL); PERL_SET_CONTEXT(one_perl); perl_destruct(one_perl); PERL_SET_CONTEXT(one_perl); perl_free(one_perl); two_perl = perl_alloc(); my_perl = two_perl; PERL_SET_CONTEXT(two_perl); perl_construct(two_perl); PERL_SET_CONTEXT(two_perl); perl_parse(two_perl, NULL, 3, two_args, (char **)NULL); PERL_SET_CONTEXT(two_perl); perl_destruct(two_perl); PERL_SET_CONTEXT(two_perl); perl_free(two_perl); PERL_SYS_TERM(); return 0; }
------ Stack:
ntdll.dll!7c901230() ntdll.dll!7c96c943() ntdll.dll!7c95db9c() ntdll.dll!7c96cd11() ntdll.dll!7c96df66() ntdll.dll!7c926abe() ntdll.dll!7c94a5d0() ntdll.dll!7c94a5d0() ntdll.dll!7c9268ad() ntdll.dll!7c9268ad() msvcrt.dll!77c1c2de() ntdll.dll!7c926abe() ntdll.dll!7c9268ad() ntdll.dll!7c9268ad() ntdll.dll!7c9268ad() > perl59.dll!VMem::FreeLock() Line 237 C++ perl59.dll!VMem::Free(void * pMem=0x00860000) Line 222 + 0x8 + C++ perl59.dll!PerlMemFree(IPerlMem * piPerl=0x00860000, void * pt +r=0x00860000) Line 306 C++ perl59.dll!Perl_safesysfree(void * where=0x0012fbb8) Line 250 + + 0xe C perl59.dll!Perl_sv_clear(interpreter * my_perl=0x00860000, sv +* sv=0x00000000) Line 5122 C msvcrt.dll!77c1c2de() msvcrt.dll!77c1c2de() msvcrt.dll!77c1c2de() perl59.dll!VMem::Free(void * pMem=0x008a4cac) Line 222 C++ perl59.dll!CPerlHost::FreeShared(void * ptr=0x008a4cac) Line +101 C++ perl59.dll!PerlMemSharedFree(IPerlMem * piPerl=0x00882c18, voi +d * ptr=0x008a4cac) Line 360 C++ perl59.dll!perl_destruct(interpreter * my_perl=0x00862bfc) Li +ne 1058 + 0x12 C perlInterpreter.exe!main(int argc=1, char * * argv=0x00893d80) + Line 390 + 0x9 C++ perlInterpreter.exe!mainCRTStartup() Line 259 + 0x19 C kernel32.dll!7c816d4f() kernel32.dll!7c8399f3()
I hope on your help.

In reply to Re^2: perl_free problem by Anonymous Monk
in thread perl_free problem by iladyko_vision

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, 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, 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.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others contemplating the Monastery: (6)
    As of 2021-03-05 02:04 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?
      My favorite kind of desktop background is:











      Results (108 votes). Check out past polls.

      Notices?