Skip Menu |

This queue is for tickets about the Tcl-pTk CPAN distribution.

Report information
The Basics
Id: 129828
Status: open
Priority: 0/
Queue: Tcl-pTk

People
Owner: Nobody in particular
Requestors: welleozean [...] googlemail.com
Cc:
AdminCc:

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



Subject: [macOS]
Date: Sat, 15 Jun 2019 10:00:09 +0200
To: bug-Tcl-pTk [...] rt.cpan.org
From: welle ozean <welleozean [...] googlemail.com>
I have a GUI application compiled as an executable for macOS (Mojave). On some machines, I get the following error (I can not replicate it on mine!) which I thought related to pp/PAR. I've posted the error on the pp/PAR mailing list too, but people said I should indagate the Tcl::pTk error. I still think the problem is in the executable. However, I want to trace the issue back in Tcl::pTk. Where does this message get thrown? It all happens when a button is clicked or a bind (bound to the same button) is invoked. The fact that I can not replicate the issue on my machine makes debugging quite hard. Tcl::pTk::Error: Illegal division by zero at (eval 183) line 37. while executing "if {$catchVal != 0} { if { $retVal != "_TK_BREAK_\n" } { # BREAK returns are not errors return..." (command bound to event) Error Started at script/MYPROGRAM.pl line 206. Stack Trace: at Tcl/pTk.pm line 923. eval {...} called at Tcl/pTk.pm line 923 Tcl::pTk::DoOneEvent(Tcl::pTk=SCALAR(0x7fcff0f88698), 0) called at Tcl/pTk.pm line 906 Tcl::pTk::MainLoop() called at script/MYPROGRAM.pl line 206 require main called at /Users/we/perl5/perlbrew/perls/perl-5.26.1/lib/site_perl/5.26.1/PAR.pm line 645 PAR::_run_member(Archive::Zip::ZipFileMember=HASH(0x7fcfec6621f0), 1) called at script/main.pl line 26 require main called at /Users/we/perl5/perlbrew/perls/perl-5.26.1/lib/site_perl/5.26.1/PAR.pm line 645 PAR::_run_member(Archive::Zip::ZipFileMember=HASH(0x7fcfec6624d8)) called at /Users/we/perl5/perlbrew/perls/perl-5.26.1/lib/site_perl/5.26.1/PAR.pm line 432 PAR::import("PAR") called at -e line 585 eval {...} called at -e line 41 __par_pl::BEGIN() called at script/MYPROGRAM.pl line 0 eval {...} called at script/MYPROGRAM.pl line 0 The second variant of the error is: pTk::Error: Illegal division by zero at (eval 183) line 37. while executing "::perl::CODE(0x7fcff141bb28)" invoked from within ".top161.ttkframe181.ttkbutton183 invoke " invoked from within ".top161.ttkframe181.ttkbutton183 instate !disabled { .top161.ttkframe181.ttkbutton183 invoke } " invoked from within ".top161.ttkframe181.ttkbutton183 instate pressed { .top161.ttkframe181.ttkbutton183 state !pressed; .top161.ttkframe181.ttkbutton183 instate !disabled..." (command bound to event) <http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail> Virenfrei. www.avg.com <http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail> <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
Subject: Re: [rt.cpan.org #129828] AutoReply: [macOS]
Date: Sat, 15 Jun 2019 10:18:10 +0200
To: bug-Tcl-pTk [...] rt.cpan.org
From: welle ozean <welleozean [...] googlemail.com>
Please also note this information about the error code: " the code you gave does not look correct. It is using the numeric not-equals operator to compare $retVal against a string. " <http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail> Virenfrei. www.avg.com <http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail> <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2> Am Sa., 15. Juni 2019 um 10:01 Uhr schrieb Bugs in Tcl-pTk via RT < bug-Tcl-pTk@rt.cpan.org>: Show quoted text
> > Greetings, > > This message has been automatically generated in response to the > creation of a trouble ticket regarding: > "[macOS]", > a summary of which appears below. > > There is no need to reply to this message right now. Your ticket has been > assigned an ID of [rt.cpan.org #129828]. Your ticket is accessible > on the web at: > > https://rt.cpan.org/Ticket/Display.html?id=129828 > > Please include the string: > > [rt.cpan.org #129828] > > in the subject line of all future correspondence about this issue. To do > so, > you may reply to this message. > > Thank you, > bug-Tcl-pTk@rt.cpan.org > > ------------------------------------------------------------------------- > I have a GUI application compiled as an executable for macOS (Mojave). On > some machines, I get the following error (I can not replicate it on mine!) > which I thought related to pp/PAR. I've posted the error on the pp/PAR > mailing list too, but people said I should indagate the Tcl::pTk error. I > still think the problem is in the executable. However, I want to trace the > issue back in Tcl::pTk. Where does this message get thrown? It all happens > when a button is clicked or a bind (bound to the same button) is invoked. > The fact that I can not replicate the issue on my machine makes debugging > quite hard. > > Tcl::pTk::Error: Illegal division by zero at (eval 183) line 37. > > while executing > "if {$catchVal != 0} { > if { $retVal != "_TK_BREAK_\n" } { # BREAK returns > are not errors > return..." > (command bound to event) > > Error Started at script/MYPROGRAM.pl line 206. > > Stack Trace: > at Tcl/pTk.pm line 923. > eval {...} called at Tcl/pTk.pm line 923 > Tcl::pTk::DoOneEvent(Tcl::pTk=SCALAR(0x7fcff0f88698), 0) called at > Tcl/pTk.pm line 906 > Tcl::pTk::MainLoop() called at script/MYPROGRAM.pl line 206 > require main called at > /Users/we/perl5/perlbrew/perls/perl-5.26.1/lib/site_perl/5.26.1/PAR.pm line > 645 > PAR::_run_member(Archive::Zip::ZipFileMember=HASH(0x7fcfec6621f0), 1) > called at script/main.pl line 26 > require main called at > /Users/we/perl5/perlbrew/perls/perl-5.26.1/lib/site_perl/5.26.1/PAR.pm line > 645 > PAR::_run_member(Archive::Zip::ZipFileMember=HASH(0x7fcfec6624d8)) called > at /Users/we/perl5/perlbrew/perls/perl-5.26.1/lib/site_perl/5.26.1/PAR.pm > line 432 > PAR::import("PAR") called at -e line 585 > eval {...} called at -e line 41 > __par_pl::BEGIN() called at script/MYPROGRAM.pl line 0 > eval {...} called at script/MYPROGRAM.pl line 0 > > The second variant of the error is: > > pTk::Error: Illegal division by zero at (eval 183) line 37. > > while executing > "::perl::CODE(0x7fcff141bb28)" > invoked from within > ".top161.ttkframe181.ttkbutton183 invoke " > invoked from within > ".top161.ttkframe181.ttkbutton183 instate !disabled { > .top161.ttkframe181.ttkbutton183 invoke } " > invoked from within > ".top161.ttkframe181.ttkbutton183 instate pressed { > .top161.ttkframe181.ttkbutton183 state !pressed; > .top161.ttkframe181.ttkbutton183 instate !disabled..." > (command bound to event) > > < > http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail
> >
> Virenfrei. > www.avg.com > < > http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail
> >
> <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2> >
> I still think the problem is in the executable. However, I want to trace the
> issue back in Tcl::pTk. Where does this message get thrown? It all happens
> when a button is clicked or a bind (bound to the same button) is invoked.
 
Yes, these errors are indeed displayed by Tcl::pTk (lib/Tcl/pTk.pm, see sub Error and sub bgerror), and usually appear when an error occurs in a callback subroutine; Perl/Tk displays somewhat similar errors.
 
The error Tcl::pTk shows is based on whatever error it got from Tcl; the while executing message comes from Tcl/Tk, and it is followed by some Tcl syntax.
 
Where the error occurs in your case is wherever (eval 183) line 37 corresponds to; I'm not certain where that is exactly, and maybe Tcl::pTk is not very helpful in saying where, but I'm guessing it is probably (though not certainly) in your program and not in Tcl::pTk. Are there any division/modulo statements in your callback or any functions it calls?
 
 
> Please also note this information about the error code:
> " the code you gave does not look correct.  It is using the numeric
> not-equals operator to compare $retVal against a string. "
 
I found the thread on perl.par, and as one reply suggested, that code is Tcl syntax (from inside an Eval() in lib/Tcl/pTk.pm). In this case, using ne is still probably a better choice than !=. However, I would not be surprised if this sort of mistake were in the Perl code; use warnings would find this mistake, but warnings are not enabled for much of Tcl::pTk.

(I am not opposed to using warnings and strict, because those have been very effective at helping me find long unnoticed issues. I would like to enable them in Tcl::pTk, but I feel there's still a lot of Tcl::pTk code and non-beginner Perl topics that I don't understand enough in order to properly fix or suppress all the warnings that would appear if I did enable them.)