Skip Menu | will be shut down on March 1st, 2021.

This queue is for tickets about the Tk CPAN distribution.

Report information
The Basics
Id: 24542
Status: stalled
Priority: 0/
Queue: Tk

Owner: Nobody in particular
Requestors: mwelinder [...]

Bug Information
Severity: Important
Broken in: (no value)
Fixed in: (no value)

Subject: [PATCH] PerlTK encGlue.c memory corruption
Date: Wed, 24 Jan 2007 10:37:27 -0500 (EST)
To: bug-Tk [...]
From: mwelinder [...] (Morten Welinder)
Download (untitled) / with headers
text/plain 1.2k
there is a systematic problem in Tk-804.027's encGlue.c that is causing memory corruption. See for example The problem is that "dSP" is declared early and that the stack can relocate between the declaration and the use of the stack. This can happen, for example, when a call to GetSystemEncoding ends up calling the perl level. One solution is to sprinkle a few SPAGAIN calls around as in the patch below. I hope I got them all. This bug also causes numerous test failures on, for example, Solaris 2.8 with Perl 5.8.8. Morten --- /home/welinder/encGlue.c Wed Jan 24 09:28:48 2007 +++ /usr/local/src/perl/mods-5.8.8/Tk-804.027/encGlue.c Wed Jan 24 09:31:10 2007 @@ -723,6 +723,7 @@ { sv_setpvn(stmp,s,len); } + SPAGAIN; PUSHMARK(sp); XPUSHs(PerlEncObj(encoding)); XPUSHs(stmp); @@ -830,6 +831,7 @@ if (srcLen) { int count; + SPAGAIN; ENTER; SAVETMPS; PUSHMARK(sp); @@ -880,6 +882,7 @@ STRLEN len; if (!encoding) encoding = GetSystemEncoding(); + SPAGAIN; ENTER; SAVETMPS; if (!src) @@ -895,6 +898,7 @@ #endif srcLen = strlen(src); } + SPAGAIN; PUSHMARK(sp); XPUSHs(PerlEncObj(encoding)); sv = newSV(srcLen);
Subject: Re: [ #24542] AutoReply: [PATCH] PerlTK encGlue.c memory corruption
Date: Wed, 24 Jan 2007 10:47:25 -0500
To: bug-Tk [...]
From: "Morten Welinder" <mwelinder [...]>
Download (untitled) / with headers
text/plain 187b
I would guess that the problem reported here is also the cause of #2842: Tk800.024 dumps the core #7989: test entry.t fails #18235: Memory corruption in Tk-804.027 Morten
Download (untitled) / with headers
text/plain 168b
I applied your patch to the SVN repository at Can you try if it really fixes the memory corruption problems? Regards, Slaven

This service is sponsored and maintained by Best Practical Solutions and runs on infrastructure.

Please report any issues with to