segfault in DocumentLoader example

Katarina Behrens katarina.behrens at
Wed Jul 18 13:08:21 UTC 2018

Hello world, 

> I copied the C++ DocumentLoader example, but I get an segmentation fault.

By "I copied C++ DocumentLoader example" you presumably mean that you've built 
and run the example outside the environment set by LibO SDK (i.e. by 
'setsdkenv_$your_os') ?

Correct me if I'm wrong

> The segfault is caused by invoking
> `cppu::defaultBootstrap_InitialComponentContext()`

Umm, so the example code could be made a bit more robust here and fail early 
if the bootstrap failed (instead of assuming that bootstrap succeeds at all 
times). Nevertheless it doesn't explain why bootstrapping LibO didn't work for 


> command line was: ./generator -env:URE_MORE_TYPES=file://"./offapi.rdb"
> "./test.odt"
> "uno:socket,host=localhost,port=2083;urp;StarOffice.ServiceManager"
> Libreoffice was started with: soffice
> "-accept=socket,host=localhost,port=2083;urp;StarOffice.ServiceManager"

Try using absolute path to the file DocumentLoader is expected to open (i.e. 
'/full/path/to/test.odt' instead of './test.odt') 

If that doesn't help, the next step would be adding some debug code into into 
DocumentLoader.cxx code, for ex. wrap defaultBootstrap_InitialComponentContext 
in some try-catch block and see what exception(s) are thrown ... 

Katarina Behrens

Senior Software-Entwicklerin FLOSS
CIB software GmbH
Geschäftsstelle Hamburg
Flachsland 10
22083 Hamburg
T +49 (40) / 28 48 42 -235
F +49 (40) / 28 48 42 -100

Katarina.Behrens at
Sitz: München
Registergericht München, HRB 123286
Geschäftsführer: Dipl.-Ing. Ulrich Brandner

More information about the LibreOffice mailing list