[LLVMbugs] [Bug 9346] New: likely memory unsafety error in generated code
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Mon Feb 28 13:50:04 PST 2011
http://llvm.org/bugs/show_bug.cgi?id=9346
Summary: likely memory unsafety error in generated code
Product: new-bugs
Version: trunk
Platform: PC
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P
Component: new bugs
AssignedTo: unassignedbugs at nondot.org
ReportedBy: regehr at cs.utah.edu
CC: llvmbugs at cs.uiuc.edu, chenyang at cs.utah.edu
Notice that (due to ASLR or whatever) two runs of the same executable give
different answers. The correct answer is "0".
[regehr at gamow ~]$ clang -v
clang version 2.9 (trunk 126682)
Target: x86_64-unknown-linux-gnu
Thread model: posix
[regehr at gamow ~]$ clang -O2 foo.c -o foo
[regehr at gamow ~]$ ./foo
g_1 = 107756488
[regehr at gamow ~]$ ./foo
g_1 = 1634447976
[regehr at gamow ~]$ cat foo.c
long long g_4 = 0;
static int g_1 = 0;
int printf(const char *format, ...);
static int foo(int i1, int i2)
{
return (i1 % i2);
}
int main (int argc, char* argv[])
{
foo(1, 1);
g_1 = foo((g_4 | -2), -1);
printf("g_1 = %d\n", g_1);
return 0;
}
--
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