Bug 106811 - intel_miptree_map crash
Summary: intel_miptree_map crash
Status: RESOLVED MOVED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/DRI/i965 (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Intel 3D Bugs Mailing List
QA Contact: Intel 3D Bugs Mailing List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-06-04 11:24 UTC by Marc-Andre Lureau
Modified: 2019-09-25 19:11 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Marc-Andre Lureau 2018-06-04 11:24:42 UTC
When taking a screenshot with virt-viewer (spice with virgl enabled)

(gdb) bt
#0  0x00007fffa4f2621d in intel_miptree_map (brw=0x555555f4dc40, mt=0x0, level=0, slice=0, x=0, y=117, w=1024, h=768, mode=1, out_ptr=0x7fffffffbfe0, out_stride=0x7fffffffbfd8) at intel_mipmap_tree.c:3648
#1  0x00007fffa4f1b740 in intel_map_renderbuffer (ctx=0x555555f4dc40, rb=0x555555fe9510, x=0, y=117, w=1024, h=768, mode=1, out_map=0x7fffffffc080, out_stride=0x7fffffffc088) at intel_fbo.c:169
#2  0x00007fffa4b22541 in read_rgba_pixels (ctx=0x555555f4dc40, x=0, y=0, width=1024, height=768, format=6408, type=5121, pixels=0x555556634d80, packing=0x7fffffffc210) at main/readpix.c:464
#3  0x00007fffa4b23463 in _mesa_readpixels (ctx=0x555555f4dc40, x=0, y=0, width=1024, height=768, format=6408, type=5121, packing=0x7fffffffc210, pixels=0x555556634d80) at main/readpix.c:896
#4  0x00007fffa4f29fa1 in intelReadPixels (ctx=0x555555f4dc40, x=0, y=0, width=1024, height=768, format=6408, type=5121, pack=0x7fffffffc210, pixels=0x555556634d80) at intel_pixel_read.c:296
#5  0x00007fffa4b2451f in read_pixels (no_error=false, pixels=0x555556634d80, bufSize=2147483647, type=5121, format=6408, height=768, width=1024, y=0, x=0) at main/readpix.c:1136
#6  0x00007fffa4b2451f in _mesa_ReadnPixelsARB (x=0, y=0, width=1024, height=768, format=6408, type=5121, bufSize=2147483647, pixels=0x555556634d80) at main/readpix.c:1153
#7  0x00007fffa4b245b9 in _mesa_ReadPixels (x=0, y=0, width=1024, height=768, format=6408, type=5121, pixels=0x555556634d80) at main/readpix.c:1168
#8  0x00007ffff7f85521 in spice_display_get_pixbuf (display=<optimized out>) at spice-widget.c:3173
#9  0x0000555555574464 in virt_viewer_window_menu_file_screenshot ()
#10 0x00007ffff4238add in g_closure_invoke () at /lib64/libgobject-2.0.so.0
#11 0x00007ffff424bf43 in  () at /lib64/libgobject-2.0.so.0
#12 0x00007ffff425506a in g_signal_emit_valist () at /lib64/libgobject-2.0.so.0
#13 0x00007ffff4255663 in g_signal_emit () at /lib64/libgobject-2.0.so.0
#14 0x00007ffff6397732 in gtk_widget_activate () at /lib64/libgtk-3.so.0
#15 0x00007ffff6264c76 in gtk_menu_shell_activate_item () at /lib64/libgtk-3.so.0
#16 0x00007ffff6264f13 in gtk_menu_shell_button_release () at /lib64/libgtk-3.so.0
#17 0x00007ffff62477a8 in _gtk_marshal_BOOLEAN__BOXEDv () at /lib64/libgtk-3.so.0
#18 0x00007ffff4238d36 in  () at /lib64/libgobject-2.0.so.0
#19 0x00007ffff4254ae4 in g_signal_emit_valist () at /lib64/libgobject-2.0.so.0
#20 0x00007ffff4255663 in g_signal_emit () at /lib64/libgobject-2.0.so.0
#21 0x00007ffff6395134 in gtk_widget_event_internal () at /lib64/libgtk-3.so.0
#22 0x00007ffff62445d6 in propagate_event () at /lib64/libgtk-3.so.0
#23 0x00007ffff6246793 in gtk_main_do_event () at /lib64/libgtk-3.so.0
#24 0x00007ffff5d4f639 in _gdk_event_emit () at /lib64/libgdk-3.so.0
#25 0x00007ffff5dabac6 in gdk_event_source_dispatch () at /lib64/libgdk-3.so.0
#26 0x00007ffff3f5d8ad in g_main_context_dispatch () at /lib64/libglib-2.0.so.0
#27 0x00007ffff3f5dc78 in  () at /lib64/libglib-2.0.so.0
#28 0x00007ffff3f5dd10 in g_main_context_iteration () at /lib64/libglib-2.0.so.0
#29 0x00007ffff4521675 in g_application_run () at /lib64/libgio-2.0.so.0
#30 0x0000555555566980 in main ()


#0  0x00007fffa4f2621d in intel_miptree_map (brw=0x555555f4dc40, mt=0x0, level=0, slice=0, x=0, y=117, w=1024, h=768, mode=1, out_ptr=0x7fffffffbfe0, out_stride=0x7fffffffbfd8) at intel_mipmap_tree.c:3648
3648	   assert(mt->surf.samples == 1);

mt is NULL

spice-gtk code triggering the crash:

        data = g_malloc0(d->area.width * d->area.height * 4);
        glReadBuffer(GL_FRONT);
        glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
        glReadPixels(0, 0, d->area.width, d->area.height,
                     GL_RGBA, GL_UNSIGNED_BYTE, data);
Comment 1 vadym 2018-06-07 12:18:30 UTC
Hello Marc-Andre,

Not able to reproduce this on Haswell and Kabylake. 

Can you please provide some more information on your HW and SW ?
E.g. Intel CPU model, distro, mesa version, etc.
Comment 2 Marc-Andre Lureau 2018-06-07 13:13:54 UTC
Hi!

(In reply to vadym from comment #1)
> Hello Marc-Andre,
> 
> Not able to reproduce this on Haswell and Kabylake. 
> 
> Can you please provide some more information on your HW and SW ?
> E.g. Intel CPU model, distro, mesa version, etc.

I realize the crash doesn't happen on X11, but on wayland (mutter/gnome-shell).

I run on f28 with t460p, mesa.git.

Intel® Core™ i7-6820HQ CPU @ 2.70GHz × 8 
Intel® HD Graphics 530 (Skylake GT2) / NV118

Let me know how I can help
Comment 3 Lionel Landwerlin 2018-06-07 14:03:26 UTC
I wonder whether this could be related to some tests we have crashing in piglit.

For example : 

PIGLIT_PLATFORM=gbm gl-1.0-front-invalidate-back -auto

will crash.

I've assumed that this is because some concepts (like front buffer) don't really exist for some platforms like gbm.

Because you mentioned that this is happening on Wayland and not X, the way GL context is created could be the reason why we have a crash.

Either way I don't think we should be crashing in i965, we should probably bail when no miptree has been allocated.
Comment 4 magiblot 2018-07-06 23:30:13 UTC
I just noticed I have had a crash on this very same function, on Wayland, too, but under different circumstances. See my bug report at https://bugs.freedesktop.org/show_bug.cgi?id=107058. Please mark it as duplicate if you believe that's the case.

Thanks.
Comment 5 magiblot 2018-07-06 23:35:25 UTC
(In reply to magiblot from comment #4)
> I just noticed I have had a crash on this very same function, on Wayland,
> too, but under different circumstances. See my bug report at
> https://bugs.freedesktop.org/show_bug.cgi?id=107058. Please mark it as
> duplicate if you believe that's the case.
> 
> Thanks.

Well, let me correct myself: it's not exactly the same function, but it's also related to miptrees.
Comment 6 GitLab Migration User 2019-09-25 19:11:48 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/mesa/mesa/issues/1731.


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.