kompozer version 1:0.8~b3.dfsg.1-0.1 failed to build on amd64 with GCC-4.6/oneiric

Bug #770836 reported by Matthias Klose
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
kompozer (Debian)
Fix Released
Unknown
kompozer (Ubuntu)
Fix Released
High
Unassigned
Oneiric
Fix Released
High
Unassigned

Bug Description

kompozer version 1:0.8~b3.dfsg.1-0.1 failed to build on amd64 with GCC-4.6/oneiric
Link to failed build: https://launchpad.net/ubuntu/+archive/test-rebuild-20110413/+buildjob/2454691

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/2454691/+files/buildlog_ubuntu-natty-amd64.kompozer_1%3A0.8%7Eb3.dfsg.1-0.1_FAILEDTOBUILD.txt.gz

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

../../dist/include/unicharutil/nsUnicharUtils.h:63:7: note: 'const class nsCaseInsensitiveStringComparator' has no user-provided default constructor
/build/buildd/kompozer-0.8~b3.dfsg.1/mozilla/layout/style/nsCSSStyleSheet.cpp: In function 'PRBool SelectorMatches(RuleProcessorData&, nsCSSSelector*, PRInt32, nsIAtom*, PRInt8)':
/build/buildd/kompozer-0.8~b3.dfsg.1/mozilla/layout/style/nsCSSStyleSheet.cpp:3346:58: warning: conversion to 'PRInt8' from 'int' may alter its value [-Wconversion]
make[5]: *** [nsCSSStyleSheet.o] Error 1
make[5]: Leaving directory `/build/buildd/kompozer-0.8~b3.dfsg.1/obj-kompozer/layout/style'
make[4]: *** [libs] Error 2
make[4]: Leaving directory `/build/buildd/kompozer-0.8~b3.dfsg.1/obj-kompozer/layout'
make[3]: *** [tier_9] Error 2
make[3]: Leaving directory `/build/buildd/kompozer-0.8~b3.dfsg.1/obj-kompozer'
make[2]: *** [default] Error 2
make[2]: Leaving directory `/build/buildd/kompozer-0.8~b3.dfsg.1/obj-kompozer'
make[1]: *** [build] Error 2
make[1]: Leaving directory `/build/buildd/kompozer-0.8~b3.dfsg.1/mozilla'
make: *** [build-stamp] Error 2
dpkg-buildpackage: error: debian/rules build gave error exit status 2
******************************************************************************
Build finished at 20110423-2256
FAILED [dpkg-buildpackage died]
Purging chroot-autobuild/build/buildd/kompozer-0.8~b3.dfsg.1

Related branches

Matthias Klose (doko)
Changed in kompozer (Ubuntu):
importance: Undecided → High
Changed in kompozer (Ubuntu):
milestone: none → oneiric-alpha-3
Changed in kompozer (Ubuntu Oneiric):
milestone: oneiric-alpha-3 → none
status: New → Confirmed
tags: added: universe
Revision history for this message
Kevin M. Buckley (kevin-m-buckley) wrote :

I don't pretend to understand the actual C++ issue here but the build log snippet
that was posted misses something that might help solve the problem, vis, the two
lines above the snippet which detail the actual error and where the compiler suggests
how to avoid it

/build/buildd/kompozer-0.8~b3.dfsg.1/mozilla/layout/style/nsCSSStyleSheet.cpp: In function 'PRBool AttrMatchesValue(const nsAttrSelector*, const nsString&)':
/build/buildd/kompozer-0.8~b3.dfsg.1/mozilla/layout/style/nsCSSStyleSheet.cpp:2897:43: error: uninitialized const 'ciComparator' [-fpermissive]
../../dist/include/unicharutil/nsUnicharUtils.h:63:7: note: 'const class nsCaseInsensitiveStringComparator' has no user-provided default constructor

For reasons I won't go into here I came to build FireFox2 (yes, 2!) and have seen the same error and
then found this thread whilst looking for an answer.

The lines of relevant code in nsCSSStyleSheet.cpp are these

...
  const nsDefaultStringComparator defaultComparator;
  const nsCaseInsensitiveStringComparator ciComparator;
  const nsStringComparator& comparator = aAttrSelector->mCaseSensitive
                ? NS_STATIC_CAST(const nsStringComparator&, defaultComparator)
                : NS_STATIC_CAST(const nsStringComparator&, ciComparator);
...

but note that there's only one place where the variable for which the declaration
is causing the error, ciComparator, is used.

Elsewhere in the firefox codebase, you don't see declarations such as the above
but you do see a "default constructor" referred to, vis:

nsCaseInsensitiveStringComparator()

I therefore modified nsCSSStyleSheet.cpp to just use the default constructor in place
and not declare the "intermediate" variable.

  const nsDefaultStringComparator defaultComparator;
  const nsStringComparator& comparator = aAttrSelector->mCaseSensitive
                ? NS_STATIC_CAST(const nsStringComparator&, defaultComparator)
                : NS_STATIC_CAST(const nsStringComparator&, nsCaseInsensitiveStringComparator() );

This at least allows nsCSSStyleSheet.cpp to compile.

I also ran the compile of that individual source file using -fpermissive and that "defeats"
the error too.

As I say, it may not be the correct/complete solution, but maybe the info will help point
someone else to it.

Revision history for this message
Kevin M. Buckley (kevin-m-buckley) wrote :

Bit more on this,

the section

C++ FE
error: uninitialized const 'd' [-fpermissive], note: 'const class D' has no user-provided default constructor

at

http://gcc.gnu.org/wiki/VerboseDiagnostics

suggests that

  const nsCaseInsensitiveStringComparator ciComparator;

merely needs to be fixed by writing:

  const nsCaseInsensitiveStringComparator ciComparator = nsCaseInsensitiveStringComparator();

Changed in kompozer (Debian):
status: Unknown → New
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package kompozer - 1:0.8~b3.dfsg.1-0.1ubuntu1

---------------
kompozer (1:0.8~b3.dfsg.1-0.1ubuntu1) oneiric; urgency=low

  * Add 25_uninitialized_const.patch to fix FTBFS. (LP: #770836)
    (Closes: #624923)
  * Refresh 99_configure.patch to handle new multiarch lib path.
 -- Daniel T Chen <email address hidden> Tue, 20 Sep 2011 17:16:43 -0400

Changed in kompozer (Ubuntu Oneiric):
status: Confirmed → Fix Released
Changed in kompozer (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.