Skip to content

clang miscompilation #4045

@pwo

Description

@pwo
Bugzilla Link 3673
Resolution FIXED
Resolved on Mar 12, 2010 00:55
Version unspecified
OS FreeBSD
Attachments diff of .s files

Extended Description

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzillaclang:frontendLanguage frontend issues, e.g. anything involving "Sema"

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions