# New Ticket Created by  Bruce Gray 
# Please include the string:  [perl #19227]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt2/Ticket/Display.html?id=19227 >


In headers.c version 1.18, the code initializing 
interpreter->arena_base->extra_buffer_headers was #if'ed out.
This caused pointer extra_buffer_headers.bufstart to be 
uninitialized on Win32, which does not zero memory during 
allocation. Test t/src/sprintf.t (#2) dereferences bufstart 
and segfaults during compact_pool().

This patch corrects the problem.

-- 
Hope this helps,
Bruce Gray



-- attachment  1 ------------------------------------------------------
url: http://rt.perl.org/rt2/attach/45705/35831/c12f8b/bufstart_init.patch

Index: headers.c
===================================================================
RCS file: /cvs/public/parrot/headers.c,v
retrieving revision 1.23
diff -u -r1.23 headers.c
--- headers.c   12 Dec 2002 08:07:08 -0000      1.23
+++ headers.c   17 Dec 2002 22:26:20 -0000
@@ -402,8 +402,15 @@
 #if 0
     Parrot_allocate(interpreter,
             &interpreter->arena_base->extra_buffer_headers, 0);
     add_extra_buffer_header(interpreter,
             &interpreter->arena_base->extra_buffer_headers);
+#else
+    interpreter->arena_base->extra_buffer_headers.bufstart  = NULL;
+    interpreter->arena_base->extra_buffer_headers.buflen    = 0;
+    interpreter->arena_base->extra_buffer_headers.obj.flags = 0;
+# if ! DISABLE_GC_DEBUG
+    interpreter->arena_base->extra_buffer_headers.version   = 0;
+# endif
 #endif
     /* Init the constant string header pool */
     interpreter->arena_base->constant_string_header_pool =

Reply via email to