Skip Menu |

This queue is for tickets about the Tk CPAN distribution.

Report information
The Basics
Id: 69488
Status: new
Priority: 0/
Queue: Tk

Owner: Nobody in particular
Requestors: KWittrock [...]
user42 [...]

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

Subject: configure() / cget() free unref scalar
Date: Fri, 15 Jul 2011 09:45:29 +1000
To: bug-Tk [...]
From: Kevin Ryde <user42 [...]>
Download (untitled) / with headers
text/plain 1.4k
With recent debian i386 packaged perl-tk 804.029 and perl 5.12.4, the program below gets a warning Attempt to free unreferenced scalar: SV 0x942b018, Perl interpreter: 0x9183008 at /usr/lib/perl5/Tk/ line 166. A backtrace suggests it's somewhere in global destruction, #0 0x080c4e90 in Perl_warner () #1 0x080e9de0 in Perl_sv_free () #2 0xb7b1c7c4 in LangFreeArg () from /usr/lib/perl5/auto/Tk/ #3 0xb7b655c6 in Tk_FreeOptions () from /usr/lib/perl5/auto/Tk/ #4 0xb7b5705b in ?? () from /usr/lib/perl5/auto/Tk/ #5 0xb7b4d8af in ?? () from /usr/lib/perl5/auto/Tk/ #6 0xb7b269d2 in Tcl_EventuallyFree () from /usr/lib/perl5/auto/Tk/ #7 0xb7b4ec78 in TkDeleteAllImages () from /usr/lib/perl5/auto/Tk/ #8 0xb7b8d093 in Tk_DestroyWindow () from /usr/lib/perl5/auto/Tk/ #9 0xb7b3ad74 in Tk_DestroyObjCmd () from /usr/lib/perl5/auto/Tk/ #10 0xb7b15a1d in Call_Tk () from /usr/lib/perl5/auto/Tk/ #11 0xb7b16781 in ?? () from /usr/lib/perl5/auto/Tk/ #12 0x080e3c53 in Perl_pp_entersub () #13 0x080db222 in Perl_runops_standard () #14 0x0807b6dd in Perl_call_sv () #15 0x0807bdb2 in Perl_call_list () #16 0x0807d844 in perl_destruct () #17 0x0806576b in main () I'm not sure if setting -format this way is supposed to be allowed, but it probably should have it's ref counts right even if not.
text/x-perl 286b
#!/usr/bin/perl -w use strict; use Tk; print Tk->VERSION,"\n"; my $mw = MainWindow->new; my $photo = $mw->Photo (-width => 16, -height => 16); print "call configure ...\n"; $photo->configure (-format => 'xpm'); print "call cget ...\n"; $photo->cget ('-format'); print "done\n"; exit 0;
Subject: Bug #69488
Date: Fri, 29 Jul 2011 16:27:23 +0200
To: bug-Tk [...]
From: "K. Wittrock" <KWittrock [...]>
Download (untitled) / with headers
text/plain 280b
The error that is reported in bug report #69488 also exists under Windows XP with ActivePerl and Tk version 804.029. It's caused by calling cget in void context and can easily be cured by using something like my $fmt = $photo->cget ('-format'); Kind regards Klaus Wittrock

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

Please report any issues with to