Skip Menu |

This queue is for tickets about the Tk CPAN distribution.

Report information
The Basics
Id: 95094
Status: open
Priority: 0/
Queue: Tk

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

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



Subject: Ubuntu 14.04
Hi. I'm running an application written in Perl with threads (threads::shared) and Tk on Linux (ubuntu 14.04, Tk 804.031) It worked well on previous versions of Ubuntu and Tk, but now it dumps fatal errors. I have 3 errors that appears "randomly" so I'm lost to detect where is the issue. Please, see the next: Error 1: Attempt to free nonexistent shared string '.notebook.sheet1.frame.label', Perl interpreter: 0x458aa00 at /usr/lib/perl5/Tk/Widget.pm line 98. Error 2: X Error of failed request: BadDrawable (invalid Pixmap or Window parameter) Major opcode of failed request: 70 (X_PolyFillRectangle) Resource id in failed request: 0x51846 Serial number of failed request: 49350 Current serial number in output stream: 49395 Error 3: [xcb] Unknown sequence number while processing queue [xcb] Most likely this is a multi-threaded client and XInitThreads has not been called [xcb] Aborting, sorry about that. perl: ../../src/xcb_io.c:274: poll_for_event: Assertion `!xcb_xlib_threads_sequence_lost' failed. Aborted (core dumped) Thank you for any reply. Peco
On 2014-04-27 06:21:44, PECO wrote: Show quoted text
> Hi. > > I'm running an application written in Perl with threads > (threads::shared) and Tk on Linux (ubuntu 14.04, Tk 804.031) > It worked well on previous versions of Ubuntu and Tk, but now it dumps > fatal errors. > I have 3 errors that appears "randomly" so I'm lost to detect where is > the issue. > > Please, see the next: > > Error 1: > Attempt to free nonexistent shared string > '.notebook.sheet1.frame.label', Perl interpreter: 0x458aa00 at > /usr/lib/perl5/Tk/Widget.pm line 98. > > Error 2: > X Error of failed request: BadDrawable (invalid Pixmap or Window > parameter) > Major opcode of failed request: 70 (X_PolyFillRectangle) > Resource id in failed request: 0x51846 > Serial number of failed request: 49350 > Current serial number in output stream: 49395 > > Error 3: > [xcb] Unknown sequence number while processing queue > [xcb] Most likely this is a multi-threaded client and XInitThreads has > not been called > [xcb] Aborting, sorry about that. > perl: ../../src/xcb_io.c:274: poll_for_event: Assertion > `!xcb_xlib_threads_sequence_lost' failed. > Aborted (core dumped) > > Thank you for any reply. >
Hello Peco, can you create a small example which can reproduce the issue? Generally, threading does not work very well with Perl and even worse with Perl/Tk, so I am surprised that you had success with this combination. But maybe the fix is easy and the call to XInitThreads() is sufficient. Regards, Slaven
On Sun Apr 27 08:06:28 2014, SREZIC wrote: Show quoted text
> On 2014-04-27 06:21:44, PECO wrote:
> > Hi. > > > > I'm running an application written in Perl with threads > > (threads::shared) and Tk on Linux (ubuntu 14.04, Tk 804.031) > > It worked well on previous versions of Ubuntu and Tk, but now it > > dumps > > fatal errors. > > I have 3 errors that appears "randomly" so I'm lost to detect where > > is > > the issue. > > > > Please, see the next: > > > > Error 1: > > Attempt to free nonexistent shared string > > '.notebook.sheet1.frame.label', Perl interpreter: 0x458aa00 at > > /usr/lib/perl5/Tk/Widget.pm line 98. > > > > Error 2: > > X Error of failed request: BadDrawable (invalid Pixmap or Window > > parameter) > > Major opcode of failed request: 70 (X_PolyFillRectangle) > > Resource id in failed request: 0x51846 > > Serial number of failed request: 49350 > > Current serial number in output stream: 49395 > > > > Error 3: > > [xcb] Unknown sequence number while processing queue > > [xcb] Most likely this is a multi-threaded client and XInitThreads > > has > > not been called > > [xcb] Aborting, sorry about that. > > perl: ../../src/xcb_io.c:274: poll_for_event: Assertion > > `!xcb_xlib_threads_sequence_lost' failed. > > Aborted (core dumped) > > > > Thank you for any reply. > >
> > Hello Peco, > > can you create a small example which can reproduce the issue? > > Generally, threading does not work very well with Perl and even worse > with Perl/Tk, so I am surprised that you had success with this > combination. But maybe the fix is easy and the call to XInitThreads() > is sufficient. > > Regards, > Slaven
Hello Slaven. First, thank for your reply. The good news is that I found a workaround to the issue. The not-good news is that I'm to sure to understand where the issue was. The application intensively uses Threads, Shared and Tk. Yes, I know that is not the best combination, but with care the mix worked well. I like Tk, so I'm doing my best to avoid jumping to another toolkit (wxwidgets?). I'm attaching an example to reproduce the issue (sorry, the application is big and it's challenger to extract/isolate code) Summary: Tk 804.031 Perl 5.14.2: the code works Perl 5.18.2: you need to avoid to do threads->exit (line 14) Best Regards,
Subject: issue.pl
#!/usr/bin/perl # Tk 804.031 # Perl 5.14.2 (Ubuntu 12.04): the code works # Perl 5.18.2 (Ubuntu 14.04): you need to avoid to do threads->exit (line 14) use warnings; use strict; use threads; use Tk; my $status_legend='Some text'; sub Monitor { sleep 1; threads->detach; threads->exit; # <------ Issue with Perl v5.18.2 return; } my $mw=MainWindow->new; $mw->geometry('100x20'); my $f6=$mw->Frame()->pack(); my $sb=$f6->Label(-textvariable=>\$status_legend)->pack(); my $thr=threads->create(\&Monitor); MainLoop;
Le Lun 28 Avr 2014 04:58:02, PECO a écrit : Show quoted text
> On Sun Apr 27 08:06:28 2014, SREZIC wrote:
> > On 2014-04-27 06:21:44, PECO wrote:
> > > Hi. > > > > > > I'm running an application written in Perl with threads > > > (threads::shared) and Tk on Linux (ubuntu 14.04, Tk 804.031) > > > It worked well on previous versions of Ubuntu and Tk, but now it > > > dumps > > > fatal errors. > > > I have 3 errors that appears "randomly" so I'm lost to detect where > > > is > > > the issue. > > > > > > Please, see the next: > > > > > > Error 1: > > > Attempt to free nonexistent shared string > > > '.notebook.sheet1.frame.label', Perl interpreter: 0x458aa00 at > > > /usr/lib/perl5/Tk/Widget.pm line 98. > > > > > > Error 2: > > > X Error of failed request: BadDrawable (invalid Pixmap or Window > > > parameter) > > > Major opcode of failed request: 70 (X_PolyFillRectangle) > > > Resource id in failed request: 0x51846 > > > Serial number of failed request: 49350 > > > Current serial number in output stream: 49395 > > > > > > Error 3: > > > [xcb] Unknown sequence number while processing queue > > > [xcb] Most likely this is a multi-threaded client and XInitThreads > > > has > > > not been called > > > [xcb] Aborting, sorry about that. > > > perl: ../../src/xcb_io.c:274: poll_for_event: Assertion > > > `!xcb_xlib_threads_sequence_lost' failed. > > > Aborted (core dumped) > > > > > > Thank you for any reply. > > >
> > > > Hello Peco, > > > > can you create a small example which can reproduce the issue? > > > > Generally, threading does not work very well with Perl and even worse > > with Perl/Tk, so I am surprised that you had success with this > > combination. But maybe the fix is easy and the call to XInitThreads() > > is sufficient. > > > > Regards, > > Slaven
> > Hello Slaven. > > First, thank for your reply. > The good news is that I found a workaround to the issue. > > The not-good news is that I'm to sure to understand where the issue > was. > The application intensively uses Threads, Shared and Tk. Yes, I know > that is not the best combination, but with care the mix worked well. I > like Tk, so I'm doing my best to avoid jumping to another toolkit > (wxwidgets?). > > I'm attaching an example to reproduce the issue (sorry, the > application is big and it's challenger to extract/isolate code) > > Summary: > > Tk 804.031 > > Perl 5.14.2: the code works > Perl 5.18.2: you need to avoid to do threads->exit (line 14) > > Best Regards,
Dear, You can read this documentation : http://djibril.developpez.com/tutoriels/perl/application-perl-tk-non-figee-threads-win32/ Best Regards, djibel