[LLVMbugs] [Bug 12250] New: unaligned SSE memory access

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Mar 12 05:09:46 PDT 2012


http://llvm.org/bugs/show_bug.cgi?id=12250

             Bug #: 12250
           Summary: unaligned SSE memory access
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Solaris
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: sbn at tbricks.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


When building clang using clang with libc++ on Solaris 10 llvm-tblgen utility
crashes due to invalid alignment in SSE memory access.

$ ./build-clang-libcxx/Release/bin/llvm-tblgen 
Stack dump:
0.      Program arguments: ./build-clang-libcxx/Release/bin/llvm-tblgen 
Segmentation Fault (core dumped)

$ pstack /cores/llvm-tblgen.11282 |c++filt
core '/cores/llvm-tblgen.11282' of 11282:      
./build-clang-libcxx/Release/bin/llvm-tblgen
 081a918a llvm::cl::ParseCommandLineOptions(int, const char* const*, const
char* const, bool) (1, 8047960, 804791c, 804791c, 80479e8, feffb910) + 6a
 00000000 ???????? (81bf0e0, 0, feeb1388, 81cd960, 81fff88, 0)
 08162ee0 ???????? (8c357, 2a0808b, e0ff0000, 90909090, 90909090, 90909090)
 c0815800 ???????? ()

$ dbx /export/home/sbn/src/build-clang-libcxx/Release/bin/llvm-tblgen
...
(dbx) stop in ParseCommandLineOptions
dbx: warning: 'ParseCommandLineOptions' has no debugger info -- will trigger on
first instruction
(2) stop in llvm::cl::ParseCommandLineOptions(int, const char* const*, const
char* const, bool)
(dbx) run
Running: llvm-tblgen
(process id 15438)
t at 1 (l at 1) stopped in llvm::cl::ParseCommandLineOptions at 0x081a8f40
0x081a8f40: ParseCommandLineOptions       :     pushl    %ebp
(dbx) print -flx $esp
dbx: warning: unknown language, 'c' assumed
$esp = 0x8047870
(dbx) dis ParseCommandLineOptions
0x081a8f40: ParseCommandLineOptions       :     pushl    %ebp
0x081a8f41: ParseCommandLineOptions+0x0001:     pushl    %ebx
0x081a8f42: ParseCommandLineOptions+0x0002:     pushl    %edi
0x081a8f43: ParseCommandLineOptions+0x0003:     pushl    %esi
0x081a8f44: ParseCommandLineOptions+0x0004:     subl     $0x0000034c,%esp
0x081a8f4a: ParseCommandLineOptions+0x000a:     call    
ParseCommandLineOptions+0xf    [ 0x81a8f4f, .+5 ]
0x081a8f4f: ParseCommandLineOptions+0x000f:     popl     %edi
0x081a8f50: ParseCommandLineOptions+0x0010:     addl     $0x00045b6d,%edi
0x081a8f56: ParseCommandLineOptions+0x0016:     leal     0x0000019c(%esp),%eax
0x081a8f5d: ParseCommandLineOptions+0x001d:     movl     %eax,0x00000190(%esp)
(dbx) dis
0x081a8f64: ParseCommandLineOptions+0x0024:     movl     %eax,0x00000194(%esp)
0x081a8f6b: ParseCommandLineOptions+0x002b:     leal     0x000001b4(%esp),%eax
0x081a8f72: ParseCommandLineOptions+0x0032:     movl     %eax,0x00000198(%esp)
0x081a8f79: ParseCommandLineOptions+0x0039:     leal     0x00000174(%esp),%eax
0x081a8f80: ParseCommandLineOptions+0x0040:     movl     %eax,0x00000168(%esp)
0x081a8f87: ParseCommandLineOptions+0x0047:     movl     %eax,0x0000016c(%esp)
0x081a8f8e: ParseCommandLineOptions+0x004e:     leal     0x0000018c(%esp),%eax
0x081a8f95: ParseCommandLineOptions+0x0055:     movl     %eax,0x00000170(%esp)
0x081a8f9c: ParseCommandLineOptions+0x005c:     movl    
$0x00000008,0x00000160(%esp)
0x081a8fa7: ParseCommandLineOptions+0x0067:     xorps    %xmm0,%xmm0
(dbx) dis
0x081a8faa: ParseCommandLineOptions+0x006a:     movaps   %xmm0,0x00000150(%esp)
...

0x00000150(%esp) -- is not aligned on 16 byte.

AFAIU it's
0x081a8f44: ParseCommandLineOptions+0x0004:     subl     $0x0000034c,%esp
that breaks the alignment.

Command line used for compilation of CommandLine.cpp:

llvm[1]: Compiling CommandLine.cpp for Release build
if  /export/home/sbn/src/build-clang/Release/bin/clang++ -D_WCHAR_T
-I/export/home/sbn/src/build-clang-libcxx/include
-I/export/home/sbn/src/build-clang-libcxx/lib/Support
-I/export/home/sbn/src/llvm/include -I/export/home/sbn/src/llvm/lib/Support 
-DNDEBUG -include llvm/Support/Solaris.h -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS
-D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -O3 -fomit-frame-pointer
-stdlib=libc++ -fvisibility-inlines-hidden -fno-exceptions -fPIC
-Woverloaded-virtual -Wcast-qual    -Wall -W -Wno-unused-parameter
-Wwrite-strings -Wcovered-switch-default -c -MMD -MP -MF
"/export/home/sbn/src/build-clang-libcxx/lib/Support/Release/CommandLine.d.tmp"
-MT "/export/home/sbn/src/build-clang-libcxx/lib/Support/Release/CommandLine.o"
-MT "/export/home/sbn/src/build-clang-libcxx/lib/Support/Release/CommandLine.d"
/export/home/sbn/src/llvm/lib/Support/CommandLine.cpp -o
/export/home/sbn/src/build-clang-libcxx/lib/Support/Release/CommandLine.o ; \
                then /usr/xpg4/bin/mv -f
"/export/home/sbn/src/build-clang-libcxx/lib/Support/Release/CommandLine.d.tmp"
"/export/home/sbn/src/build-clang-libcxx/lib/Support/Release/CommandLine.d";
else /usr/xpg4/bin/rm
"/export/home/sbn/src/build-clang-libcxx/lib/Support/Release/CommandLine.d.tmp";
exit 1; fi

$ /export/home/sbn/src/build-clang/Release/bin/clang++ -v
clang version 3.1 (trunk 152548)
Target: i386-pc-solaris2.10
Thread model: posix

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list