On Sun, 2006-08-13 at 10:11 +0400, Alexey Tourbin wrote:

> Program received signal SIGSEGV, Segmentation fault.
> [Switching to Thread 16384 (LWP 14787)]
> 0xb7c0b01d in read_func_marshaller (closure=0x81ba1d0, data=0x81bac58 
> "\211PNG\r\n\032\n", length=8) at CairoSurface.xs:233
> 233                     memcpy (data, retval, n_a);
> (gdb) l
> 228                     status = SvCairoStatus (ERRSV);
> 229             } else {
> 230                     STRLEN n_a;
> 231                     char *retval;
> 232                     retval = POPpx;
> 233                     memcpy (data, retval, n_a);
> 234             }
> 235     
> 236             PUTBACK;
> 237             FREETMPS;
> (gdb) p n_a
> $1 = 136029216
> (gdb) 

Ouch.  Looks like POPpx changed from perl 5.8.7 to 5.8.8.  With 5.8.7,
everything works as expected for me.  `perldoc perlapi“ says

  POPpx   Pops a string off the stack.  Requires a variable STRLEN n_a in
          scope.

In my <perl>/CORE/pp.h, POPpx is defined to call SvPVx which, in sv.h,
uses SvPV which uses SvPV_flags which finally sets n_a to SvCUR(sv).
Apparently this can't be relied upon, so I'll look into using just POPs
and sv_len.

-- 
Thanks for the report,
-Torsten

_______________________________________________
gtk-perl-list mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/gtk-perl-list

Reply via email to