[LLVMbugs] [Bug 20694] New: memory sanitizer crashes in SDL_Init on __sanitizer::ForEachMappedRegion

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Aug 18 04:16:09 PDT 2014


            Bug ID: 20694
           Summary: memory sanitizer crashes in SDL_Init on
           Product: new-bugs
           Version: 3.4
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: nido at foxserver.be
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

when i compile http://pastebin.com/BDbd9KRw (basically just calling
SDL_Init(SDL_INIT_VIDEO);) with -fsanitize=memory results in a              
crash/hang on fedora 20.

seems to suggest that I may need to compile the SDL library with memory
sanitiser support for this to work properly. If this is the case, it may be
prudent to do a check/warning for this on dlopen; much like how it warns about
running the memory sanitizer in GDB without turning off disabling ASLR.

clang version reports 'clang version 3.4 (tags/RELEASE_34/final)'. 

to reproduce:
1: install fedora20 (optional, though it would probably fail differently on
different distros)
2: put pastebin code in test.cpp
3: run clang++ -fsanitize=memory test.cpp -lSDL2 -I/usr/include/SDL2/ -o test
4: run ./test


- run top and observe 'test' ruinning at 50% cpu usage and 'abrt-hook-ccpp'
(fedora seems to catch segfaults or something) at 100% usage, as opposed to the
program exiting almost instantly when compiled without memory sanitizer.

- Running it in gdb reveals it stops on on 
0x00007f2d18900076 in __sanitizer::ForEachMappedRegion(link_map*, void (*)(void
const*, unsigned long)) () after dlopen()
full gdb trace is at http://pastebin.com/wbntabtx

expected result:
- the program runs normally and reports problems with allocated memory.
- The program runs normally up to dlopen, when it informs me that I need to
compile said linked library with memory sanitation as well

You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20140818/558f61c3/attachment.html>

More information about the llvm-bugs mailing list