[LLVMbugs] [Bug 3673] New: clang miscompilation

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Thu Feb 26 06:51:33 PST 2009


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

           Summary: clang miscompilation
           Product: clang
           Version: unspecified
          Platform: PC
        OS/Version: FreeBSD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Basic
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: pawel.worach at gmail.com
                CC: llvmbugs at cs.uiuc.edu


Created an attachment (id=2612)
 --> (http://llvm.org/bugs/attachment.cgi?id=2612)
diff of .s files

The following program SEGV's when built with clang, llvm-gcc and gcc work fine.

#include <db.h>
#include <fcntl.h>
#include <stdio.h>

static DB *symtable;

int
main(void)
{
        printf("dbopen()\n");
        symtable = dbopen(/*filename*/NULL,
                          O_CREAT | O_NONBLOCK | O_RDWR, /*mode*/0, DB_HASH,
                          /*openinfo*/NULL);
        printf("after dbopen()\n");
}

(gdb) break main
Breakpoint 1 at 0x4005c8: file t.c, line 10.
(gdb) run
Starting program: /tmp/t

Breakpoint 1, main () at t.c:10
10              printf("dbopen()\n");
(gdb) step
dbopen()
11              symtable = dbopen(/*filename*/NULL,
(gdb)

Program received signal SIGSEGV, Segmentation fault.
0x00000008007152fc in __bt_open () from /lib/libc.so.7


-- 
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