[Libreoffice] Multiple issues with cppuhelper/source/exc_thrower.cxx

Bjoern Michaelsen bjoern.michaelsen at canonical.com
Fri May 27 01:53:23 PDT 2011

Hi Caolán, all,

when looking into
https://bugs.launchpad.net/ubuntu/+source/libreoffice/+bug/745836 which
has by now collected some 20 duplicates, I have more open questions
than answers.

Some disassembling lead to the real point of failure being
(in 3.3.2/3.4 on amd64):
239	    OSL_ASSERT( xThrower.is() );
240	    xThrower->throwException( exc );
   0x000000000001edd3 <+675>:	mov    %rbx,%rsi
   0x000000000001edd6 <+678>:	mov    (%rdi),%rax
   0x000000000001edd9 <+681>:	callq  *0x18(%rax)
241	}

With an eip of 0x100000 (in the i386 bug reports) meaning the call goes
into nirvana.

Digging deeper, I found ExceptionThrower::get() on the 3.4 branch to:
a) not using a static variable for s_pThrower thus making the if always
   eval to true.
b) not even double-checking s_pThrower after aquireing the guard, making
   the whole thing pretty pointless.
c) However, I think even as is, the should not be harmful at least on
   gcc, if http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13684 is really
   fixed (and the testcode in the issue performs good on my machine).
   But what about other compilers?

Caolan has fixed this on master with commit
ure:c51c13ff92adbe1d3f22bee6d907132c48d16602, if it was broken.
Depending on how compilers handle this, it might be worth to cherrypick
to 3-4.

So unless I overlooked something there, the error really is not in the
singleton creation (at least with my gcc), leading to the cause to
possibly be something going wrong in the uno2cpp.mapInterface(..) call
just before. Does that sound plausible? I just want to make sure, before
digging even deeper into the disassembly.




More information about the LibreOffice mailing list