{"action":"opened","issue":{"url":"https://api.github.com/repos/uclouvain/openjpeg/issues/624","labels_url":"https://api.github.com/repos/uclouvain/openjpeg/issues/624/labels{/name}","comments_url":"https://api.github.com/repos/uclouvain/openjpeg/issues/624/comments","events_url":"https://api.github.com/repos/uclouvain/openjpeg/issues/624/events","html_url":"https://github.com/uclouvain/openjpeg/issues/624","id":110614455,"number":624,"title":"Compiling with SSE2 on Linux 32-bit causes crashes in OpenJPEG","user":{"login":"smuehlst","id":98944,"avatar_url":"https://avatars.githubusercontent.com/u/98944?v=3","gravatar_id":"","url":"https://api.github.com/users/smuehlst","html_url":"https://github.com/smuehlst","followers_url":"https://api.github.com/users/smuehlst/followers","following_url":"https://api.github.com/users/smuehlst/following{/other_user}","gists_url":"https://api.github.com/users/smuehlst/gists{/gist_id}","starred_url":"https://api.github.com/users/smuehlst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smuehlst/subscriptions","organizations_url":"https://api.github.com/users/smuehlst/orgs","repos_url":"https://api.github.com/users/smuehlst/repos","events_url":"https://api.github.com/users/smuehlst/events{/privacy}","received_events_url":"https://api.github.com/users/smuehlst/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-10-09T08:47:13Z","updated_at":"2015-10-09T08:47:13Z","closed_at":null,"body":"This was tested with the current OpenJPEG HEAD revision bbef2a9da3167646b452fe77983e33bf0596439e.\r\n\r\nI configured a Linux 32-bit build with SSE2 support like this:\r\n\r\nCC=gcc cmake ../openjpeg -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_FLAGS=\"-mfpmath=sse -msse2\"\r\n\r\nThe resulting opj_decompress executable crashes for several files of the OpenJPEG testsuite, for with openjpeg-data/input/conformance/g4_colr.j2c:\r\n\r\n    (gdb) r -i ../openjpeg-data/input/conformance/g4_colr.j2c -o g4_colr.j2c.raw\r\n\r\n     Starting program: /home/pdflib/src/openjpeg_debug/bin/opj_decompress -i ../openjpeg-data/input/conformance/g4_colr.j2c -o g4_colr.j2c.raw\r\n\r\n    [INFO] Start to read j2k main header (0).\r\n    [INFO] Main header has been correctly decoded.\r\n    [INFO] No decoded area parameters, set the decoded area to the whole image\r\n    [INFO] Header of tile 1 / 2 has been read.\r\n\r\n    Program received signal SIGSEGV, Segmentation fault.\r\n    0xb7fb7a46 in _mm_load_si128 (__P=0x81e0d78)\r\n        at /usr/lib/gcc/i686-linux-gnu/4.8/include/emmintrin.h:678\r\n    678\t return *__P;\r\n    (gdb) x/5i $pc\r\n    => 0xb7fb7a46 <opj_mct_decode+147>:\tmovdqa (%eax),%xmm0\r\n       0xb7fb7a4a <opj_mct_decode+151>:\tmovdqa %xmm0,-0x108(%ebp)\r\n       0xb7fb7a52 <opj_mct_decode+159>:\tmovdqa -0x128(%ebp),%xmm0\r\n       0xb7fb7a5a <opj_mct_decode+167>:\tmovdqa %xmm0,-0xf8(%ebp)\r\n       0xb7fb7a62 <opj_mct_decode+175>:\tmovdqa -0x118(%ebp),%xmm0\r\n    (gdb) p $eax\r\n    $8 = 136187256\r\n    (gdb) p $eax % 16\r\n    $9 = 8\r\n\r\nIf I understand the description of the movdqa instruction correctly, the memory operand must be 16-byte aligned, which is not the case here."}}