Re: $drawing_area->queue_draw(); make program crash on some systems - mystery deepens

Following Emmanuele's advice, below is an oversimplified example exhibiting even worse symptoms. It is a 
simple Cairo surface in a drawing area in a window.

The program works fine under opensuse 13.1 i586 and on windows (only tested through wine, though). On 
opensuse 13.1 x86_64, I get an immediate "BadDrawable (invalid Pixmap or Window parameter)" crash if I set 
the variable $case=0 on line 12, and a crash after a few clicks in the drawing area if I set $case=1.

The main difference between the two cases is if $case=0, the drawing area is a child of the main window, 
while it is inside several generations of parent widgets if $case=1. Since X errors are asynchronous, it 
might be the same problem in both cases, though I doubt it: having $window->queue_draw(); instead of 
$drawing_area->queue_draw(); in the button_press_event sub makes no crash if $case=1, but I still get a crash 
if $case=0.

I tried running this through "GDB perl" and then "run", but do not get anything more than the 
BadDrawable error message.

Any hint appreciated.


On Tuesday 03 February 2015 17:39:27 you wrote:
Hello Emmanuele,

My apologies, I thought the original email would appear in the thread. As I wrote in the first email, I 
have a $drawing_area that is a grand-grand-grand child of a $window. When the user clicks on the drawing 
area, my program adds a point (and then paths) on the locations clicked.

To schedule the redrawing, I tried calling $drawing_area->queue_draw();. This works fine on opensuse 13.1 
i586, but crashes on opensuse 13.1 x86_64.

Calling $window->queue_draw(); works fine on both systems, but does not make much sense to me, particularly 
if I ever want to replace it with a queue_draw_area(...).

Anyway, I'll try a GDB trace, and maybe strip all the UI and stuff from my program to have something 
shorter exhibiting what I think is a bug...


On Tuesday 03 February 2015 14:43:10 you wrote:

On 3 February 2015 at 14:41, Emmanuele Bassi <ebassi gmail com> wrote:

On 3 February 2015 at 14:31, gvb <postdoc38 yahoo fr> wrote:
Sorry, I forgot to add my code to the previous email. Here it is. Problem is
at line 1912...

Any comment welcome...

sorry, but you'll have to do a bit better than this.

that is a massive Perl application, one that is unlikely to just be
run by random people.

could you please write a small, self-contained test case that exhibits
the same crash?

what would also help is running it under GDB and retrieving the stack
trace of the crash, so that you can at least look at where it's


Description: Perl program

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]