mmpong version 0.9.1-1 failed to build on amd64 with GCC-4.6/oneiric

Bug #771087 reported by Matthias Klose
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
gcc
Fix Released
Medium
gcc-4.6 (Ubuntu)
Fix Released
Undecided
Unassigned
Oneiric
Won't Fix
Undecided
Unassigned
mmpong (Debian)
Fix Released
Unknown
mmpong (Ubuntu)
Fix Released
High
Unassigned
Oneiric
Fix Released
High
Unassigned

Bug Description

mmpong version 0.9.1-1 failed to build on amd64 with GCC-4.6/oneiric
Link to failed build: https://launchpad.net/ubuntu/+archive/test-rebuild-20110413/+buildjob/2462263

Details about the rebuild:
https://lists.ubuntu.com/archives/ubuntu-devel/2011-April/033042.html

Direct link to the build log: https://launchpad.net/ubuntu/+archive/test-rebuild-20110413/+buildjob/2462263/+files/buildlog_ubuntu-natty-amd64.mmpong_0.9.1-1_FAILEDTOBUILD.txt.gz

This log snippet might be of interest, since it triggered the matcher 'Purging chroot-autobuild'.
Excerpt 1121 lines into the build log:

/build/buildd/mmpong-0.9.1/lib/message.c:65:2: error: (near initialization for 'byte_order[9].offset')
/build/buildd/mmpong-0.9.1/lib/message.c:67:2: error: initializer element is not computable at load time
/build/buildd/mmpong-0.9.1/lib/message.c:67:2: error: (near initialization for 'byte_order[11].offset')
/build/buildd/mmpong-0.9.1/lib/message.c:90:2: error: initializer element is not computable at load time
/build/buildd/mmpong-0.9.1/lib/message.c:90:2: error: (near initialization for 'byte_order[32].offset')
/build/buildd/mmpong-0.9.1/lib/message.c:92:2: error: initializer element is not computable at load time
/build/buildd/mmpong-0.9.1/lib/message.c:92:2: error: (near initialization for 'byte_order[34].offset')
make[3]: *** [lib/CMakeFiles/libmmpong.dir/message.o] Error 1
make[3]: Leaving directory `/build/buildd/mmpong-0.9.1/obj-x86_64-linux-gnu'
make[2]: *** [lib/CMakeFiles/libmmpong.dir/all] Error 2
make[2]: Leaving directory `/build/buildd/mmpong-0.9.1/obj-x86_64-linux-gnu'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/build/buildd/mmpong-0.9.1/obj-x86_64-linux-gnu'
make: *** [debian/stamp-makefile-build] Error 2
dpkg-buildpackage: error: debian/rules build gave error exit status 2
******************************************************************************
Build finished at 20110424-1640
FAILED [dpkg-buildpackage died]
Purging chroot-autobuild/build/buildd/mmpong-0.9.1

Related branches

Matthias Klose (doko)
Changed in mmpong (Ubuntu):
importance: Undecided → High
Changed in mmpong (Debian):
status: Unknown → New
Changed in mmpong (Ubuntu):
milestone: none → oneiric-alpha-3
Changed in mmpong (Ubuntu Oneiric):
milestone: oneiric-alpha-3 → none
status: New → Confirmed
tags: added: universe
Changed in mmpong (Debian):
status: New → Fix Released
Revision history for this message
Matthias Klose (doko) wrote :
Colin Watson (cjwatson)
Changed in mmpong (Debian):
status: Fix Released → Unknown
Changed in mmpong (Debian):
status: Unknown → New
Revision history for this message
In , Doko-v (doko-v) wrote :

Created attachment 25379
preprocessed source

[forwarded from http://bugs.debian.org/642144]

this may be a duplicate of PR38354, compiles on 32bit targets, on 64bit targets it succeeds with 4.4, but fails with 4.5, 4.6 and trunk:

$ gcc -c message.i
message.i:154:2: error: initializer element is not computable at load time
message.i:154:2: error: (near initialization for 'byte_order[1].offset')

Changed in gcc:
importance: Unknown → Medium
status: Unknown → New
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package mmpong - 0.9.1-1ubuntu1

---------------
mmpong (0.9.1-1ubuntu1) oneiric; urgency=low

  * Build using g++-4.4 on amd64. LP: #771087.
 -- Matthias Klose <email address hidden> Thu, 29 Sep 2011 12:24:31 +0200

Changed in mmpong (Ubuntu Oneiric):
status: Confirmed → Fix Released
Revision history for this message
In , Pinskia (pinskia) wrote :

Anyreason Why "((int)( ((void *)&(nmsgbuf.payload.part.ball.pos[0])) - ((void *)&(nmsgbuf)) ))" is being used instead of offsetof ?

Revision history for this message
In , Mikpe (mikpe) wrote :

This test case started being rejected with r145254:
http://gcc.gnu.org/ml/gcc-cvs/2009-03/msg00761.html

Revision history for this message
In , Mikpe (mikpe) wrote :

Created attachment 25393
reduced test case

> cat pr50565.c
/* pr50565.c */
struct netmessage {
    unsigned char pos[2];
};
static struct netmessage nmsgbuf;
const int offset0 = (int)((void*)&nmsgbuf.pos[0] - (void*)&nmsgbuf) + 0*(1U);
const int offset1 = (int)((void*)&nmsgbuf.pos[0] - (void*)&nmsgbuf) + 1*(1U);
> objdir/gcc/xgcc -Bobjdir/gcc/ -O2 -S pr50565.c
pr50565.c:7: error: initializer element is not computable at load time

That's the offset1 initializer it's complaining about. Note that the offset0 initializer is accepted. If we comment out the offset1 definition we get:

> perl -pi -e 's,^const int offset1,//const int offset1,g' pr50565.c
> objdir/gcc/xgcc -Bobjdir/gcc/ -O2 -S pr50565.c
> cat pr50565.s
        .file "pr50565.c"
.globl offset0
        .section .rodata
        .align 4
        .type offset0, @object
        .size offset0, 4
offset0:
        .long 0
        .local nmsgbuf
        .comm nmsgbuf,2,1
        .ident "GCC: (GNU) 4.5.0 20090329 (experimental)"
        .section .note.GNU-stack,"",@progbits

The common offsetof emulation is clearly computable at compile-time, so one would expect the same + 1 to also be computable at compile-time, but gcc doesn't seem to think so.

Revision history for this message
In , Jsm28 (jsm28) wrote :
Revision history for this message
In , Jsm28 (jsm28) wrote :

Author: jsm28
Date: Wed Oct 12 11:56:03 2011
New Revision: 179845

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=179845
Log:
 PR c/50565
 * convert.c (convert_to_integer): Do not narrow operands of
 pointer subtraction.

testsuite:
 * gcc.c-torture/compile/pr50565-1.c,
 gcc.c-torture/compile/pr50565-2.c: New tests.

Added:
    trunk/gcc/testsuite/gcc.c-torture/compile/pr50565-1.c
    trunk/gcc/testsuite/gcc.c-torture/compile/pr50565-2.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/convert.c
    trunk/gcc/testsuite/ChangeLog

Revision history for this message
In , Jsm28 (jsm28) wrote :

Author: jsm28
Date: Wed Oct 12 11:57:36 2011
New Revision: 179846

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=179846
Log:
 PR c/50565
 * convert.c (convert_to_integer): Do not narrow operands of
 pointer subtraction.

testsuite:
 * gcc.c-torture/compile/pr50565-1.c,
 gcc.c-torture/compile/pr50565-2.c: New tests.

Added:
    branches/gcc-4_6-branch/gcc/testsuite/gcc.c-torture/compile/pr50565-1.c
    branches/gcc-4_6-branch/gcc/testsuite/gcc.c-torture/compile/pr50565-2.c
Modified:
    branches/gcc-4_6-branch/gcc/ChangeLog
    branches/gcc-4_6-branch/gcc/convert.c
    branches/gcc-4_6-branch/gcc/testsuite/ChangeLog

Revision history for this message
In , Jsm28 (jsm28) wrote :

Author: jsm28
Date: Wed Oct 12 11:58:47 2011
New Revision: 179847

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=179847
Log:
 PR c/50565
 * convert.c (convert_to_integer): Do not narrow operands of
 pointer subtraction.

testsuite:
 * gcc.c-torture/compile/pr50565-1.c,
 gcc.c-torture/compile/pr50565-2.c: New tests.

Added:
    branches/gcc-4_5-branch/gcc/testsuite/gcc.c-torture/compile/pr50565-1.c
    branches/gcc-4_5-branch/gcc/testsuite/gcc.c-torture/compile/pr50565-2.c
Modified:
    branches/gcc-4_5-branch/gcc/ChangeLog
    branches/gcc-4_5-branch/gcc/convert.c
    branches/gcc-4_5-branch/gcc/testsuite/ChangeLog

Revision history for this message
In , Jsm28 (jsm28) wrote :

Fixed for 4.5.4, 4.6.2, 4.7.

Changed in gcc:
status: New → Fix Released
Revision history for this message
Matthias Klose (doko) wrote :

fixed in precise

Changed in gcc-4.6 (Ubuntu):
status: New → Fix Released
Changed in gcc-4.6 (Ubuntu Oneiric):
status: New → Won't Fix
Changed in mmpong (Debian):
status: New → Fix Released
Changed in mmpong (Debian):
status: Fix Released → New
Changed in mmpong (Debian):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.