[Israel.pm] Counting my scalars

Shmuel Fomberg semuelf at 012.net.il
Wed Jun 27 13:19:17 PDT 2007


Hello Me.

After reading some docs, (especially perldiag) I understood that it's
not that I have a unfree-ed scalar. It's that I have free (SvREFCNT_dec)
a scalar more times then it was referenced.
And then when Perl tries to free it itself, it found out that that
reference count is already zero. And that is the meaning of the error. 

Shmuel.


>-----Original Message-----
>From: Shmuel Fomberg [mailto:semuelf at 012.net.il]
>Sent: Sunday, June 24, 2007 10:12 PM
>To: 'Perl in Israel'
>Subject: [Israel.pm] Counting my scalars
>
>Hello There.
>
>I solved my own problem. What triggered the error was:
>unsigned char value = SvTRUE(POPs);
>
>I changed it with POPi and everything worked. (donno why... :-( )
>
>Anyway, now I'm playing with my favorite embedding-perl, and getting:
>Attempt to free unreferenced scalar: SV 0x3fece4 during global
>destruction
>
>Can anyone tell me how do I inspect the scalars that are left?
>
>Shmuel.
>
>>-----Original Message-----
>>From: perl-bounces at perl.org.il [mailto:perl-bounces at perl.org.il] On
>Behalf
>>Of Shmuel Fomberg
>>Sent: Thursday, June 21, 2007 8:39 PM
>>To: perl at perl.org.il
>>Subject: [Israel.pm] FW: Examining Perl's Stack
>>
>>Hello All.
>>
>>I am trying to write an XS code, but getting weird results. After a
lot
>>of experiencing and debugging, I found out that a function does not
get
>>the currect parameters. I suspect that by doing something wrong, I
>>managed to corrupt Perl's stack.
>>So my question is: how do I examine Perl's stack?
>>
>>The program is very simple. Something like this:
>>use mymodule;
>>my $obj = mymodule::create(); # XS
>>mymodule::do_something($obj, 1, 2, 3); # XS
>>
>>The program crashes on the "do_something".
>>
>>Ideas?
>>
>>Shmuel.
>>
>>_______________________________________________
>>Perl mailing list
>>Perl at perl.org.il
>>http://perl.org.il/mailman/listinfo/perl
>>
>>
>>--
>>No virus found in this incoming message.
>>Checked by AVG Free Edition.
>>Version: 7.5.472 / Virus Database: 269.9.1/854 - Release Date:
>19/06/2007
>>13:12
>
>
>_______________________________________________
>Perl mailing list
>Perl at perl.org.il
>http://perl.org.il/mailman/listinfo/perl
>
>
>--
>No virus found in this incoming message.
>Checked by AVG Free Edition.
>Version: 7.5.472 / Virus Database: 269.9.6/865 - Release Date:
24/06/2007
>08:33





More information about the Perl mailing list