# New Ticket Created by Jürgen Bömmels # Please include the string: [perl #23085] # in the subject line of all future correspondence about this issue. # <URL: http://rt.perl.org/rt2/Ticket/Display.html?id=23085 >
Hello, running the testsuite with valgrind (see #23063) produces an error in t/pmc/sub.t: # Failed test (t/pmc/sub.t at line 610) # got: 'something happend==20571== Invalid read of size 1 # ==20571== at 0x40168E88: strlen (vg_clientfuncs.c:439) # ==20571== by 0x80E9D54: find_exception_handler (exceptions.c:123) # ==20571== by 0x80E9E4C: throw_exception (exceptions.c:156) # ==20571== by 0x8066978: Parrot_throw_p (core.ops:1202) # ==20571== Address 0x4122F4A3 is 1 bytes before a block of size 18 alloc'd # ==20571== at 0x40168578: malloc (vg_clientfuncs.c:103) # ==20571== by 0x80A383C: string_to_cstring (string.c:1248) # ==20571== by 0x80E9D22: find_exception_handler (exceptions.c:120) # ==20571== by 0x80E9E4C: throw_exception (exceptions.c:156) # # ' # expected: 'something happend # ' The offending line is exceptions.c:123 if (m[strlen(m-1)] != '\n') Attached patch fixes this bye boe -- attachment 1 ------------------------------------------------------ url: http://rt.perl.org/rt2/attach/61633/45411/c8eaed/exceptions.diff
Index: exceptions.c =================================================================== RCS file: /cvs/public/parrot/exceptions.c,v retrieving revision 1.19 diff -u -r1.19 exceptions.c --- exceptions.c 16 Jul 2003 15:46:56 -0000 1.19 +++ exceptions.c 22 Jul 2003 09:05:55 -0000 @@ -120,7 +120,7 @@ m = string_to_cstring(interpreter, message); if (m && *m) { fputs(m, stderr); - if (m[strlen(m-1)] != '\n') + if (m[strlen(m)-1] != '\n') fprintf(stderr, "%c", '\n'); } else