Skip Menu |
 

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

Report information
The Basics
Id: 128654
Status: new
Priority: 0/
Queue: Tcl-pTk

People
Owner: Nobody in particular
Requestors: CAC [...] cpan.org
Cc:
AdminCc:

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

Attachments
perl5.28_2019-02-25-211433_cacbook.crash



Subject: Errors when calling Perl exit from Tk sub
Using Tcl::pTk 0.95 and Tcl/Tk 8.6.9, but I'm not aware this doesn't apply to earlier Tcl::pTk or Tcl/Tk.
 
According to Mastering Perl/Tk §1.4.1 "exit Versus destroy", Perl/Tk redefines exit; to my knowledge, Tcl::pTk does not do this. Currently, the File > Quit command in the widgetTclpTk demo invokes sub { exit }. Clicking File > Quit causes the following errors:
 
- on macOS XQuartz, causes "Segmentation fault 11" (will attach crash log)
 
- on Fedora 29, causes the following error (only the opcode values are consistent):
 
X Error of failed request:  RenderBadPicture (invalid Picture parameter)
  Major opcode of failed request:  138 (RENDER)
  Minor opcode of failed request:  7 (RenderFreePicture)
  Picture id in failed request: 0x16000e2
  Serial number of failed request:  1961
  Current serial number in output stream:  2049
 
- on FreeBSD 13.0 (GhostBSD 18.12, Project Trident PR2), causes "Bus error".
 
Nothing interesting happens on macOS Aqua or Windows.
 
 
Maybe exit should be redefined by Tcl::pTk, but how? Should it just be a shorthand for destroying the main window (…->interp->Eval('destroy .')), or are there enough situations where that shouldn't be what is done?
 
Though as Mastering Perl/Tk points out, the more clear alternative (and workaround for this issue) is to just use $MW->destroy instead of exit.
On Wed Feb 27 00:34:27 2019, CAC wrote:
Show quoted text
> Using Tcl::pTk 0.95 and Tcl/Tk 8.6.9, but I'm not aware this doesn't
> apply to
> earlier Tcl::pTk or Tcl/Tk. According to Mastering Perl/Tk §1.4.1
> "exit Versus
> destroy", Perl/Tk redefines exit; to my knowledge, Tcl::pTk does not
> do this.
> Currently, the File > Quit command in the widgetTclpTk demo invokes
> sub { exit
> }. Clicking File > Quit causes the following errors: - on macOS
> XQuartz, causes
> "Segmentation fault 11" (will attach crash log) - on Fedora 29, causes
> the
> following error (only the opcode values are consistent):
> X Error of failed request: RenderBadPicture (invalid Picture
> parameter) Major
> opcode of failed request: 138 (RENDER) Minor opcode of failed request:
> 7
> (RenderFreePicture) Picture id in failed request: 0x16000e2 Serial
> number of
> failed request: 1961 Current serial number in output stream: 2049 - on
> FreeBSD
> 13.0 (GhostBSD 18.12, Project Trident PR2), causes "Bus error".
> Nothing
> interesting happens on macOS Aqua or Windows. Maybe exit should be
> redefined by
> Tcl::pTk, but how? Should it just be a shorthand for destroying the
> main window
> (…->interp->Eval('destroy .')), or are there enough situations where
> that
> shouldn't be what is done? Though as Mastering Perl/Tk points out, the
> more
> clear alternative (and workaround for this issue) is to just use $MW-
> >destroy
> instead of exit.

Attached crash log for macOS XQuartz.
Subject: perl5.28_2019-02-25-211433_cacbook.crash
Download perl5.28_2019-02-25-211433_cacbook.crash
application/octet-stream 19.1k

Message body not shown because it is not plain text.

Another user encountered this a while back in Tcl::Tk: https://www.perlmonks.org/?node_id=1191134 (I left a reply just now).

While I do not think Tcl::Tk would worry about being compatible with Perl/Tk's exit behavior, and would probably suggest using destroy instead if exit causes problems, Tcl::pTk however may want to support existing exit usage, or it really needs to document it as unsupported in favor of using destroy. B
ecause of the difference in behavior between exit and destroy, making exit do the same as destroy I think is not desirable. But based on what I have read so far of Perl/Tk's exit implementation, if it is possible to support it in Tcl::pTk, then it may require using XS/C API and in turn involve Tcl.pm.
On Thu May 09 22:13:33 2019, CAC wrote:
Show quoted text
> Another user encountered this a while back in Tcl::Tk:
> https://www.perlmonks.org/?node_id=1191134 (I left a reply just now).

Also note that they were using Tk Aqua, and were getting a segmentation fault; I have yet to reproduce this error on Aqua.


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

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.