[LLVMbugs] [Bug 8898] New: dragonegg bug: nondeterministic wrong code

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Jan 3 19:39:17 PST 2011


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

           Summary: dragonegg bug: nondeterministic wrong 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


The correct answer is 1.  No idea what's going on, perhaps memory unsafety +
ASLR.  GCC-4.5, dragonegg, and LLVM are all from today.

[regehr at gamow tmp440]$ gcc-4.5
-fplugin=/home/regehr/z/compiler-source/dragonegg/dragonegg.so -O0 small.c -o
small
[regehr at gamow tmp440]$ ./small
g_321[1].f0 = 252
[regehr at gamow tmp440]$ gcc-4.5
-fplugin=/home/regehr/z/compiler-source/dragonegg/dragonegg.so -O0 small.c -o
small
[regehr at gamow tmp440]$ ./small
g_321[1].f0 = 235
[regehr at gamow tmp440]$ gcc-4.5
-fplugin=/home/regehr/z/compiler-source/dragonegg/dragonegg.so -O0 small.c -o
small
[regehr at gamow tmp440]$ ./small
g_321[1].f0 = 156
[regehr at gamow tmp440]$ clang -O0 small.c -o small[regehr at gamow tmp440]$ ./small
g_321[1].f0 = 1
[regehr at gamow tmp440]$ gcc-4.5
-fplugin=/home/regehr/z/compiler-source/dragonegg/dragonegg.so -v               
Using built-in specs.
COLLECT_GCC=gcc-4.5
COLLECT_LTO_WRAPPER=/uusoc/exports/scratch/regehr/z/bin/../libexec/gcc/x86_64-unknown-linux-gnu/4.5.3/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../configure --prefix=/home/regehr/z --enable-languages=c,c++
--program-suffix=-4.5 --enable-plugin --enable-lto
Thread model: posix
gcc version 4.5.3 20110103 (prerelease) (GCC) 
[regehr at gamow tmp440]$ cat small.c
#pragma pack(push)
#pragma pack(1)
struct S1 {
  int f0 : 23;
};
#pragma pack(pop)

static struct S1 g_36 = {0};
static struct S1 g_321[2] = {{1}, {1}};

static struct S1 func_31(void)
{
  return g_36;
}

int printf(const char *format, ...);

int main (void)
{
  g_321[0] = func_31();
  printf("g_321[1].f0 = %d\n", g_321[1].f0);
  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