I have been struggling with this for the past few days. I have been trying to debug with GDB, but with out too much success. I'll get straight to the point. my perl looks something like this:
$page = contents of some web page $url = url of that web page $len = #bytes of that web page $parsed = MyParser($url, $page, $len)
where MyParser is really just a small passes along data to some other code that a colleague wrote. MyParser looks like:
char* MyParser(char* url, char* page, int len) { char *pool; int ret; pool = (char*)malloc(2*len+1); // parsing page ret = parser(url, page, pool, 2*len+1); if(ret > 0) { return pool; } else { return '0'; } }
i know that parser works fine. however, the first time i call this, i get errors like this from GDB
#0 0x000000398d6a22fd in Perl_sv_setpv () from /usr/lib64/perl5/5.8.6 +/x86_64-linux-thread-multi/CORE/libperl.so #1 0x00002aaaae180ded in XS_main_MyParser (my_perl=0x505010, cv=0xb36 +1b0) at getandParseWithC_pl_fa1e.c:400 #2 0x000000398d69b67e in Perl_pp_entersub () from /usr/lib64/perl5/5.8.6/x86_64-linux-thread-multi/CORE/libperl. +so #3 0x000000398d67f3cd in Perl_runops_debug () from /usr/lib64/perl5/5.8.6/x86_64-linux-thread-multi/CORE/libperl. +so #4 0x000000398d639dbe in perl_run () from /usr/lib64/perl5/5.8.6/x86_ +64-linux-thread-multi/CORE/libperl.so #5 0x0000000000401a01 in main ()
i dont know why i get errors regarding Perl_sv_setpv since i dont make any use (to my knowledge!) of the perl stack here. can anyone please offer some advice? I throw myself on the mercy of the perl monks!

In reply to some help with inline C by downer

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.