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

            Bug ID: 20694
           Summary: memory sanitizer crashes in SDL_Init on
                    __sanitizer::ForEachMappedRegion
           Product: new-bugs
           Version: 3.4
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    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.

http://code.google.com/p/memory-sanitizer/wiki/Running#Running_with_the_dynamic_tool
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

result:

- 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.
OR
- 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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to