[llvm-bugs] [Bug 28907] New: snprintf wrapper crash in dfsan during compilation

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Aug 8 13:42:10 PDT 2016


https://llvm.org/bugs/show_bug.cgi?id=28907

            Bug ID: 28907
           Summary: snprintf wrapper crash in dfsan during compilation
           Product: compiler-rt
           Version: 3.9
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: compiler-rt
          Assignee: unassignedbugs at nondot.org
          Reporter: martin_rataj at hotmail.cz
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

Created attachment 16913
  --> https://llvm.org/bugs/attachment.cgi?id=16913&action=edit
preprocessed source

Compilation of a redis, hiredis, with dfsan crashes on the snprintf wrapper
with the following message:

Wrong types for attribute: byval inalloca nest noalias nocapture nonnull
readnone readonly sret dereferenceable(1) dereferenceable_or_null(1)
call i32 (i8*, i64, i8*, i16, i16, i16, i16*, i16*, ...) @__dfsw_snprintf(i8*
%32, i64 128, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0,
i64 0), i16 nonnull 0, i16 0, i16 0, i16* %35, i16* %labelreturn, i8*
getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0)) #7, !dbg
!259
fatal error: error in backend: Broken function found, compilation aborted!

The run script:
# Crash reproducer for clang version 3.9.0 (trunk 271217)
# Driver args: "-std=c99" "-pedantic" "-c" "-O3" "-fPIC" "-fsanitize=dataflow"
"-O2" "-g" "-Wall" "-W" "-pedantic" "-Wall" "-W" "-Wstrict-prototypes"
"-Wwrite-strings" "-g" "-ggdb" "net.c"
# Original command:  "$(LLVM_DIR)/build/bin/clang-3.9" "-cc1" "-triple"
"x86_64-unknown-linux-gnu" "-emit-obj" "-disable-free" "-main-file-name"
"net.c" "-mrelocation-model" "pic" "-pic-level" "2" "-mthread-model" "posix"
"-fmath-errno" "-masm-verbose" "-mconstructor-aliases" "-munwind-tables"
"-fuse-init-array" "-target-cpu" "x86-64" "-momit-leaf-frame-pointer"
"-dwarf-column-info" "-debug-info-kind=limited" "-dwarf-version=4"
"-debugger-tuning=gdb" "-coverage-file" "$(REDIS_DIR)/deps/hiredis/net.c"
"-resource-dir" "$(LLVM_DIR)/build/bin/../lib/clang/3.9.0" "-internal-isystem"
"/usr/local/include" "-internal-isystem"
"$(LLVM_DIR)/build/bin/../lib/clang/3.9.0/include" "-internal-externc-isystem"
"/usr/include/x86_64-linux-gnu" "-internal-externc-isystem" "/include"
"-internal-externc-isystem" "/usr/include" "-O2" "-Wall" "-W" "-Wall" "-W"
"-Wstrict-prototypes" "-Wwrite-strings" "-pedantic" "-std=c99"
"-fconst-strings" "-fdebug-compilation-dir" "$(REDIS_DIR)/deps/hiredis"
"-ferror-limit" "19" "-fmessage-length" "110" "-fsanitize=dataflow"
"-fsanitize-blacklist=$(LLVM_DIR)/build/bin/../lib/clang/3.9.0/dfsan_abilist.txt"
"-fobjc-runtime=gcc" "-fdiagnostics-show-option" "-fcolor-diagnostics"
"-vectorize-loops" "-vectorize-slp" "-o" "net.o" "-x" "c" "net.c"
 "$(LLVM_DIR)/build/bin/clang-3.9" "-cc1" "-triple" "x86_64-unknown-linux-gnu"
"-emit-obj" "-disable-free" "-main-file-name" "net.c" "-mrelocation-model"
"pic" "-pic-level" "2" "-mthread-model" "posix" "-fmath-errno" "-masm-verbose"
"-mconstructor-aliases" "-munwind-tables" "-fuse-init-array" "-target-cpu"
"x86-64" "-momit-leaf-frame-pointer" "-dwarf-column-info"
"-debug-info-kind=limited" "-dwarf-version=4" "-debugger-tuning=gdb" "-O2"
"-Wall" "-W" "-Wall" "-W" "-Wstrict-prototypes" "-Wwrite-strings" "-pedantic"
"-std=c99" "-fconst-strings" "-ferror-limit" "19" "-fmessage-length" "110"
"-fsanitize=dataflow"
"-fsanitize-blacklist=$(LLVM_DIR)/build/bin/../lib/clang/3.9.0/dfsan_abilist.txt"
"-fobjc-runtime=gcc" "-fdiagnostics-show-option" "-fcolor-diagnostics"
"-vectorize-loops" "-vectorize-slp" "-x" "c" "net-a4fdf1.c"

-- 
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/20160808/a3d92478/attachment-0001.html>


More information about the llvm-bugs mailing list