Summary: | x-server segfault in X(CompositeRects) | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | xorg | Reporter: | Igor Vagulin <igor.vagulin> | ||||||||||||||
Component: | Server/Acceleration/glamor | Assignee: | Zhigang Gong <zhigang.gong> | ||||||||||||||
Status: | RESOLVED FIXED | QA Contact: | |||||||||||||||
Severity: | normal | ||||||||||||||||
Priority: | medium | CC: | michel | ||||||||||||||
Version: | unspecified | ||||||||||||||||
Hardware: | Other | ||||||||||||||||
OS: | All | ||||||||||||||||
Whiteboard: | |||||||||||||||||
i915 platform: | i915 features: | ||||||||||||||||
Attachments: |
|
Created attachment 69843 [details]
dmesg output
Created attachment 69844 [details]
xorg.conf
glamor doesn't work with xserver 1.13 yet. You'll need to use an older xserver. Created attachment 69845 [details]
xorg.log from x-server 1.12.4
Actually I started with 1.12.2 then checked 1.12.4 then tried 1.13. On 1.12 x-server crashes early on start. xorg log from 1.12.4 attached.
try building glamor with --enable-glx-tls with --enable-glx-tls xfce renders desktop and machine hangs: mouse cursor doesn't move, ctrl-alt-f1 doesn't switch to console. After restart xorg log is empty. exact configure command line: /var/tmp/portage/x11-libs/glamor-0.5/work/glamor-0.5/configure --prefix=/usr --build=i686-pc-linux-gnu --host=i686-pc-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --disable-dependency-tracking --docdir=/usr/share/doc/glamor-0.5 --enable-shared --disable-static --disable-glamor-gles2 --enable-glx-tls I will try to connect through ssh from my android device to get better backtrace without enable-glx-tls. Was able to get backtrace. Program received signal SIGSEGV, Segmentation fault.x08149d02 in ?? () (gdb) bt #0 0x08149d02 in ?? () #1 0xf7217e03 in glamor_composite_rectangles (op=3 '\003', dst=0xa6e60d0, color=0xa6a6d2c, num_rects=4, rects=0xa6a6d34) at /var/tmp/portage/x11-libs/glamor-0.5/work/glamor-0.5/src/glamor_compositerects.c:270 #2 0x0813da52 in CompositeRects () #3 0x08140958 in ?? () #4 0x0813e113 in ?? () #5 0x08077f65 in ?? () #6 0x08065d7a in _start () (gdb) frame 1 1 0xf7217e03 in glamor_composite_rectangles (op=3 '\003', dst=0xa6e60d0, color=0xa6a6d2c, num_rects=4, rects=0xa6a6d34) at /var/tmp/portage/x11-libs/glamor-0.5/work/glamor-0.5/src/glamor_compositerects.c:270 270 /var/tmp/portage/x11-libs/glamor-0.5/work/glamor-0.5/src/glamor_compositerects.c: Нет такого файла или каталога. in /var/tmp/portage/x11-libs/glamor-0.5/work/glamor-0.5/src/glamor_compositerects.c Created attachment 69846 [details]
bt-with-x-server-debug-info
could you confirm that when you build mesa, you did use --enable-glx-tls? If not, please try to use that parameter to rebuild mesa. (In reply to comment #7) > Was able to get backtrace. > > Program received signal SIGSEGV, Segmentation fault.x08149d02 in ?? () > (gdb) bt > #0 0x08149d02 in ?? () > #1 0xf7217e03 in glamor_composite_rectangles (op=3 '\003', dst=0xa6e60d0, > color=0xa6a6d2c, num_rects=4, rects=0xa6a6d34) > at > /var/tmp/portage/x11-libs/glamor-0.5/work/glamor-0.5/src/ > glamor_compositerects.c:270 > #2 0x0813da52 in CompositeRects () > #3 0x08140958 in ?? () > #4 0x0813e113 in ?? () > #5 0x08077f65 in ?? () > #6 0x08065d7a in _start () > (gdb) frame 1 > 1 0xf7217e03 in glamor_composite_rectangles (op=3 '\003', dst=0xa6e60d0, > color=0xa6a6d2c, num_rects=4, rects=0xa6a6d34) > at > /var/tmp/portage/x11-libs/glamor-0.5/work/glamor-0.5/src/ > glamor_compositerects.c:270 > 270 > /var/tmp/portage/x11-libs/glamor-0.5/work/glamor-0.5/src/ > glamor_compositerects.c: Нет такого файла или каталога. > in > /var/tmp/portage/x11-libs/glamor-0.5/work/glamor-0.5/src/ > glamor_compositerects.c I am sure enable-glx-tls is used. Below is exact configure cmd line. ./configure --prefix=/usr --build=i686-pc-linux-gnu --host=i686-pc-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --disable-dependency-tracking --enable-dri --enable-glx --enable-texture-float --disable-debug --enable-egl --enable-gbm --disable-gles1 --disable-gles2 --enable-glx-tls --disable-osmesa --enable-asm --enable-shared-glapi --disable-xa --disable-xorg --with-dri-drivers= --with-gallium-drivers=,swrast,radeonsi,r300,r600,swrast,radeonsi,r300,r600,swrast,radeonsi,r300,r600 --with-egl-platforms=x11,drm --enable-gallium-egl --disable-gallium-g3dvl --enable-gallium-llvm --disable-openvg --disable-r600-llvm-compiler --disable-vdpau --disable-xvmc I cant understand why there is so much attention to enable-glx-tls. For me bug is pretty obvious: local region not initialized in fallback mode, but used in DamageRegionAppend. look like following patch fixes problem for me: ivagulin ~ # diff -u glamor-0.5/src/glamor_compositerects.c /var/tmp/portage/x11-libs/glamor-0.5/work/glamor-0.5/src/glamor_compositerects.c --- glamor-0.5/src/glamor_compositerects.c 2012-08-10 09:46:42.000000000 +0400 +++ /var/tmp/portage/x11-libs/glamor-0.5/work/glamor-0.5/src/glamor_compositerects.c 2012-11-13 03:50:25.838203549 +0400 @@ -261,15 +261,17 @@ goto done; } } -fallback: - miCompositeRects(op, dst, color, num_rects, rects); -done: + /* XXX xserver-1.8: CompositeRects is not tracked by Damage, so we must * manually append the damaged regions ourselves. */ DamageRegionAppend(&pixmap->drawable, ®ion); DamageRegionProcessPending(&pixmap->drawable); +fallback: + miCompositeRects(op, dst, color, num_rects, rects); +done: + if (need_free_region) pixman_region_fini(®ion); if (source) (In reply to comment #10) > I am sure enable-glx-tls is used. Below is exact configure cmd line. > ./configure --prefix=/usr --build=i686-pc-linux-gnu --host=i686-pc-linux-gnu > --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share > --sysconfdir=/etc --localstatedir=/var/lib --disable-dependency-tracking > --enable-dri --enable-glx --enable-texture-float --disable-debug > --enable-egl --enable-gbm --disable-gles1 --disable-gles2 --enable-glx-tls > --disable-osmesa --enable-asm --enable-shared-glapi --disable-xa > --disable-xorg --with-dri-drivers= > --with-gallium-drivers=,swrast,radeonsi,r300,r600,swrast,radeonsi,r300,r600, > swrast,radeonsi,r300,r600 --with-egl-platforms=x11,drm --enable-gallium-egl > --disable-gallium-g3dvl --enable-gallium-llvm --disable-openvg > --disable-r600-llvm-compiler --disable-vdpau --disable-xvmc > > I cant understand why there is so much attention to enable-glx-tls. For me The reason is not very obvious, as glamor is in xserver process and has a dri loader for it, glx(xserver side) also haas a dri loader. And by default, glx (xserver side) is built by tls enabled, but mesa is not, so that will cause segfault when you call gl functions. > bug is pretty obvious: local region not initialized in fallback mode, but > used in DamageRegionAppend. That's the point. Your case hit a fallback path, and the region is not initialized. > > look like following patch fixes problem for me: > ivagulin ~ # diff -u glamor-0.5/src/glamor_compositerects.c > /var/tmp/portage/x11-libs/glamor-0.5/work/glamor-0.5/src/ > glamor_compositerects.c > --- glamor-0.5/src/glamor_compositerects.c 2012-08-10 09:46:42.000000000 > +0400 > +++ > /var/tmp/portage/x11-libs/glamor-0.5/work/glamor-0.5/src/ > glamor_compositerects.c 2012-11-13 03:50:25.838203549 +0400 > @@ -261,15 +261,17 @@ > goto done; > } > } > -fallback: > - miCompositeRects(op, dst, color, num_rects, rects); > -done: > + > /* XXX xserver-1.8: CompositeRects is not tracked by Damage, so we must > * manually append the damaged regions ourselves. > */ > DamageRegionAppend(&pixmap->drawable, ®ion); > DamageRegionProcessPending(&pixmap->drawable); > > +fallback: > + miCompositeRects(op, dst, color, num_rects, rects); > +done: > + > if (need_free_region) > pixman_region_fini(®ion); > if (source) The patch is not totally correct. We need to call DamageRegionAppend anyway and the reason is according to the comments above. I refine the patch slightly and will attach it below, could you test it? Created attachment 69975 [details] [review] patch to fix compositerects segfault bug Segfault is not reproduced with your patch. Thank you. I just pushed the patch, and mark this bug as fixed. |
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.
Created attachment 69842 [details] xorg log with brief backtrace steps to reproduce: - start x-server with glamor enabled - start firefox result: firefox render blank window just after that x-server crashes Unfortunately I was unable to generate good backtrace: I don't have another machine to ssh, when I run with NoTrapSignals machine hangs and don't produce crashdump. some info gentoo hd7850 glamor-0.5 xf86-video-ati-7.0 mesa-9.0 libdrm-2.4.40 kernel-3.6.6