Issue 77664 - MacOSX : build fails at i18npool/source/localedata/data conditionally
Summary: MacOSX : build fails at i18npool/source/localedata/data conditionally
Status: CLOSED DUPLICATE of issue 96647
Alias: None
Product: udk
Classification: Code
Component: code (show other issues)
Version: 680m212
Hardware: All Unix, all
: P3 Trivial (vote)
Target Milestone: ---
Assignee: kay.ramme
QA Contact: issues@udk
URL:
Keywords: oooqa
: 79308 (view as issue list)
Depends on:
Blocks:
 
Reported: 2007-05-22 05:08 UTC by maho.nakata
Modified: 2008-12-06 20:14 UTC (History)
5 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
gdb generated backtrace (8.15 KB, text/plain)
2007-08-09 20:06 UTC, lohmaier
no flags Details
valgrind log - not sure whether this helps or not (all on m225) (13.93 KB, text/plain)
2007-08-09 20:11 UTC, lohmaier
no flags Details
valgrind log with --leak-check=full (16.26 KB, text/plain)
2007-08-13 14:50 UTC, lohmaier
no flags Details
valgrind log with --leak-check=full --show-reachable=yes (64.90 KB, text/plain)
2007-08-13 14:52 UTC, lohmaier
no flags Details
a crashreport that apples crashreporttool creates (16.06 KB, text/plain)
2007-08-22 18:21 UTC, lohmaier
no flags Details
Patch for bridges cppinterfaceproxy to not use __attribute__((constructor)) etc in case of gcc 3.3, but to export dso_init / dso_exit as C functions ... (883 bytes, patch)
2007-08-23 11:54 UTC, kay.ramme
no flags Details | Diff
Patch for bridges ... makefile.mk to build (and link) gpp33wad.c in case of GCC (362 bytes, patch)
2007-08-23 11:57 UTC, kay.ramme
no flags Details | Diff
Workaround for G++ 3.3 not calling __attribute__((constructor)) etc. for dso_init/-exit; to be placed into bridges/source/cpp_uno_/shared as "gpp33wad.c" (1.70 KB, text/plain)
2007-08-23 11:59 UTC, kay.ramme
no flags Details
a workaround .... (583 bytes, text/plain)
2008-08-11 09:32 UTC, maho.nakata
no flags Details
use nooptfiles macro instead of modifying CDEFS directly (640 bytes, patch)
2008-08-29 16:25 UTC, lohmaier
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description maho.nakata 2007-05-22 05:08:49 UTC
MacOSX Panther+SRC680_m212 build fails like:

ccache g++-3.3 -fsigned-char -fmessage-length=0 -malign-natural -c -O2
-fno-strict-aliasing   -I.  -I../../../u
nxmacxp.pro/inc/localedata -I../inc -I../../../inc/pch -I../../../inc/i18npool
-I../../../inc -I../../../unx/in
c -I../../../unxmacxp.pro/inc -I.
-I/Volumes/OpenOffice.org/Panther/2.0/work.SRC680_m212/SRC680_m212/solver/680
/unxmacxp.pro/inc/stl
-I/Volumes/OpenOffice.org/Panther/2.0/work.SRC680_m212/SRC680_m212/solver/680/unxmacxp.pr
o/inc/external
-I/Volumes/OpenOffice.org/Panther/2.0/work.SRC680_m212/SRC680_m212/solver/680/unxmacxp.pro/inc
-
I/Volumes/OpenOffice.org/Panther/2.0/work.SRC680_m212/SRC680_m212/solenv/unxmacxp/inc
-I/Volumes/OpenOffice.org
/Panther/2.0/work.SRC680_m212/SRC680_m212/solenv/inc
-I/Volumes/OpenOffice.org/Panther/2.0/work.SRC680_m212/SRC
680_m212/res
-I/Volumes/OpenOffice.org/Panther/2.0/work.SRC680_m212/SRC680_m212/solver/680/unxmacxp.pro/inc/stl
 -I/System/Library/Frameworks/JavaVM.framework/Versions/Current/Headers
-I/System/Library/Frameworks/JavaVM.fra
mework/Headers -I/usr/X11R6/include -I/usr/X11R6/include/freetype2    
-I/Volumes/OpenOffice.org/Panther/2.0/wo
rk.SRC680_m212/SRC680_m212/solver/680/unxmacxp.pro/inc/offuh -I. -I../../../res
-I. -pipe -malign-natural -fsig
ned-char -Wno-long-double  -Wno-ctor-dtor-privacy -Wall -Wendif-labels -Wshadow
-Wno-ctor-dtor-privacy     -Wno
-non-virtual-dtor   -fPIC -fno-common -DMACOSX -DUNX -DVCL -DGCC -DC300
-DPOWERPC -DCVER=C300 -DGLIBC=2 -D_PTHR
EADS -D_REENTRANT -DNO_PTHREAD_PRIORITY -DPOWERPC -DPPC -DSTLPORT_VERSION=400
-D_USE_NAMESPACE=1 -DX_LOCALE -DN
O_AUDIO -D__DMAKE -DUNIX -DCPPU_ENV=gcc3
-DGXX_INCLUDE_PATH=/usr/include/gcc/darwin/3.3/c++ -DSUPD=680 -DPRODUC
T -DNDEBUG -DPRODUCT_FULL -DOSL_DEBUG_LEVEL=0 -DOPTIMIZE -DCUI -DSOLAR_JAVA
-DSRC680=SRC680  -DBUILD_OS_APPLEOS
X -DBUILD_OS_MAJOR=10 -DBUILD_OS_MINOR=3 -DBUILD_OS_REV=9 -DSHAREDLIB -D_DLL_  
-fno-exceptions -DEXCEPTIONS_OF
F  -o ../../../unxmacxp.pro/slo/localedata_fr_MC.o
../../../unxmacxp.pro/misc/localedata_fr_MC.cxx
if ( -e ../../../unxmacxp.pro/slo/localedata_fr_MC.o ) touch
../../../unxmacxp.pro/slo/localedata_fr_MC.obj 
../../../unxmacxp.pro/bin/saxparser fur_IT fur_IT.xml
../../../unxmacxp.pro/misc/localedata_fur_IT.cxx ../../..
/unxmacxp.pro/bin/localedata_fur_IT.rdb
/Volumes/OpenOffice.org/Panther/2.0/work.SRC680_m212/SRC680_m212/solver
/680/unxmacxp.pro/bin/types.rdb
dmake:  Error code 132, while making
'../../../unxmacxp.pro/misc/localedata_fur_IT.cxx'
---* tg_merge.mk *---

The place that build fails is quite random. Another try stopped like:

ccache g++-3.3 -fsigned-char -fmessage-length=0 -malign-natural -c -O2
-fno-strict-aliasing   -I.  -I../../../u
nxmacxp.pro/inc/localedata -I../inc -I../../../inc/pch -I../../../inc/i18npool
-I../../../inc -I../../../unx/in
c -I../../../unxmacxp.pro/inc -I.
-I/Volumes/OpenOffice.org/Panther/2.0/work.SRC680_m212/SRC680_m212/solver/680
/unxmacxp.pro/inc/stl
-I/Volumes/OpenOffice.org/Panther/2.0/work.SRC680_m212/SRC680_m212/solver/680/unxmacxp.pr
o/inc/external
-I/Volumes/OpenOffice.org/Panther/2.0/work.SRC680_m212/SRC680_m212/solver/680/unxmacxp.pro/inc
-
I/Volumes/OpenOffice.org/Panther/2.0/work.SRC680_m212/SRC680_m212/solenv/unxmacxp/inc
-I/Volumes/OpenOffice.org
/Panther/2.0/work.SRC680_m212/SRC680_m212/solenv/inc
-I/Volumes/OpenOffice.org/Panther/2.0/work.SRC680_m212/SRC
680_m212/res
-I/Volumes/OpenOffice.org/Panther/2.0/work.SRC680_m212/SRC680_m212/solver/680/unxmacxp.pro/inc/stl
 -I/System/Library/Frameworks/JavaVM.framework/Versions/Current/Headers
-I/System/Library/Frameworks/JavaVM.fra
mework/Headers -I/usr/X11R6/include -I/usr/X11R6/include/freetype2    
-I/Volumes/OpenOffice.org/Panther/2.0/wo
rk.SRC680_m212/SRC680_m212/solver/680/unxmacxp.pro/inc/offuh -I. -I../../../res
-I. -pipe -malign-natural -fsig
ned-char -Wno-long-double  -Wno-ctor-dtor-privacy -Wall -Wendif-labels -Wshadow
-Wno-ctor-dtor-privacy     -Wno
-non-virtual-dtor   -fPIC -fno-common -DMACOSX -DUNX -DVCL -DGCC -DC300
-DPOWERPC -DCVER=C300 -DGLIBC=2 -D_PTHR
EADS -D_REENTRANT -DNO_PTHREAD_PRIORITY -DPOWERPC -DPPC -DSTLPORT_VERSION=400
-D_USE_NAMESPACE=1 -DX_LOCALE -DN
O_AUDIO -D__DMAKE -DUNIX -DCPPU_ENV=gcc3
-DGXX_INCLUDE_PATH=/usr/include/gcc/darwin/3.3/c++ -DSUPD=680 -DPRODUC
T -DNDEBUG -DPRODUCT_FULL -DOSL_DEBUG_LEVEL=0 -DOPTIMIZE -DCUI -DSOLAR_JAVA
-DSRC680=SRC680  -DBUILD_OS_APPLEOS
X -DBUILD_OS_MAJOR=10 -DBUILD_OS_MINOR=3 -DBUILD_OS_REV=9 -DSHAREDLIB -D_DLL_  
-fno-exceptions -DEXCEPTIONS_OF
F  -o ../../../unxmacxp.pro/slo/localedata_en_CA.o
../../../unxmacxp.pro/misc/localedata_en_CA.cxx
if ( -e ../../../unxmacxp.pro/slo/localedata_en_CA.o ) touch
../../../unxmacxp.pro/slo/localedata_en_CA.obj 
../../../unxmacxp.pro/bin/saxparser en_GB en_GB.xml
../../../unxmacxp.pro/misc/localedata_en_GB.cxx ../../../un
xmacxp.pro/bin/localedata_en_GB.rdb
/Volumes/OpenOffice.org/Panther/2.0/work.SRC680_m212/SRC680_m212/solver/680
/unxmacxp.pro/bin/types.rdb
dmake:  Error code 132, while making
'../../../unxmacxp.pro/misc/localedata_en_GB.cxx'
---* tg_merge.mk *---

.
Comment 1 lohmaier 2007-07-09 12:48:17 UTC
Not only Panther, I see it on the Mac Tinderbox (PPC) with Tiger as well.

running "build" in i18npool over and over again finally gets the module built

(the one that just broke, compiles fine the second time, but another one then fails)
I didn't try the run "build" over and over again method too often, but when
it occurs, you need quite a bit of runs (more than 10) - building the very same 
code on another day doesn't break at all.
Comment 2 maho.nakata 2007-07-10 01:58:07 UTC
*** Issue 79308 has been marked as a duplicate of this issue. ***
Comment 3 lohmaier 2007-08-05 18:24:24 UTC
remover linebreak from summary

Trying to build with gcc 3.3 (one can use gcc_select 3.3 to switch compiler)
will  always break at the first localedata (en_AU) - multiple builds won't help
in that case.

Using cppuhelper from SRC680_m211 doesn't break - so the cause is very likely
buried somewhere in there. Some sideeffects of bunoexttm seem to cause this.
Comment 4 pavel 2007-08-05 19:23:46 UTC
Adding Kay to CC:.
Comment 5 lohmaier 2007-08-09 20:05:25 UTC
I can reproduce the problem on linux as well → OS to Unix/ALL

I tried with a rather old compiler (gcc 3.2.3) and it fails hard, with a
segmentation fault. Multiple builds don't help, just as with gcc 3.3 on Mac.

Using cppuhelper from m211 worksaround the problem on linux as well.

I'll attach a gdb log that was generated as follows:
configure with --enable-symbols, additionally build=debug in bridges, cppuhelper
and i18npool

I hope it helps tracking down the problem
Comment 6 lohmaier 2007-08-09 20:06:22 UTC
Created attachment 47442 [details]
gdb generated backtrace
Comment 7 lohmaier 2007-08-09 20:11:45 UTC
Created attachment 47443 [details]
valgrind log - not sure whether this helps or not (all on m225)
Comment 8 Stephan Bergmann 2007-08-10 09:00:34 UTC
As it is reportedly broken on SRC680m225:  Seems that for some reason in
bridges/source/cpp_uno/shared/cppinterfaceproxy.cxx:1.7 either dso_init is not
called or dso_exit is called too early.  Maybe the __attribute__((constructor))
stuff does not work on all GCC versions, and dso_init is not called at all.
Comment 9 lohmaier 2007-08-10 13:17:58 UTC
Yay, that seems to be the cause. Using rev 1.6 of
bridges/source/cpp_uno/shared/cppinterfaceproxy.cxx allows to build i18npool on
both linux (gcc 3.2.3) and Mac (with gcc 3.3)
Comment 10 maho.nakata 2007-08-13 02:44:18 UTC
Hi cloph, thanks for your analyze, could you please add
--leak-check=full to valgrind to be more verbose?
Comment 11 maho.nakata 2007-08-13 02:46:36 UTC
BTW:
MacOSX Tiger+SRC680_m222 (AQUA) build failed like:

ccache gcc-4.0 -fsigned-char -fmessage-length=0 -malign-natural -c -O2
-fno-strict-aliasing   -I.  -I../../../unxmacx
p.pro/inc/localedata -I../inc -I../../../inc/pch -I../../../inc
-I../../../aqua/inc -I../../../unx/inc -I../../../unx
macxp.pro/inc -I.
-I/Volumes/OpenOffice.org/Tiger/2.0/work.SRC680_m222.AQUA/SRC680_m222/solver/680/unxmacxp.pro/incdo
nt_use_stl
-I/Volumes/OpenOffice.org/Tiger/2.0/work.SRC680_m222.AQUA/SRC680_m222/solver/680/unxmacxp.pro/inc/external
 -I/Volumes/OpenOffice.org/Tiger/2.0/work.SRC680_m222.AQUA/SRC680_m222/solver/680/unxmacxp.pro/inc
-I/Volumes/OpenOff
ice.org/Tiger/2.0/work.SRC680_m222.AQUA/SRC680_m222/solenv/unxmacxp/inc
-I/Volumes/OpenOffice.org/Tiger/2.0/work.SRC6
80_m222.AQUA/SRC680_m222/solenv/inc
-I/Volumes/OpenOffice.org/Tiger/2.0/work.SRC680_m222.AQUA/SRC680_m222/res -I/Volu
mes/OpenOffice.org/Tiger/2.0/work.SRC680_m222.AQUA/SRC680_m222/solver/680/unxmacxp.pro/incdont_use_stl
-I/System/Libr
ary/Frameworks/JavaVM.framework/Versions/Current/Headers
-I/System/Library/Frameworks/JavaVM.framework/Headers     -I
/Volumes/OpenOffice.org/Tiger/2.0/work.SRC680_m222.AQUA/SRC680_m222/solver/680/unxmacxp.pro/inc/offuh
-I. -I../../../
res -I. -pipe -fsigned-char -malign-natural  -Wall -Wendif-labels -fPIC
-fno-common -DMACOSX -DUNX -DVCL -DGCC -DC341
 -DPOWERPC -DCVER=C341 -DGLIBC=2 -D_PTHREADS -D_REENTRANT -DNO_PTHREAD_PRIORITY
-DPOWERPC -DPPC -DSTLPORT_VERSION=400
 -D_USE_NAMESPACE=1 -DHAVE_GCC_VISIBILITY_FEATURE -DNO_AUDIO -D__DMAKE -DUNIX
-DCPPU_ENV=gcc3 -DGXX_INCLUDE_PATH=/usr
/include/c++/4.0.0 -DSUPD=680 -DPRODUCT -DNDEBUG -DPRODUCT_FULL
-DOSL_DEBUG_LEVEL=0 -DOPTIMIZE -DCUI -DSOLAR_JAVA -DS
RC680=SRC680  -DBUILD_OS_APPLEOSX -DBUILD_OS_MAJOR=10 -DBUILD_OS_MINOR=4
-DBUILD_OS_REV=10 -DQUARTZ -DSHAREDLIB -D_DL
L_   -o ../../../unxmacxp.pro/slo/localedata_others_version.o
../../../unxmacxp.pro/misc/localedata_others_version.c
if ( -e ../../../unxmacxp.pro/slo/localedata_others_version.o ) touch
../../../unxmacxp.pro/slo/localedata_others_ver
sion.obj 
../../../unxmacxp.pro/bin/saxparser en_AU en_AU.xml
../../../unxmacxp.pro/misc/localedata_en_AU.cxx ../../../unxmacxp
.pro/bin/localedata_en_AU.rdb
/Volumes/OpenOffice.org/Tiger/2.0/work.SRC680_m222.AQUA/SRC680_m222/solver/680/unxmacxp
.pro/bin/types.rdb
dmake:  Error code 132, while making
'../../../unxmacxp.pro/misc/localedata_en_AU.cxx'
---* tg_merge.mk *---

maybe this bug is not gcc3.3 specific but applies to gcc4.
Comment 12 lohmaier 2007-08-13 14:50:30 UTC
Created attachment 47512 [details]
valgrind log with --leak-check=full
Comment 13 lohmaier 2007-08-13 14:52:05 UTC
Created attachment 47514 [details]
valgrind log with --leak-check=full --show-reachable=yes
Comment 14 kay.ramme 2007-08-13 15:24:05 UTC
Looking into this ...
Comment 15 kay.ramme 2007-08-15 14:56:45 UTC
Anything else I need to know to reproduce this? Just successfully build i18npool
twice on a

  Darwin 8.10.1 Darwin Kernel Version 8.10.1: Wed May 23 16:33:00 PDT 2007;
root:xnu-792.22.5~1/RELEASE_I386 i386 i386

By the way, is this Panther? And how can I find out?

Using gcc:
:~/m225/i18npool$ gcc --version
i686-apple-darwin8-gcc-4.0.1 (GCC) 4.0.1 (Apple Computer, Inc. build 5367)
Copyright (C) 2005 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

not using ccache.
Comment 16 lohmaier 2007-08-15 20:23:31 UTC
You missed two facts already mentioned here:

With the default compiler (4.0.1) it only breaks "randomly", not at every build
and
When you switch compiler to the alternative one (with gcc_select 3.3), then it
breaks every time.

It is 100% reproducible with gcc 3.3 on Mac OSX Tiger

(darwin 8 is Tiger)
Comment 17 kay.ramme 2007-08-16 16:34:17 UTC
Spend some time on this ... unfortunately the gcc-3.3s on our local Macs don't
seem to work, likely need to (re-)install them.

Tried gcc-3.3 as well on Linux, basically stumbling over STL and BOOST problems
... this seems to be a mess.

There are two error traces in this issue, one with with gcc-3.3 and another one
with gcc-4.0, Maho saying something that this happens with gcc-4.0 as well,
which basically is the reason I tried gcc-4.0 first.

->Cloph: What does randomly mean? Could you be more precise, e.g. 1 of 10
attempts or something?

As mentioned elsewhere, the whole thing is related to a c++ (mis-)feature wrt to
atexit, leading to crashes while terminating if using static values. If it comes
out that __attribute__((constructor)) etc. are indeed not working with gcc-3.3
as expected, I am likely going to do the "real" fix and to ref-count the vtable,
constructing it on first bridge instantiation and destructing it on last bridge
destruction.

By the way, is gcc-3.3 still required or could we just abandon it?
Comment 18 maho.nakata 2007-08-17 07:20:09 UTC
> Cloph: What does randomly mean? Could you be more precise, e.g. 1 of 10
attempts or something?

I'm not cloph... randomly mean, 1 of 10 attempts goes well and the other 9
fails, and sometimes passes without errors, etc.
Comment 19 lohmaier 2007-08-22 18:21:42 UTC
Created attachment 47727 [details]
a crashreport that apples crashreporttool creates
Comment 20 lohmaier 2007-08-22 18:25:27 UTC
I failed to create a corefile (ulimit -c unlimited, then it crashed but I
couldn't found any coredump file - neither in the current directory nor in
/cores), but maybe the crashreport already contains the necessary data?

(built with gcc 4.0.1 on tiger)
Comment 21 lohmaier 2007-08-22 18:34:22 UTC
Reason for not getting a corefile was simple: My unprivileged build user didn't
have write access to /cores - so now I can generate core-files en masse...
Comment 22 kay.ramme 2007-08-23 11:54:46 UTC
Created attachment 47746 [details]
Patch for bridges cppinterfaceproxy to not use __attribute__((constructor)) etc in case of gcc 3.3, but to export dso_init / dso_exit as C functions ...
Comment 23 kay.ramme 2007-08-23 11:57:36 UTC
Created attachment 47747 [details]
Patch for bridges ... makefile.mk to build (and link) gpp33wad.c in case of GCC
Comment 24 kay.ramme 2007-08-23 11:59:54 UTC
Created attachment 47748 [details]
Workaround for G++ 3.3 not calling __attribute__((constructor)) etc. for dso_init/-exit; to be placed into bridges/source/cpp_uno_/shared as "gpp33wad.c"
Comment 25 kay.ramme 2007-08-23 12:01:08 UTC
Just add three attachments fixing the vtable construction problem at least on
Erics box ... please give it a try :-)
Comment 26 kay.ramme 2007-09-27 12:36:46 UTC
->Eric: Could you confirm the patches are fixing the problem?
Comment 27 lohmaier 2007-09-27 13:29:01 UTC
the changes at least work for me on linux with the old compiler, but since
nothing is changed for Tiger (Mac OSX 10.4) or more precise for gcc 4.x (which
is the default on Tiger), the problem persists...
Comment 28 kay.ramme 2007-09-27 13:57:42 UTC
->Cloph: The attached patch addresses an issue regarding
"__attribute__((constructor))" and friends not working with g++ 3.x . As far as
I can tell, this is an either it works or it does not work issue, and may not
fail randomly ...

So, this issue seems to be two ...
Comment 29 lohmaier 2007-09-27 21:07:26 UTC
Yes, you are right.

As written above, the problem on linux with gcc 3.2, or on tiger with the
alternative, older compiler (gcc 3.3) are not random, they always fail. 

The problem on tiger with the default (gcc 4) is "random".
Comment 30 maho.nakata 2008-04-28 01:49:04 UTC
it does happens on PPC Tiger. change summary.
Comment 31 maho.nakata 2008-08-11 09:32:05 UTC
Created attachment 55690 [details]
a workaround ....
Comment 32 lohmaier 2008-08-28 23:21:14 UTC
Does the last workaround solve the issue completely on your system, or does it
make the error appear less frequently?

And is -g really needed or is -O0 enough? (one could use the NOOPTFILES then
instead of fiddling with CDEFS directly - would IMHO be a cleaner way to
workaround it)
Comment 33 lohmaier 2008-08-29 16:24:16 UTC
I did a few tests 
for file in <different makefiles>; do cp -f $file source/localedata/makefile.mk
; for ((i=1; i<=15; i++)); do echo $i >> $file.log; rm -rf unxmacxp.pro/ ; build
|| break ; done; done

where the different makefiles had different combinations of one or two of the
three obj-files in the NOOPTFLAGS macro. The only combination that did pass all
15 iterations was the combination of the saxparser.obj and LocaleNode.obj

While this only tells that other combinations don't work (might reduce frequency
of the breakers, but not workaround them completely), this combinations seems to
do the trick.

As it is a non-reproducible failure, one might need to add all three to really
make the problem go away.

I did start a new test with 50 iterations with the two files as nooptfiles - if
that works, I'm pretty confident that the two are enough.
Comment 34 lohmaier 2008-08-29 16:25:23 UTC
Created attachment 56095 [details]
use nooptfiles macro instead of modifying CDEFS directly
Comment 35 lohmaier 2008-08-30 20:22:11 UTC
:-( unfortunately that patch is not enough, adding all is not enough in a
real-life build.

The only way that always (well, at least 'til now) results in a successful build
is to compile cppu with debug.
Comment 36 maho.nakata 2008-11-27 08:33:53 UTC
.

*** This issue has been marked as a duplicate of 96647 ***
Comment 37 Mechtilde 2008-12-06 20:14:09 UTC
duplicate -> closed