[G45] Blender: crash in brw_prepare_vertices after "Render this window"

Bug #438657 reported by Wolfgang Kufner
18
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Mesa
Fix Released
Critical
mesa (Ubuntu)
Fix Released
Undecided
Bryce Harrington

Bug Description

I just replicated http://bugs.freedesktop.org/show_bug.cgi?id=24185 withMobile 4 [8086:2a42] (rev 07) both in mesa master (xorg-edgers) and in
libgl1-mesa-dri:
  Installed: 7.6.0~git20090928.6829ef74-0ubuntu1~xup~1 which is supposed to go into karmic.
All relevant information should be on freedesktop.

Stacktrace:
#0 0x00007ffff67e94f5 in memcpy () from /lib/libc.so.6
#1 0x00007ffff3a8ae9e in copy_array_to_vbo_array (brw=<value optimized out>, element=0x2358f38, dst_stride=<value optimized out>) at /usr/include/bits/string3.h:52
#2 0x00007ffff3a8b396 in brw_prepare_vertices (brw=0x23425a0) at brw_draw_upload.c:476
#3 0x00007ffff3a9750e in brw_validate_state (brw=0x23425a0) at brw_state_upload.c:322
#4 0x00007ffff3a8a11e in brw_try_draw_prims (ctx=0x23425a0, arrays=<value optimized out>, prim=<value optimized out>, nr_prims=1, ib=<value optimized out>, index_bounds_valid=<value optimized out>, min_index=0, max_index=3) at brw_draw.c:374
#5 brw_draw_prims (ctx=0x23425a0, arrays=<value optimized out>, prim=<value optimized out>, nr_prims=1, ib=<value optimized out>, index_bounds_valid=<value optimized out>, min_index=0, max_index=3) at brw_draw.c:457
#6 0x00007ffff3b4685f in vbo_exec_DrawArrays (mode=6, start=0, count=<value optimized out>) at vbo/vbo_exec_array.c:522
#7 0x00007ffff3bc6aa7 in _mesa_meta_clear (ctx=0x23425a0, buffers=<value optimized out>) at drivers/common/meta.c:1157
#8 0x00007ffff3a53a5a in intelClear (ctx=0x23425a0, mask=<value optimized out>) at intel_clear.c:175
#9 0x000000000083381e in drawview3dspace ()
#10 0x00000000006e9624 in scrarea_do_windraw ()
#11 0x00000000007090a4 in screen_swapbuffers ()
#12 0x0000000000697e69 in screenmain ()
#13 0x00000000005f8861 in main ()

Related branches

Revision history for this message
In , Sven Arvidsson (sa) wrote :

Created an attachment (id=29909)
render this window button

Revision history for this message
In , Xunx-fang (xunx-fang) wrote :

This issue can be reproduced on G45, 945GM, 945GME and 965GM.

Revision history for this message
In , Sven Arvidsson (sa) wrote :

f5539b6991e336aa1cf302dbdb1a29b3e85cff36 is the first bad commit
commit f5539b6991e336aa1cf302dbdb1a29b3e85cff36
Author: Xiang, Haihao <email address hidden>
Date: Thu Aug 20 18:19:36 2009 +0800

    i965: validate sf state

:040000 040000 9bcff867d0a3adf6e2c39bc23db5e60aef174086 ef44496a8b0340ce4281b8dd683fe8aa6e0f330a M src

Revision history for this message
In , Wolfgang Kufner (wolfgangkufner) wrote :

I can press the "Render this window" button as often as I like. No problem. But if I then close the resulting render window (with the window manager close button) then it crashes every time.

so here, Mobile 4 [8086:2a42] (rev 07) to reproduce:
open blender
press "Render this window" button
close the resulting render window with its close button

Revision history for this message
In , Wolfgang Kufner (wolfgangkufner) wrote :

I get the exact same symptoms with:
libgl1-mesa-dri:
  Installed: 7.6.0~git20090928.6829ef74-0ubuntu1~xup~1
which I am currently testing because it is supposed to be included in ubuntu 9.10

Revision history for this message
In , Sven Arvidsson (sa) wrote :

(In reply to comment #4)
> I can press the "Render this window" button as often as I like. No problem. But
> if I then close the resulting render window (with the window manager close
> button) then it crashes every time.

Yes, it's the same behaviour for me. Sorry if my first explanation wasn't clear enough.

Revision history for this message
Wolfgang Kufner (wolfgangkufner) wrote :

I just replicated http://bugs.freedesktop.org/show_bug.cgi?id=24185 withMobile 4 [8086:2a42] (rev 07) both in mesa master (xorg-edgers) and in
libgl1-mesa-dri:
  Installed: 7.6.0~git20090928.6829ef74-0ubuntu1~xup~1 which is supposed to go into karmic.
All relevant information should be on freedesktop.

Changed in mesa:
status: Unknown → Confirmed
Revision history for this message
Tormod Volden (tormodvolden) wrote :

Thanks for your report. Does it happen with the older, official Karmic package, 7.6.0~git20090817.7c422387-0ubuntu6 ?

Revision history for this message
Wolfgang Kufner (wolfgangkufner) wrote :

No, I just checked. This bug is not present in 7.6.0~git20090817.7c422387-0ubuntu6.

And just for the record. With 7.6.0~git20090817.7c422387-0ubuntu6 etracer -a (Extreme Tux Racer) gets a nice and speedy Average FPS: 29.5419. I believe to have seen only less than half that with 7.6.0~git20090928.6829ef74-0ubuntu1~xup~1 though that needs to be rechecked.

Revision history for this message
Wolfgang Kufner (wolfgangkufner) wrote :

Oh, I forgot: Above happened on an Acer Extensa 5635z.

Revision history for this message
In , Martin Olsson (mnemo) wrote :

I could also repro this bug on my G45 using karmic and the mesa version from the X-Updates repository. I added dmesg, xorglog etc do this downstream bug:
https://bugs.launchpad.net/ubuntu/+source/mesa/+bug/439488

When Blender crashes I see this in dmesg:

[ 101.175856] [drm] TMDS-12: set mode 800x600 24
[ 170.763240] [drm:i915_gem_object_pin_and_relocate] *ERROR* Relocation beyond target object bounds: obj ffff8801fc989900 target 219 delta 131072 size 131072.
[ 170.763245] [drm:i915_gem_execbuffer] *ERROR* Failed to pin buffers -22
[ 188.451656] [drm] TMDS-12: set mode 1680x1050 25
[ 229.623952] blender-bin[2133]: segfault at 0 ip 00007f75455a64f5 sp 00007fffe2c2be38 error 4 in libc-2.10.1.so[7f7545524000+166000]

http://launchpadlibrarian.net/32752843/dmesg_after_blender_render_this_window_crash.txt
http://launchpadlibrarian.net/32752859/Xorg.0.log
http://launchpadlibrarian.net/32752937/dri_debug.tgz

Revision history for this message
Bryce Harrington (bryce) wrote :

Hi wolfgangkufner,

Please attach the output of `lspci -vvnn` and `dmesg`, and attach your /var/log/Xorg.0.log (and maybe Xorg.0.log.old) file from after reproducing this issue. If you're using a custom /etc/X11/xorg.conf please attach that as well.

[This is an automated message. Apologies if it has reached you inappropriately; please just reply to this message indicating so.]

tags: added: crash
tags: added: needs-xorglog
tags: added: needs-lspci-vvnn
Changed in mesa (Ubuntu):
status: New → Incomplete
Revision history for this message
Martin Olsson (mnemo) wrote :

I could sort of almost repro this bug on my G45:

Steps:
1. install mesa 7.6.0~git20090928.6829ef74-0ubuntu1~xup~1 from X-Updates PPA
2. launch blender
3. press the "render this window" button (it's the upper right most button in the lower half of the screen, look for the tooltip)
4. _blender_ crashes and my intel driver spews nasty errors into dmesg, but Xorg remains running and usable

Using the current karmic mesa (7.6.0~git20090817.7c422387-0ubuntu6) nothing out of the ordinary happens.
I put all my dumps etc into bug 39488 which I marked as a duplicate of this one.

http://launchpadlibrarian.net/32752843/dmesg_after_blender_render_this_window_crash.txt
http://launchpadlibrarian.net/32752859/Xorg.0.log
http://launchpadlibrarian.net/32753012/lspci.txt

I even recorded a "dri_debug.tgz" even though what I saw was most certainly not a GPU freeze (unless they already merged that automatic GPU reset code which I don't think they did right?)
http://launchpadlibrarian.net/32752937/dri_debug.tgz

Changed in mesa (Ubuntu):
status: Incomplete → Confirmed
Revision history for this message
Tormod Volden (tormodvolden) wrote :

Can you please get a backtrace from blender, after installing the mesa debug packages? https://wiki.ubuntu.com/Backtrace

Revision history for this message
Wolfgang Kufner (wolfgangkufner) wrote :
Revision history for this message
Wolfgang Kufner (wolfgangkufner) wrote :

Above is produced with:
libgl1-mesa-dri:
  Installed: 7.6.1~git20090930.49fbdd18-0ubuntu1~xup~1

Revision history for this message
Martin Olsson (mnemo) wrote :

The duplicate I created yesterday was a Blender apport crash bug so it has a stack:
http://launchpadlibrarian.net/32752738/Stacktrace.txt

Not identical to Wolfgangs but I guess it's just slightly different execution paths depending on hardward or config differences.

Revision history for this message
Tormod Volden (tormodvolden) wrote :

The two stacktraces are identical.

description: updated
Revision history for this message
In , Eric Anholt (eric-anholt) wrote :

That bisect appears to be wrong -- I get the same failure in the previous commit. Things in fact fail in various ways back to the Mesa metaops introduction. It looks like the problem is that in this path:

Breakpoint 2, _mesa_meta_free (ctx=0x9a625a0) at drivers/common/meta.c:305
305 {
(gdb) bt
#0 _mesa_meta_free (ctx=0x9a625a0) at drivers/common/meta.c:305
#1 0xb5db018d in intelDestroyContext (driContextPriv=0x99b8990)
    at intel_context.c:821
#2 0xb5da7e6f in driDestroyContext (pcp=0x99b8990) at ../common/dri_util.c:545
...

(gdb) call _mesa_get_current_context()
$41 = (GLcontext *) 0x8edaa40
(gdb) p ctx
$42 = (GLcontext *) 0x9a625a0

so we're trying to free objects from ctx when _mesa_get_current_context() is what will be used when looking up the names to get objects to free. Later on down the line, we get a _mesa_error when binding a vertex array object for a drawpixels, state gets stomped since we don't catch that that happened, and finally when we get to the clear things are just hosed.

Not really sure what the right answer is here, but I suspect it's for _mesa_meta_free to only happen from the context data free path. Brian, any opinion?

Revision history for this message
In , Brian-e-paul (brian-e-paul) wrote :

Strictly speaking, we shouldn't have to worry about freeing any of the textures, VBOs, etc. in _mesa_meta_free(); I was just being paranoid.

I'll do a mem leak check with valgrind and remove this code if I can...

Otherwise, checking if (ctx == _mesa_get_current_context()) is another way to fix this.

Revision history for this message
In , Brian-e-paul (brian-e-paul) wrote :

OK, fixed on the 7.6 branch with commit 7dd2c0afd68a90bb6b1f5f030c8d60bf6a562071

Revision history for this message
Tormod Volden (tormodvolden) wrote :

This has now been fixed upstream, and in 7.6.1~git20091007.9fde81bb-0ubuntu1~xup~2 in x-updates PPA.

http://cgit.freedesktop.org/mesa/mesa/commit/?h=mesa_7_6_branch&id=7dd2c0afd68a90bb6b1f5f030c8d60bf6a562071

Changed in mesa:
status: Confirmed → Fix Released
Bryce Harrington (bryce)
tags: added: karmic
Revision history for this message
Tormod Volden (tormodvolden) wrote :

Can you please check if this happens in stock karmic? In which case we should cherry-pick the above commit.

Revision history for this message
Wolfgang Kufner (wolfgangkufner) wrote :

Yes, this bug is in stock karmic as just confirmed with ubuntu daily-live 2009-10-13.

Revision history for this message
Tormod Volden (tormodvolden) wrote :

Thanks for your testing!

Changed in mesa (Ubuntu):
assignee: nobody → Bryce Harrington (bryceharrington)
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package mesa - 7.6.0-1ubuntu4

---------------
mesa (7.6.0-1ubuntu4) karmic; urgency=low

  * Add 110_dont_free.patch: It is not necessary to worry about freeing
    the textures, VBOs, etc. in _mesa_meta_free() since these are already
    handled by the normal context deallocation code. Fixes a crash in
    Blender in brw_prepare_vertices().
    (LP: #438657)

 -- Bryce Harrington <email address hidden> Tue, 13 Oct 2009 13:48:03 -0700

Changed in mesa (Ubuntu):
status: Confirmed → Fix Released
Changed in mesa:
importance: Unknown → Critical
Changed in mesa:
importance: Critical → Unknown
Changed in mesa:
importance: Unknown → Critical
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.