[LLVMbugs] [Bug 15698] New: Memory corruption bug in clang 3.2

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sun Apr 7 14:38:17 PDT 2013


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

            Bug ID: 15698
           Summary: Memory corruption bug in clang 3.2
           Product: clang
           Version: 3.2
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: tiffany at stormbit.net
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 10317
  --> http://llvm.org/bugs/attachment.cgi?id=10317&action=edit
File from crash report

Steps to reproduce:

1: Download https://raw.github.com/troydhanson/uthash/master/src/uthash.h
2: Try to compile the following:

#include "uthash.h"

struct module {
    UT_hash_handle hh;
} *modules = NULL;

int main()
{
    struct module *mod1, *mod2;
    HASH_REPLACE_STR(modules, hh, mod1, mod2);
}

Output: 
$ clang test.c
test.c:10:35: error: passing 'UT_hash_handle' (aka 'struct UT_hash_handle') to
parameter of incompatible type 'const char *'
*** Error in `/usr/bin/clang': malloc(): memory corruption (fast):
0x0000000002831f40 ***

It produces no crash report in this shorter version. Here is the crash report
from when I discovered it: http://paste.strictfp.com/37342
log-aUMbnp.c is attached
log-aUMbnp.sh: /usr/bin/clang -cc1 -triple x86_64-unknown-linux-gnu -emit-obj
-mrelax-all -disable-free -disable-llvm-verifier -main-file-name log.c
-mrelocation-model pic -pic-level 2 -mdisable-fp-elim -fmath-errno
-masm-verbose -mconstructor-aliases -munwind-tables -fuse-init-array
-target-cpu x86-64 -target-linker-version 2.23.1 -momit-leaf-frame-pointer -g
-D "DEBUG" -D "_POSIX_C_SOURCE=200809" -Wall -pedantic -std=c99 -ferror-limit
19 -fmessage-length 134 -pthread -mstackrealign -fobjc-runtime=gcc
-fdiagnostics-show-option -x c log-aUMbnp.c

$ clang -v
clang version 3.2 (tags/RELEASE_32/final)
Target: x86_64-unknown-linux-gnu
Thread model: posix
$ uname -a
Linux arch 3.8.4-1-ARCH #1 SMP PREEMPT Wed Mar 20 22:10:25 CET 2013 x86_64
GNU/Linux

-- 
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/20130407/1ff6d991/attachment.html>


More information about the llvm-bugs mailing list