mksh ftbfs in quantal

Bug #1058035 reported by Matthias Klose on 2012-09-28
This bug affects 1 person
Affects Status Importance Assigned to Milestone
mksh (Ubuntu)

Bug Description


Build attempt failed.
Build of mksh-full failed.
test -e debian/.build_stamp
make: *** [debian/.build_stamp] Error 1
dpkg-buildpackage: error: debian/rules build gave error exit status 2

Matthias Klose (doko) on 2012-09-28
Changed in mksh (Ubuntu):
importance: Undecided → High
status: New → Confirmed
Thorsten Glaser (mirabilos) wrote :

I’m looking into it (actually, creating a quantal chroot, to do so)…

Thorsten Glaser (mirabilos) wrote :

tags 1058035 + help

Looks to be the same as this:

Here’s a reduced version of the code mksh/ tries to compile:

(pbuild24219)root@tglase-dev:/# cat t.c
#include <stdint.h>
typedef int32_t mksh_ari_t;
char ari_sign_32_bit_and_wrap[(

        (mksh_ari_t)(((((mksh_ari_t)1 << 15) << 15) - 1) * 2 + 1) >
        (mksh_ari_t)(((((mksh_ari_t)1 << 15) << 15) - 1) * 2 + 2)

    ) ? 1 : -1];

int main(void) { return (sizeof(ari_sign_32_bit_and_wrap)); }

And here’s the reduced version of the Xen code in question:

(pbuild24219)root@tglase-dev:/# cat x.c
#include <stdint.h>
typedef uint16_t domid_t;
typedef uint16_t domid_compat_t;
struct grant_entry {
    uint16_t flags;
    domid_t domid;
    uint32_t frame;
struct compat_grant_entry {
    uint16_t flags;
    domid_compat_t domid;
    uint32_t frame;
typedef int __checkFstruct_grant_entry__flags[1 - (&((struct grant_entry *)0)->flags != &((struct compat_grant_entry *)0)->flags) * 2];
int main(void) { return (sizeof(__checkFstruct_grant_entry__flags)); }

On quantal, both emit the same message… but why it is an error in the mksh case, I’ve no idea:

(pbuild24219)root@tglase-dev:/# gcc -fwrapv x.c
x.c:14:99: warning: variably modified '__checkFstruct_grant_entry__flags' at file scope [enabled by default]
(pbuild24219)root@tglase-dev:/# gcc -fwrapv t.c
t.c:6:55: warning: integer overflow in expression [-Woverflow]
t.c:3:6: error: variably modified 'ari_sign_32_bit_and_wrap' at file scope

On wheezy, the Xen one behaves the same, but the problem for mksh does not exist:

root@tglase-dev:~ # gcc -fwrapv x.c
x.c:23:99: warning: variably modified ‘__checkFstruct_grant_entry__flags’ at file scope [enabled by default]
root@tglase-dev:~ # gcc -fwrapv t.c
t.c:6:55: warning: integer overflow in expression [-Woverflow]



The reason behind the code in mksh is that the Build script must (needs to) check that the arithmetic type chosen as “mksh_ari_t” is really exactly 32 bits wide and has a defined wraparound, as mksh guarantees that to scripts running in it.

You might know better than I why this error message suddenly pops up, and then only in Ubuntu’s gcc…

tags: added: help
Thorsten Glaser (mirabilos) wrote :

This affects gcc-4.6 in quantal, too. It’s in /usr/lib/gcc/i686-linux-gnu/4.7/cc1 – just copying that file into a wheezy/i386 cowbuilder let me reproduce the error message there.

Thorsten Glaser (mirabilos) wrote :

Ouch. This also happens with gcc-snapshot 20120915-1 in Debian, so… GCC issue…

I’ll cobble together a workaround.

Thorsten Glaser (mirabilos) wrote :

Please use the package I just uploaded to my PPA:

It syncs with Debian (intended for wheezy):
• For -2:
• For -3:
They are fairly important to have for a stable release.

And it adds a workaround for this bug by moving the tests to run-time.

Thorsten Glaser (mirabilos) wrote :

Fix committed in CVS, fixed package uploaded to my PPA for quantal, ~ubuntu-sponsors subscribed (hence setting Status to New)

Changed in mksh (Ubuntu Quantal):
status: Confirmed → New
Dimitri John Ledkov (xnox) wrote :

While the link to the ppa is nice, it's not something that can be sponsored.
The debdiff against ubuntu has noise in the debian/changelog, it appears that you have dropped all of the past ubuntu changelog entries.
Generally there are two modes of operation:
* debdiff attached to the bug report
* merge proposal into the target branch lp:ubuntu/package (if the branches are up to date)

I did review the launchpad generated diff, but some other sponsors might not. The idea here is that you learn how to generate debdiffs yourself and check to see if they are minimal/sane.

Dimitri John Ledkov (xnox) wrote :

Unsubscribing sponsors for now. Please attach/link an updated debdiff and subscribe sponsors again, or create a branch merge proposal.

Thorsten Glaser (mirabilos) wrote :

Yes well, I did the package as commits in the original Debian packaging
CVS module, so naturally the Ubuntu changes are “on top”. I have no idea
what a branch merge proposal is. You should really accomodate the random
Debian Developer who happens to care about his packages and even tries to
watch Launchpad bugs related to it better, not force some magic ways they
do not know on them. Please find attached a debdiff against the current
Debian version of the package and do with that whatever you must.

And of course it could be sponsored. The Ubuntu diff per sé only exists
because build profiles are not there yet, and the build dependency is
an optional one. So normally you’d do a sync from Debian on each of my
uploads to it, which all are made from that CVS module.

Although I do agree that dpkg-source randomly reordering chunks when
using single-debian-patch is annoying and introduces lots of noise in
that patch. I will file a bugreport against dpkg in Debian for that.
The relevant CVS commits are the following two; I’ve attached diffs
for them too; the first one adds the Ubuntu change, the second one
fixes this problem report. I can make a “cleaned up” debdiff, too,
by manually editing it, I guess…

Commit ID: 10050676B433400B7BD
Module name: contrib
Changes by: <email address hidden> 2012/09/29 21:42:12 UTC

Modified files:
        hosted/tg/deb/mksh/debian: changelog control

Log message:
merge: mksh (40.9.20120630-1ubuntu1) quantal; urgency=low

Commit ID: 10050676F947E588244
Module name: contrib
Changes by: <email address hidden> 2012/09/29 22:00:33 UTC

Modified files:
        hosted/tg/deb/mksh/debian: changelog meat
Added files:
        hosted/tg/deb/mksh/debian: rtchecks

Log message:
move some compile-time checks to run-time (LP#1058035)

Thorsten Glaser (mirabilos) wrote :
Thorsten Glaser (mirabilos) wrote :
Thorsten Glaser (mirabilos) wrote :

The issue of dpkg introducing noise in debdiffs is now #689193
(although that doesn’t affect the changelog issue, but I explained
where that comes from).

Colin Watson (cjwatson) wrote :

I've put the old changelog entries back until such time as the package is entirely in sync, per our policy, and put back the Maintainer change per the policy which Debian collectively requested of us some years back. Other than that I uploaded your patch without further modifications. Thanks!

Dimitri John Ledkov (xnox) wrote :

Unsubscribing sponsors team.

Changed in mksh (Ubuntu Quantal):
status: New → Fix Committed
Matthias Klose (doko) wrote :

fixed in 40.9.20120630-3ubuntu1

Changed in mksh (Ubuntu Quantal):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

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