[LLVMbugs] [Bug 11366] New: Clang and llvm-gcc compile infinite loop into avoffset from smake & cdrecord projects

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sun Nov 13 09:19:43 PST 2011


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

             Bug #: 11366
           Summary: Clang and llvm-gcc compile infinite loop into avoffset
                    from smake & cdrecord projects
           Product: clang
           Version: unspecified
          Platform: Macintosh
        OS/Version: MacOS X
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: -New Bugs
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: lambda at continuation.org
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


When upgrading to Mac OS X Lion, and updating all of my MacPorts afterwards, I
hit an infinite loop in the avoffset utility used in the build process of smake
and cdrecord.

It turns out that many other people have hit this issue, and it appears to be
related to compiling avoffset with clang or llvm-gcc. See the following
MacPorts bug for more details: https://trac.macports.org/ticket/30310 . I
searched the llvm bugzilla, but couldn't find any mention of this bug, so I
figured I'd push this report upstream; I haven't done any further investigation
beyond what is in the MacPorts bug.

Quoting from jhiesey from the MacPorts bug:

I have been having this problem (avoffset hangs during smake build) on Snow
Leopard with XCode 4.0.2 as well as on Lion with XCode 4.1.

I attached gdb to the hung avoffset process, and from this it looks like
avoffset.c is being miscompiled. The loop to scan the stack looks like this:

    while (fp->fr_savfp) {
        if (fp->fr_savpc == 0)
            break;

        fp = (struct frame *)fp->fr_savfp;

        i++;
    }

but the compiler generates a wrong jump at the top of the loop, causing it to
just loop forever on that line:

0x000000010ace3ab0 <main+304>:    jmp    0x10ace3ab0 <main+304>

This looks like a backend bug in llvm to me. Compiling with gcc-4.2 works,
while clang and llvm-gcc-4.2 both fail.

Since I've never submitted a patch for MacPorts before (or even posted on a
ticket), I think I'll let someone else submit a patch for the portfile.

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