Bug 21054 - [G45 UXA] python-pigment testcase xserver SEGV in EXA or python SEGV in UXA
Summary: [G45 UXA] python-pigment testcase xserver SEGV in EXA or python SEGV in UXA
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/DRI/i965 (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Eric Anholt
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-04-04 08:08 UTC by martin
Modified: 2009-05-15 17:28 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
dmesg (UXA_kernel2.6.29_libdrm2.4.6git20090403_ubuntumesa7.4_intelDDX2.6.99.1git20090402) (43.09 KB, text/plain)
2009-04-04 08:19 UTC, martin
Details
gpu regs (UXA_kernel2.6.29_libdrm2.4.6git20090403_ubuntumesa7.4_intelDDX2.6.99.1git20090402) (10.54 KB, text/plain)
2009-04-04 08:19 UTC, martin
Details
gem_objects (UXA_kernel2.6.29_libdrm2.4.6git20090403_ubuntumesa7.4_intelDDX2.6.99.1git20090402) (103 bytes, text/plain)
2009-04-04 08:19 UTC, martin
Details
gem_interrupts (UXA_kernel2.6.29_libdrm2.4.6git20090403_ubuntumesa7.4_intelDDX2.6.99.1git20090402) (259 bytes, text/plain)
2009-04-04 08:19 UTC, martin
Details
exact package versions (UXA_kernel2.6.29_libdrm2.4.6git20090403_ubuntumesa7.4_intelDDX2.6.99.1git20090402) (2.41 KB, text/plain)
2009-04-04 08:20 UTC, martin
Details
xorg conf (UXA_kernel2.6.29_libdrm2.4.6git20090403_ubuntumesa7.4_intelDDX2.6.99.1git20090402) (1.10 KB, text/plain)
2009-04-04 08:20 UTC, martin
Details
xorg.log.old (UXA_kernel2.6.29_libdrm2.4.6git20090403_ubuntumesa7.4_intelDDX2.6.99.1git20090402) (33.47 KB, text/plain)
2009-04-04 08:20 UTC, martin
Details
xorg.log (UXA_kernel2.6.29_libdrm2.4.6git20090403_ubuntumesa7.4_intelDDX2.6.99.1git20090402) (50.13 KB, text/plain)
2009-04-04 08:21 UTC, martin
Details
xsession-errors (UXA_kernel2.6.29_libdrm2.4.6git20090403_ubuntumesa7.4_intelDDX2.6.99.1git20090402) (8.39 KB, text/plain)
2009-04-04 08:21 UTC, martin
Details
xserver "bt full" for the SEGV that's triggered in EXA (6.42 KB, text/plain)
2009-04-04 08:34 UTC, martin
Details
dmesg (EXA) (43.00 KB, text/plain)
2009-04-04 08:34 UTC, martin
Details
gpu regs (EXA) (10.60 KB, text/plain)
2009-04-04 08:34 UTC, martin
Details
gem_objects (EXA) (101 bytes, text/plain)
2009-04-04 08:34 UTC, martin
Details
gem_interrupts (EXA) (254 bytes, text/plain)
2009-04-04 08:35 UTC, martin
Details
xorg conf (EXA) (1.10 KB, text/plain)
2009-04-04 08:35 UTC, martin
Details
xorg.log.old (EXA) (50.44 KB, text/plain)
2009-04-04 08:35 UTC, martin
Details
xorg.log (EXA) (32.71 KB, text/plain)
2009-04-04 08:35 UTC, martin
Details
xsession-errors (EXA) (5.46 KB, text/plain)
2009-04-04 08:36 UTC, martin
Details

Description martin 2009-04-04 08:08:15 UTC
pigment is a framework for doing openGL based UI and there is a python binding for the pigment library as well. I'm using pigment-python to load a picture into a gdk pixbuf and then show it on screen in a opengl viewport. When I do this in EXA using ubuntu package versions the xserver SEGVs, when I do it in in UXA using ubuntu package versions then I get a python SEGV instead but the python SEGV stack happens deep inside the miptree code in i965_dri.so so I think it's an intel mesa bug.

I've managed to reduce my python app down to a minimal testcase which can be used to repro this bug (see attchments). In all comments and attachments below, I will be using post-ubuntu bits like .29 kernel and intel+libdrm from git but still mesa7.4.

REPRO STEPS:
On intel G45, download the testcase.tgz extract it and run "python main.py"
Comment 1 martin 2009-04-04 08:13:26 UTC
Here is the testcase:
http://temp.minimum.se/pigment-python_testcase.tgz
Comment 2 martin 2009-04-04 08:14:28 UTC
There is lots of useful info regarding this bug available in the downstream bug report:
https://bugs.launchpad.net/ubuntu/+bug/355137
Comment 3 martin 2009-04-04 08:19:08 UTC
Created attachment 24547 [details]
dmesg (UXA_kernel2.6.29_libdrm2.4.6git20090403_ubuntumesa7.4_intelDDX2.6.99.1git20090402)
Comment 4 martin 2009-04-04 08:19:24 UTC
Created attachment 24548 [details]
gpu regs (UXA_kernel2.6.29_libdrm2.4.6git20090403_ubuntumesa7.4_intelDDX2.6.99.1git20090402)
Comment 5 martin 2009-04-04 08:19:43 UTC
Created attachment 24549 [details]
gem_objects (UXA_kernel2.6.29_libdrm2.4.6git20090403_ubuntumesa7.4_intelDDX2.6.99.1git20090402)
Comment 6 martin 2009-04-04 08:19:57 UTC
Created attachment 24550 [details]
gem_interrupts (UXA_kernel2.6.29_libdrm2.4.6git20090403_ubuntumesa7.4_intelDDX2.6.99.1git20090402)
Comment 7 martin 2009-04-04 08:20:16 UTC
Created attachment 24551 [details]
exact package versions (UXA_kernel2.6.29_libdrm2.4.6git20090403_ubuntumesa7.4_intelDDX2.6.99.1git20090402)
Comment 8 martin 2009-04-04 08:20:31 UTC
Created attachment 24552 [details]
xorg conf (UXA_kernel2.6.29_libdrm2.4.6git20090403_ubuntumesa7.4_intelDDX2.6.99.1git20090402)
Comment 9 martin 2009-04-04 08:20:47 UTC
Created attachment 24553 [details]
xorg.log.old (UXA_kernel2.6.29_libdrm2.4.6git20090403_ubuntumesa7.4_intelDDX2.6.99.1git20090402)
Comment 10 martin 2009-04-04 08:21:00 UTC
Created attachment 24554 [details]
xorg.log (UXA_kernel2.6.29_libdrm2.4.6git20090403_ubuntumesa7.4_intelDDX2.6.99.1git20090402)
Comment 11 martin 2009-04-04 08:21:14 UTC
Created attachment 24555 [details]
xsession-errors (UXA_kernel2.6.29_libdrm2.4.6git20090403_ubuntumesa7.4_intelDDX2.6.99.1git20090402)
Comment 12 martin 2009-04-04 08:22:49 UTC
Here is the stacktrace I'm seeing inside python2.6 when running the testcase in UXA with the above config i.e. kernel2.6.29_libdrm2.4.6git20090403_ubuntumesa7.4_intelDDX2.6.99.1git20090402


Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7f47f5a50950 (LWP 7855)]
*__GI___libc_free (mem=0x13d51) at malloc.c:3599
3599	malloc.c: No such file or directory.
	in malloc.c
(gdb) bt
#0  *__GI___libc_free (mem=0x13d51) at malloc.c:3599
#1  0x00007f47f4df449d in intel_miptree_set_level_info () from /usr/lib/dri/i965_dri.so
#2  0x00007f47f4e0df5c in i945_miptree_layout_2d () from /usr/lib/dri/i965_dri.so
#3  0x00007f47f4e22a0d in brw_miptree_layout () from /usr/lib/dri/i965_dri.so
#4  0x00007f47f4df46e2 in ?? () from /usr/lib/dri/i965_dri.so
#5  0x00007f47f4df4810 in intel_miptree_create () from /usr/lib/dri/i965_dri.so
#6  0x00007f47f4e0d8e5 in ?? () from /usr/lib/dri/i965_dri.so
#7  0x00007f47f4e0dd3d in intelTexImage2D () from /usr/lib/dri/i965_dri.so
#8  0x00007f47f4ea8e4a in _mesa_TexImage2D () from /usr/lib/dri/i965_dri.so
#9  0x00007f47f62f974e in do_rgb_create (texture=0x2726130) at pgmtexture.c:141
#10 0x00007f47f62fa7bd in flush_task_queue (context=0x27b8000, queue=<value optimized out>) at pgmcontext.c:1083
#11 0x00007f47f62fca98 in immediate_io_cb (source=<value optimized out>, condition=<value optimized out>, data=0x27b8000) at pgmcontext.c:1104
#12 0x00007f48024880ca in IA__g_main_context_dispatch (context=0x2318800) at /build/buildd/glib2.0-2.20.0/glib/gmain.c:1814
#13 0x00007f480248b7a0 in g_main_context_iterate (context=0x2318800, block=1, dispatch=1, self=<value optimized out>)
    at /build/buildd/glib2.0-2.20.0/glib/gmain.c:2448
#14 0x00007f480248bc6d in IA__g_main_loop_run (loop=0x27b6fe0) at /build/buildd/glib2.0-2.20.0/glib/gmain.c:2656
#15 0x00007f47f62fc32c in render_loop (data=<value optimized out>) at pgmcontext.c:1421
#16 0x00007f48024b1954 in g_thread_create_proxy (data=0x2318ac0) at /build/buildd/glib2.0-2.20.0/glib/gthread.c:635
#17 0x00007f4804a363ba in start_thread (arg=<value optimized out>) at pthread_create.c:297
#18 0x00007f4803efefcd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#19 0x0000000000000000 in ?? ()
Comment 13 martin 2009-04-04 08:34:00 UTC
Created attachment 24556 [details]
xserver "bt full" for the SEGV that's triggered in EXA

I will now attach similar logs recorded with the exact same package versions but in EXA (in this case the xserver hits a SEGV). First off, here is the backtrace from the xserver:

Program received signal SIGSEGV, Segmentation fault.
*__GI___libc_free (mem=0x21) at malloc.c:3599
3599	malloc.c: No such file or directory.
	in malloc.c
#0  *__GI___libc_free (mem=0x21) at malloc.c:3599
#1  0x00007fa79270449d in intel_miptree_set_level_info () from /usr/lib/dri/i965_dri.so
#2  0x00007fa79271df5c in i945_miptree_layout_2d () from /usr/lib/dri/i965_dri.so
#3  0x00007fa792732a0d in brw_miptree_layout () from /usr/lib/dri/i965_dri.so
#4  0x00007fa7927046e2 in ?? () from /usr/lib/dri/i965_dri.so
#5  0x00007fa792704810 in intel_miptree_create () from /usr/lib/dri/i965_dri.so
#6  0x00007fa79271d8e5 in ?? () from /usr/lib/dri/i965_dri.so
#7  0x00007fa79271dd3d in intelTexImage2D () from /usr/lib/dri/i965_dri.so
#8  0x00007fa7927b8e4a in _mesa_TexImage2D () from /usr/lib/dri/i965_dri.so
#9  0x00007fa7a416c07a in __glXDisp_TexImage2D (pc=0x7fa78b83c018 "") at ../../glx/indirect_dispatch.c:1153
#10 0x00007fa7a418efbd in __glXDisp_RenderLarge (cl=0x681ffa0, pc=0x736a8f0 "") at ../../glx/glxcmds.c:1984
#11 0x00007fa7a4192de2 in __glXDispatch (client=0x6938c40) at ../../glx/glxext.c:523
#12 0x000000000044e304 in Dispatch () at ../../dix/dispatch.c:437
#13 0x0000000000433d8d in main (argc=10, argv=0x7fffaf948b08, envp=<value optimized out>) at ../../dix/main.c:397
Comment 14 martin 2009-04-04 08:34:22 UTC
Created attachment 24557 [details]
dmesg (EXA)
Comment 15 martin 2009-04-04 08:34:35 UTC
Created attachment 24558 [details]
gpu regs (EXA)
Comment 16 martin 2009-04-04 08:34:50 UTC
Created attachment 24559 [details]
gem_objects (EXA)
Comment 17 martin 2009-04-04 08:35:05 UTC
Created attachment 24560 [details]
gem_interrupts (EXA)
Comment 18 martin 2009-04-04 08:35:20 UTC
Created attachment 24561 [details]
xorg conf (EXA)
Comment 19 martin 2009-04-04 08:35:35 UTC
Created attachment 24562 [details]
xorg.log.old (EXA)
Comment 20 martin 2009-04-04 08:35:50 UTC
Created attachment 24563 [details]
xorg.log (EXA)
Comment 21 martin 2009-04-04 08:36:04 UTC
Created attachment 24564 [details]
xsession-errors (EXA)
Comment 22 martin 2009-04-04 08:36:54 UTC
The most interesting part in all the EXA logs (imo), is the following line from the bottom of xorg.log:

(EE) DoSwapInterval: cx = 0x6905be0, GLX screen = 0x39ff080
Comment 23 martin 2009-04-05 04:50:54 UTC
On top of the versions I used for EXA testing, if I installing mesa git HEAD as of April 4th 2009, this is what I see:

for UXA, the scenario is fixed (image now loads and renders fine)

for EXA, the xserver does not SEGV anymore but the app is extremely buggy, hogging CPU, runs in all constant "grayed out unresponsive" state, shows many rendering defects etc (even when minimized it keeps blurbing stuff to the screen).
Comment 24 Eric Anholt 2009-05-15 17:28:55 UTC
Reported fixed with DRI2 at this point, so closing.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.