Apache OpenOffice (AOO) Bugzilla – Issue 124086
bridge test fails when compiling testtools
Last modified: 2017-05-20 09:32:07 UTC
Hello, I am trying to build OpenOffice on OpenSolaris. I am using gcc 4.8.2, GNU ld 2.24, and the GNU assembler version 2.24. I have no problem compiling everything until compilation reaches testtools. When I use -O2 compilation stops as follows: LD_LIBRARY_PATH=/extra/sources/OpenOffice/aoo4/main/solver/410/unxsogi.pro/lib${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}} /extra/sources/OpenOffice/aoo4/main/solver/410/unxsogi.pro/bin/xsltproc --nonet --stringparam prefix /extra/sources/OpenOffice/aoo4/main/testtools/source/bridgetest/../../unxsogi.pro/misc/ -o ../../unxsogi.pro/lib/uno_services.rdb \ /extra/sources/OpenOffice/aoo4/main/solenv/bin/packcomponents.xslt ../../unxsogi.pro/misc/uno_services.input cd ../../unxsogi.pro/lib && : && LD_LIBRARY_PATH=/extra/sources/OpenOffice/aoo4/main/solver/410/unxsogi.pro/lib${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}} /extra/sources/OpenOffice/aoo4/main/solver/410/unxsogi.pro/bin/uno \ -ro uno_services.rdb -ro uno_types.rdb \ -s com.sun.star.test.bridge.BridgeTest -- \ com.sun.star.test.bridge.CppTestObject ### unexpected exception content! failed ### unexpected exception content! failed ### unexpected exception content! failed exception test failed oneway exception test failed exception occured: error: test failed! > error: error: test failed! > dying... dmake: Error code 1, while making 'runtest' But when I use -O1 I get the following (I have enabled some debugging info): cd ../../unxsogi.pro/lib && : && LD_LIBRARY_PATH=/extra/sources/OpenOffice/aoo4/main/solver/410/unxsogi.pro/lib${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}} /extra/sources/OpenOffice/aoo4/main/solver/410/unxsogi.pro/bin/uno \ -ro uno_services.rdb -ro uno_types.rdb \ -s com.sun.star.test.bridge.BridgeTest -- \ com.sun.star.test.bridge.CppTestObject Trace 2971/1: "component path=file:///extra/sources/OpenOffice/aoo4/main/solver/410/unxsogi.pro/lib/bootstrap.uno.so " => no CPLD_ACCESSPATH set. loadSharedLibComponentFactory envDcp: gcc3 implName: .star.comp.stoc.SimpleRegistry libName: bootstrap.uno.s Trace 2971/1: "> inserting new mapping: ;gcc3[80cf2c8];gcc3[80cf2c8]" Trace 2971/1: "> revoking mapping ;gcc3[80cf2c8];gcc3[80cf2c8]" Trace 2971/1: "component path=file:///extra/sources/OpenOffice/aoo4/main/solver/410/unxsogi.pro/lib/bootstrap.uno.so " loadSharedLibComponentFactory envDcp: gcc3 implName: .star.comp.stoc.SimpleRegistry libName: bootstrap.uno.s Trace 2971/1: "> inserting new mapping: ;gcc3[80d4a68];gcc3[80d4a68]" Trace 2971/1: "> revoking mapping ;gcc3[80d4a68];gcc3[80d4a68]" Trace 2971/1: "component path=file:///extra/sources/OpenOffice/aoo4/main/solver/410/unxsogi.pro/lib/bootstrap.uno.so " loadSharedLibComponentFactory envDcp: gcc3 implName: .star.comp.stoc.NestedRegistry libName: bootstrap.uno.s Trace 2971/1: "> inserting new mapping: ;gcc3[80d4b00];gcc3[80d4b00]" Trace 2971/1: "> revoking mapping ;gcc3[80d4b00];gcc3[80d4b00]" Trace 2971/1: "component path=file:///extra/sources/OpenOffice/aoo4/main/solver/410/unxsogi.pro/lib/bootstrap.uno.so " loadSharedLibComponentFactory envDcp: gcc3 implName: p.stoc.ORegistryServiceManager libName: bootstrap.uno.s Trace 2971/1: "> inserting new mapping: ;gcc3[80d49b0];gcc3[80d49b0]" Trace 2971/1: "> revoking mapping ;gcc3[80d49b0];gcc3[80d49b0]" Trace 2971/1: "component path=file:///extra/sources/OpenOffice/aoo4/main/solver/410/unxsogi.pro/lib/bootstrap.uno.so " loadSharedLibComponentFactory envDcp: gcc3 implName: mp.stoc.OServiceManagerWrapper libName: bootstrap.uno.s Trace 2971/1: "> inserting new mapping: ;gcc3[80d7b68];gcc3[80d7b68]" Trace 2971/1: "> revoking mapping ;gcc3[80d7b68];gcc3[80d7b68]" > implementation com.sun.star.comp.stoc.OServiceManagerWrapper supports: com.sun.star.lang.MultiServiceFactory Trace 2971/1: "component path=file:///extra/sources/OpenOffice/aoo4/main/solver/410/unxsogi.pro/lib/bootstrap.uno.so " loadSharedLibComponentFactory envDcp: gcc3 implName: r.comp.stoc.DLLComponentLoader libName: bootstrap.uno.s Trace 2971/1: "> inserting new mapping: ;gcc3[80d3748];gcc3[80d3748]" Trace 2971/1: "> revoking mapping ;gcc3[80d3748];gcc3[80d3748]" > implementation com.sun.star.comp.stoc.DLLComponentLoader supports: com.sun.star.loader.SharedLibrary Trace 2971/1: "component path=file:///extra/sources/OpenOffice/aoo4/main/solver/410/unxsogi.pro/lib/bootstrap.uno.so " loadSharedLibComponentFactory envDcp: gcc3 implName: .star.comp.stoc.SimpleRegistry libName: bootstrap.uno.s Trace 2971/1: "> inserting new mapping: ;gcc3[80d7b68];gcc3[80d7b68]" Trace 2971/1: "> revoking mapping ;gcc3[80d7b68];gcc3[80d7b68]" > implementation com.sun.star.comp.stoc.SimpleRegistry supports: com.sun.star.registry.SimpleRegistry Trace 2971/1: "component path=file:///extra/sources/OpenOffice/aoo4/main/solver/410/unxsogi.pro/lib/bootstrap.uno.so " loadSharedLibComponentFactory envDcp: gcc3 implName: .star.comp.stoc.NestedRegistry libName: bootstrap.uno.s Trace 2971/1: "> inserting new mapping: ;gcc3[80d3748];gcc3[80d3748]" Trace 2971/1: "> revoking mapping ;gcc3[80d3748];gcc3[80d3748]" > implementation com.sun.star.comp.stoc.NestedRegistry supports: com.sun.star.registry.NestedRegistry Trace 2971/1: "component path=file:///extra/sources/OpenOffice/aoo4/main/solver/410/unxsogi.pro/lib/bootstrap.uno.so " loadSharedLibComponentFactory envDcp: gcc3 implName: mp.stoc.TypeDescriptionManager libName: bootstrap.uno.s Trace 2971/1: "> inserting new mapping: ;gcc3[80d7b68];gcc3[80d7b68]" Trace 2971/1: "> revoking mapping ;gcc3[80d7b68];gcc3[80d7b68]" > implementation com.sun.star.comp.stoc.TypeDescriptionManager supports: com.sun.star.reflection.TypeDescriptionManager Trace 2971/1: "component path=file:///extra/sources/OpenOffice/aoo4/main/solver/410/unxsogi.pro/lib/bootstrap.uno.so " loadSharedLibComponentFactory envDcp: gcc3 implName: toc.ImplementationRegistration libName: bootstrap.uno.s Trace 2971/1: "> inserting new mapping: ;gcc3[80d3748];gcc3[80d3748]" Trace 2971/1: "> revoking mapping ;gcc3[80d3748];gcc3[80d3748]" > implementation com.sun.star.comp.stoc.ImplementationRegistration supports: com.sun.star.registry.ImplementationRegistration Trace 2971/1: "component path=file:///extra/sources/OpenOffice/aoo4/main/solver/410/unxsogi.pro/lib/bootstrap.uno.so " loadSharedLibComponentFactory envDcp: gcc3 implName: ity.comp.stoc.AccessController libName: bootstrap.uno.s Trace 2971/1: "> inserting new mapping: ;gcc3[80d7b68];gcc3[80d7b68]" Trace 2971/1: "> revoking mapping ;gcc3[80d7b68];gcc3[80d7b68]" > implementation com.sun.star.security.comp.stoc.AccessController supports: com.sun.star.security.AccessController Trace 2971/1: "component path=file:///extra/sources/OpenOffice/aoo4/main/solver/410/unxsogi.pro/lib/bootstrap.uno.so " loadSharedLibComponentFactory envDcp: gcc3 implName: .security.comp.stoc.FilePolicy libName: bootstrap.uno.s Trace 2971/1: "> inserting new mapping: ;gcc3[80d3748];gcc3[80d3748]" Trace 2971/1: "> revoking mapping ;gcc3[80d3748];gcc3[80d3748]" > implementation com.sun.star.security.comp.stoc.FilePolicy supports: com.sun.star.security.Policy Trace 2971/1: "> inserting new mapping: ;gcc3[80d7b68];gcc3[80d7b68]" Trace 2971/1: "> revoking mapping ;gcc3[80d7b68];gcc3[80d7b68]" Trace 2971/1: "> inserting new mapping: ;gcc3[80d3748];gcc3[80d3748]" Trace 2971/1: "> revoking mapping ;gcc3[80d3748];gcc3[80d3748]" Trace 2971/1: "component path=file:///extra/sources/OpenOffice/aoo4/main/solver/410/unxsogi.pro/lib/bootstrap.uno.so " loadSharedLibComponentFactory envDcp: gcc3 implName: egistryTypeDescriptionProvider libName: bootstrap.uno.s Trace 2971/1: "> inserting new mapping: ;gcc3[80dca40];gcc3[80dca40]" Trace 2971/1: "> revoking mapping ;gcc3[80dca40];gcc3[80dca40]" Trace 2971/1: "> inserting new mapping: ;gcc3[80d3748];gcc3[80d3748]" Trace 2971/1: "> revoking mapping ;gcc3[80d3748];gcc3[80d3748]" Trace 2971/1: "component path=file:///extra/sources/OpenOffice/aoo4/main/testtools/unxsogi.pro/lib/bridgetest.uno.so " loadSharedLibComponentFactory envDcp: gcc3 implName: un.star.comp.bridge.BridgeTest libName: file:///extra/s Trace 2971/1: "> inserting new mapping: ;gcc3[80dcbc8];gcc3[80dcbc8]" Trace 2971/1: "> revoking mapping ;gcc3[80dcbc8];gcc3[80dcbc8]" Trace 2971/1: "component path=file:///extra/sources/OpenOffice/aoo4/main/testtools/unxsogi.pro/lib/cppobj.uno.so " loadSharedLibComponentFactory envDcp: gcc3 implName: star.comp.bridge.CppTestObject libName: file:///extra/s Trace 2971/1: "> inserting new mapping: ;gcc3[80dcd00];gcc3[80dcd00]" Trace 2971/1: "> revoking mapping ;gcc3[80dcd00];gcc3[80dcd00]" Trace 2971/1: "> inserting new mapping: ;gcc3[80dd318];uno[80dd3b0]" Trace 2971/1: "> inserting new mapping: ;uno[80dd3b0];gcc3[80dcd00]" terminate called after throwing an instance of 'com::sun::star::uno::RuntimeException' /usr/bin/bash: line 1: 2971 Abort (core dumped) LD_LIBRARY_PATH=/extra/sources/OpenOffice/aoo4/main/solver/410/unxsogi.pro/lib${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}} /extra/sources/OpenOffice/aoo4/main/solver/410/unxsogi.pro/bin/uno -ro uno_services.rdb -ro uno_types.rdb -s com.sun.star.test.bridge.BridgeTest -- com.sun.star.test.bridge.CppTestObject dmake: Error code 134, while making 'runtest' ERROR: error 65280 occurred while making /extra/sources/OpenOffice/aoo4/main/testtools/source/bridgetest I have no idea what is wrong. And moreover, I don't know what should I do to find what is the problem. Therefore, any help/advice/assistance would be really appreciated! Kind regards, A.S.
Created attachment 82406 [details] Patch for file bridges/source/cpp_uno/gcc3_solaris_intel/uno2cpp.cxx This patch solves the problem I reported.
"hdu" committed SVN revision 1567914 into trunk: #i124086# preserve 16byte stack alignment in gcc3-solaris-intel's uno2cpp bridge
Thanks for the patch, Apostolos! Applied now for AOO 4.1.
Looking at the patch again there is a forward declaration of callVirtualMethod() immediately followed by its actual definition. IMHO the forward declaration is superfluous. I don't have a Solaris dev environment here, so I can't check, but from a C++ perspective only the "noinline" attribute needs to be moved and the forward declaration should be dropped.
Thank you very much for pointing this out. However, if you check out http://opengrok.adfinis-sygroup.org/source/xref/aoo-trunk/main/bridges/source/cpp_uno/gcc3_linux_intel/uno2cpp.cxx you will notice the same problem. Thus, I believe it is necessary to modify the code in other files too. After all, I modified the solaris bridge using code from the linux bridge.Now, the correct code should like void __attribute__ ((noinline)) callVirtualMethod( void * pAdjustedThisPtr, sal_Int32 nVtableIndex, void * pRegisterReturn, typelib_TypeClass eReturnType, sal_Int32 * pStackLongs, sal_Int32 nStackLongs ) { Should I submit a patch or is this enough?
(In reply to Apostolos Syropoulos from comment #5) > Thank you very much for pointing this out. However, if you check out > http://opengrok.adfinis-sygroup.org/source/xref/aoo-trunk/main/bridges/ > source/cpp_uno/gcc3_linux_intel/uno2cpp.cxx you will notice the same > problem. Thus, I believe it is necessary to modify the code in other files > too. Yes, will do. > After all, I modified the solaris bridge using code from the linux > bridge.Now, the correct code > should like > > void __attribute__ ((noinline)) callVirtualMethod( > void * pAdjustedThisPtr, > sal_Int32 nVtableIndex, > void * pRegisterReturn, > typelib_TypeClass eReturnType, > sal_Int32 * pStackLongs, > sal_Int32 nStackLongs ) > { > > Should I submit a patch or is this enough? If you confirm that it works this is sufficient.
Created attachment 82630 [details] cpp2uno.cxx patch
Created attachment 82631 [details] cpp2uno.cxx patch
Created attachment 82632 [details] uno2cpp.cxx patch
The 2 patches I have attached pass the testtools bridge test. However, when they are built with debug=t they cause the testtools to throw an exception.
Created attachment 82698 [details] Patch for gcc_solaris_intel Patches 82630, 82631, and 82632 should be discarded. This patch should be applied after applying patch 82406.
Comment on attachment 82632 [details] uno2cpp.cxx patch Obsoleted attachments 82630, 82631 and 82632 per author request.
Ah, so the 16byte stack alignment is not needed? The most important difference is the removal of the regparm then. Does it work now also for debug=true with this patch? Thanks for the patch and for the removal of the forward declaration. Having looked at the code in its cousin bridges (that we discussed above) I became hesitant to remove them there, because of concerns about the extern "C", no-inline, static or namespaces used there. "Never burn a working bridge" ;-)