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,