Bus error in x11-toolkits/qt4-gui triggered by multimedia/vlc. The function that triggers the bus error is qt_memfill32_sse2() in file painting/qdrawhelper_sse2.cpp:261. This happens on: FreeBSD myhost 9.3-STABLE FreeBSD 9.3-STABLE #88 r272279M: Mon Sep 29 09:10:30 CEST 2014 root@myhost:/usr/obj/usr/src/sys/GENERIC i386 Ports tree at revision 369691 CPU is an AMD Phenom 9550. I reported this problem on the kde@ mailing list on September 3rd but I received no answer. Since that day, I updated ports and world every week, but the problem is still there. The following description is from September 3rd, therefore it relates to the qt and vlc ports from that day. I was trying to start VLC today and it just printed out "Bus error". I recompiled debug-enabled Qt libraries (core and gui) and ran VLC through gdb: Program received signal SIGBUS, Bus error. [Switching to Thread 2880ac00 (LWP 101319/vlc)] qt_memfill32_sse2 (dest=0x28999800, value=0, count=784) at painting/qdrawhelper_sse2.cpp:261 261 const __m128i value128 = _mm_set_epi32(value, value, value, value); Current language: auto; currently c++ (gdb) bt #0 qt_memfill32_sse2 (dest=0x28999800, value=0, count=784) at painting/qdrawhelper_sse2.cpp:261 #1 0x29e46dd0 in qt_memfill<unsigned int> (dest=0x28999800, color=0, count=784) at qdrawhelper_p.h:1846 #2 0x29f988e6 in qt_rectfill<unsigned int> (dest=0x28999800, value=0, x=0, y=0, width=28, height=28, stride=112) at qdrawhelper_p.h:1887 #3 0x29f90d1b in QImage::fill (this=0x2cfd952c, pixel=0) at image/qimage.cpp:2009 #4 0x29fce0db in QRasterPixmapData::fill (this=0x2cfd9500, color=@0xbf97be90) at image/qpixmap_raster.cpp:266 #5 0x29fb7e86 in QPixmap::fill (this=0xbf97be44, color=@0xbf97be90) at image/qpixmap.cpp:1036 #6 0x2e7fb54a in Oxygen::ShadowCache::pixmap () from /usr/local/lib/liboxygenstyle.so.4 [snip] (gdb) frame 0 #0 qt_memfill32_sse2 (dest=0x28999800, value=0, count=784) at painting/qdrawhelper_sse2.cpp:261 261 const __m128i value128 = _mm_set_epi32(value, value, value, value); (gdb) list 256 case 12: *dest++ = value; --count; 257 } 258 259 int count128 = count / 4; 260 __m128i *dst128 = reinterpret_cast<__m128i*>(dest); 261 const __m128i value128 = _mm_set_epi32(value, value, value, value); 262 263 int n = (count128 + 3) / 4; 264 switch (count128 & 0x3) { 265 case 0: do { _mm_stream_si128(dst128++, value128); dmesg recognizes my CPU as follows: [as of October 1st] Copyright (c) 1992-2014 The FreeBSD Project. Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 The Regents of the University of California. All rights reserved. FreeBSD is a registered trademark of The FreeBSD Foundation. FreeBSD 9.3-STABLE #88 r272279M: Mon Sep 29 09:10:30 CEST 2014 root@myhost:/usr/obj/usr/src/sys/GENERIC i386 gcc version 4.2.1 20070831 patched [FreeBSD] CPU: AMD Phenom(tm) 9550 Quad-Core Processor (2200.26-MHz 686-class CPU) Origin = "AuthenticAMD" Id = 0x100f23 Family = 0x10 Model = 0x2 Stepping = 3 Features=0x178bfbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CLFLUSH,MMX,FXSR,SSE,SSE2,HTT> Features2=0x802009<SSE3,MON,CX16,POPCNT> AMD Features=0xee500800<SYSCALL,NX,MMX+,FFXSR,Page1GB,RDTSCP,LM,3DNow!+,3DNow!> AMD Features2=0x7ff<LAHF,CMP,SVM,ExtAPIC,CR8,ABM,SSE4A,MAS,Prefetch,OSVW,IBS> TSC: P-state invariant real memory = 4294967296 (4096 MB) avail memory = 3137052672 (2991 MB)
Maintainers CC'd
Created attachment 147880 [details] make.conf make.conf from my system.
Created attachment 148078 [details] Remove pseudo-assembly
Hi, can you rebuild your QT4 ports without handwritten platformspecific code and retry? The attachment to the previous comment is a patch on Mk/bsd.qt.mk of the ports collection that __should__ disable it.
This probably fixes it, but disables all the optimizations everywhere. It would be good to know why the autodetection isn't working (I'm assuming some feature that doesn't exist is being used nevertheless).
Hello, thank you for your replies! Alonso, I applied your patch and rebuilt x11-toolkits/qt4-gui. vlc seems to work flawlessly. I am attaching the build log. Raphael, I googled "qt_memfill32_sse2()" and found an old bug from 2010 (QTBUG-14272) that blamed gcc for a similar problem. Do you think I could try using a different compiler other than the default? I am using gcc but I don't know whether the port is using the one in base or from a port. Do you think this would be a good path to follow? In case, how do I override the compiler for the port?
Created attachment 148089 [details] Build log after disabling all platform-specific optimization
problem was solved in 2014.