Bug 172977 - Clicking on the Asia region breaks the UI
Clicking on the Asia region breaks the UI
Product: Fedora
Classification: Fedora
Component: libart_lgpl (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Alexander Larsson
Depends On:
  Show dependency treegraph
Reported: 2005-11-11 13:58 EST by Chris Lumens
Modified: 2007-11-30 17:11 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2005-11-22 08:28:53 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Image showing UI brokenness (103.92 KB, image/png)
2005-11-11 14:04 EST, Chris Lumens
no flags Details
Workaround numerical instability (1.17 KB, patch)
2005-11-21 05:10 EST, Alexander Larsson
no flags Details | Diff

  None (edit)
Description Chris Lumens 2005-11-11 13:58:44 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8b5) Gecko/20051008 Fedora/1.5-0.5.0.beta2 Firefox/1.4.1

Description of problem:
Start up s-c-date, switch to the timezone map screen, and click on the top right region (Asia).  The UI becomes distorted and unusable, and the program cannot be quit normally.  I'll attach a picture briefly.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:

Additional info:
Comment 1 Chris Lumens 2005-11-11 14:04:25 EST
Created attachment 120959 [details]
Image showing UI brokenness
Comment 2 Nils Philippsen 2005-11-18 13:27:36 EST
I've trace this back to it looping (seemingly endlessly) in art_uta_add_line().
The problem is manifest in FC4 and Rawhide.

Alex and Matthias, here's what s-c-date does (paraphrased):

- gnome canvas widget gets created
- image (1440x720) gets placed on canvas (position x=0, y=0, anchor=gtk.ANCHOR_NW)
- set_scroll_region() to canvas.root().get_bounds()
- later on it would set_scroll_region to (640,480, 1439,829) (i.e. north east)
to zoom in on Asia
- as the changes get processed (asynchronously), the app hangs and loops in

To reproduce the problem, you can check out s-c-date source from CVS
(rhlinux.redhat.com:/usr/local/CVS either anonymous pserver or via SSH, module
redhat-config-date), change into src/ subdirectory, "python
./timezone_map_gui.py", click onto Asia, watch it hang and attach the debugger.
To experiment with coordinates, change the file "regions" in the same directory
(lines are x, y, width, height, hot_spot_y, hot_spot_y (both can be -1 for
center of the area), name/description (not used)). I noticed that when I shifted
the Asia region one pixel to the left (i.e. "639 480 ...") it doesn't hang.
Comment 3 Nils Philippsen 2005-11-18 13:31:55 EST
I just checked and found that it only hangs if I use an antialiased canvas so
the problem might be in libgnomecanvas. Unfortunately I'm at a loss how to find
out whether it's libart or libgnomecanvas with all the asynchronous processing
and such...
Comment 4 Nils Philippsen 2005-11-18 13:41:45 EST
Backtrace for your pleasure (attached to hung process with gdb/ddd):

(gdb) bt
#0  0x0476e153 in art_uta_add_line (uta=0x8d22740, x0=384, y0=0, x1=0,
y1=239.39999999999998, rbuf=0x8d24c70, rbuf_rowstride=28) at art_uta_vpath.c:250
#1  0x0476eb57 in art_uta_from_vpath (vec=Variable "vec" is not available.
) at art_uta_vpath.c:328
#2  0x0476eb85 in art_uta_from_svp (svp=0x0) at art_uta_svp.c:51
#3  0x00543515 in gnome_canvas_update_svp (canvas=0x8c0ea30, p_svp=0x8c7adec,
new_svp=0x8d24228) at gnome-canvas-util.c:470
#4  0x00543618 in gnome_canvas_item_update_svp (item=0x8c7ad60, p_svp=0x0,
new_svp=0x8d24228) at gnome-canvas-util.c:536
#5  0x005436af in gnome_canvas_item_update_svp_clip (item=0x0, p_svp=0x0,
new_svp=0x8d24228, clip_svp=0x0) at gnome-canvas-util.c:573
#6  0x00532e89 in gnome_canvas_shape_update (item=0x8c7ad60, affine=0xbfd8cb58,
clip_path=0x0, flags=0) at gnome-canvas-shape.c:1120
#7  0x0053aa15 in gnome_canvas_polygon_update (item=0x0, affine=0x0,
clip_path=0x0, flags=0) at gnome-canvas-polygon.c:252
#8  0x00549dfc in gnome_canvas_item_invoke_update (item=0x8c7ad60,
p2cpx=0x8c7ad60, clip_path=0x0, flags=2) at gnome-canvas.c:470
#9  0x0054a3d0 in gnome_canvas_group_update (item=0x8c13388, affine=0xbfd8cc38,
clip_path=0x0, flags=2) at gnome-canvas.c:1567
#10 0x00549dfc in gnome_canvas_item_invoke_update (item=0x8c13388,
p2cpx=0x8c13388, clip_path=0x0, flags=0) at gnome-canvas.c:470
#11 0x00549ed8 in do_update (canvas=0x8c0ea30) at gnome-canvas.c:3157
#12 0x0054a23f in idle_handler (data=0x0) at gnome-canvas.c:3193
#13 0x008f3730 in g_idle_dispatch (source=0x8d209b0, callback=0x54a203
<idle_handler>, user_data=0x0) at gmain.c:3813
#14 0x008f14ce in IA__g_main_context_dispatch (context=0x8b633d0) at gmain.c:1934
#15 0x008f44d6 in g_main_context_iterate (context=0x8b633d0, block=1,
dispatch=1, self=0x8c13fd0) at gmain.c:2565
#16 0x008f47c3 in IA__g_main_loop_run (loop=0x8d05ad8) at gmain.c:2769
#17 0x00defa46 in IA__gtk_main () at gtkmain.c:1009
#18 0x00256d6d in _wrap_gtk_main (self=0x0) at gtk.override:881
#19 0x00c55891 in PyEval_EvalFrame (f=0x8aeef1c) at Python/ceval.c:3531
#20 0x00c56ef8 in PyEval_EvalCodeEx (co=0xb7cd66e0, globals=0xb7f36824,
locals=0x0, args=0x0, argcount=0, kws=0x0, kwcount=0, defs=0x0, defcount=0,
closure=0x0) at Python/ceval.c:2730
#21 0x00c57228 in PyEval_EvalCode (co=0x0, globals=0x0, locals=0x0) at
#22 0x00c7355a in run_node (n=Variable "n" is not available.
) at Python/pythonrun.c:1265
#23 0x00c747d2 in PyRun_SimpleFileExFlags (fp=Variable "fp" is not available.
) at Python/pythonrun.c:860
#24 0x00c75269 in PyRun_AnyFileExFlags (fp=0x8abd008, filename=0xbfd8d870
"./timezone_map_gui.py", closeit=1, flags=0xbfd8d2d4) at Python/pythonrun.c:664
#25 0x00c7b16d in Py_Main (argc=1, argv=0xbfd8d3a4) at Modules/main.c:484
#26 0x080485ba in main (argc=0, argv=0x0) at Modules/python.c:23
Comment 5 Nils Philippsen 2005-11-18 13:44:38 EST
just another tidbit: viewport is 480x240 pixels.
Comment 6 Alexander Larsson 2005-11-21 04:50:24 EST
Unfortuntately the ugly truth is that the antialiased mode of gnome-canvas is
pretty buggy, and very hard to fix. The core problem is that libart (which is
the base for the antialiased mode) is numerically unstable and unmaintained. The
long term solution we're working on is Cairo and all of that.

However, that canvas use seems pretty simple, so it might be possible to work
around the issues. I'll take a quick look.

Comment 7 Alexander Larsson 2005-11-21 05:10:40 EST
Created attachment 121294 [details]
Workaround numerical instability

The typical workaround for issues with numerical instability is to use
art_vpath_perturb(). This isn't bound in python, so i implementing something
similar. You'll go blind if you look at it, but it works...
Comment 8 Nils Philippsen 2005-11-21 12:20:58 EST
Applied workaround in s-c-date- Feel free to CLOSE/WONTFIX.

Note You need to log in before you can comment on or make changes to this bug.