Bug #2093

g++ failing on _mm_set1_epi32() (cc don't)

Added by masterblaster over 5 years ago. Updated about 5 years ago.

Status:ClosedStart date:
Priority:UrgentDue date:
Assignee:-% Done:


Target version:-


Hi all,

successfully compiled lyx on v2.11.0.397.g4b06a0-DEVELOPMENT x86_64, but
cores at start.

Problem is in qt4-libs package,
QString::Data *QString::fromLatin1_helper(), when using _mm_set1_epi32().

Compiling and running simple test program (containing the failing call)
with both cc and g++:

#include <smmintrin.h>
int main(int argc, char *argv[]) { __m128i a = _mm_set1_epi32(0); }

$ cc -msse4.2 t.c && ./a.out
$ g++ -msse4.2 t.c && ./a.out
Illegal instruction: 4 (core dumped)

Same result with -msse4.1 compiler option.



#1 Updated by alexh about 5 years ago


I've been bitten by the same problem, but your test case is bogus. You probably
don't have a CPU that supports SSE4.X, and should not be using the smmintrin.h
header but rather emmintrin.h or xmmintrin.h.

The real issue I'm not really sure what it is, but it's not an illegal
instruction, that's clear.

I'm raising the priority to critical because it breaks every desktop app,
basically. Xorg, gtk2, qt, pixman are affected by this issue.


#2 Updated by alexh about 5 years ago

From what I can see this is due to an unaligned access with movdqa, which can
only be used with quad-word aligned addresses:

faulting instruction:
movdqa -0x2c0(%rbp),%xmm0

rbp 0x7ffffffff3f8 0x7ffffffff3f8

Not sure why gcc is generating an unaligned access with MOVDQA.

#3 Updated by alexh about 5 years ago

Should be fixed in c7a4cde72d531a700a01278b1a3596efd362767d. Please let me know
if the problem persists.

#4 Updated by alexh about 5 years ago

I forgot to mention that you need to recompile whatever used that instruction;
so in this case it seems qt.

#5 Updated by masterblaster about 5 years ago

It works with reported test program, thanks!
I'll be on holiday next three weeks, will check it extensivele then asap.

Also available in: Atom PDF