Crashing perlembed 
Author Message
 Crashing perlembed

Hi folks,

I'm having fun using Perl to parse text buffers from my GUI app.
Basically, I "trigger" the parsing with a mouse click.  The thing is, it
seems a bit brittle.  EG., if I click too often, it crashes.

I'm using eval_sv since it seems a bit quicker than eval_pv (which seems
to call eval_sv anyhow).

Here's my parser code.  Not I'm not using PL_exit_flags:

int perl_parse_buf (char *inBuf) {

        STRLEN n_a;
        SV *text = NEWSV(1099,0);
        char *embedding[] = { "", "-e", "" };

        if (!my_perl) {
                my_perl = perl_alloc();
                perl_construct( my_perl );
                perl_parse(my_perl, xs_init, 3, embedding, NULL);
                perl_run(my_perl);
        }

        sv_setpv(text,inBuf);
        eval_sv(text, G_SCALAR);

        {
                perl_destruct(my_perl);
                perl_free(my_perl);
        }

        return 0;

Quote:
}

when I parse too frequenty, I get the following error from GDB:

#0  0x404a4b83 in _int_free () from /lib/libc.so.6
#1  0x404a393c in free () from /lib/libc.so.6
#2  0x080fdbf5 in Perl_sv_clear ()
#3  0x080fe06f in Perl_sv_free ()
#4  0x080aef3e in Perl_gp_free ()
#5  0x080fdc8f in Perl_sv_clear ()
#6  0x080fe06f in Perl_sv_free ()
#7  0x0811069c in Perl_leave_scope ()
#8  0x08110aa5 in Perl_pop_scope ()
#9  0x08119002 in Perl_pp_leaveeval ()
#10 0x080f17c4 in Perl_runops_standard ()
#11 0x080a9a86 in S_call_body ()
#12 0x080a9c46 in Perl_eval_sv ()
#13 0x080a57b4 in perl_parse_buf ()

Is there a flag I need to set or something I should lock/check before
parsing again?

Thanks all,

DT
--
Technical Director, {*filter*}ia Center for Computer Music



Sun, 25 Sep 2005 08:26:46 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Crashing perlembed

2. perlembed - is there anything around yet.

3. Guru question: perlembed,perlguts

4. perlembed on HP-UX 9.05

5. How to trap fatal errors w/ perlembed?

6. Problems with perlembed under Linux (xs_init and boot_Socket issues)

7. FAQ: I've read perlembed, perlguts, etc., but I can't embed perl in

8. FAQ: I've read perlembed, perlguts, etc., but I can't embed perl in

9. FAQ: I've read perlembed, perlguts, etc., but I can't embed perl in

10. FAQ: I've read perlembed, perlguts, etc., but I can't embed perl in

11. FAQ: I've read perlembed, perlguts, etc., but I can't embed perl in

12. FAQ: I've read perlembed, perlguts, etc., but I can't embed perl in

 

 
Powered by phpBB® Forum Software