Bug 115657 - LibreOfficeKit: libreofficekit_hook_2 does not handle C++ exceptions
Summary: LibreOfficeKit: libreofficekit_hook_2 does not handle C++ exceptions
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
6.0.1.1 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Dev-related
  Show dependency treegraph
 
Reported: 2018-02-12 16:36 UTC by Sander
Modified: 2023-10-03 14:16 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sander 2018-02-12 16:36:34 UTC
Description:
LibreOfficeKit advertises a C API. But when an API consumer calls e.g. lok_init_2() in libreofficekit/src/include/LibreOfficeKit/LibreOfficeKitInit.h, LibreOffice does not catch C++ exceptions before crossing the FFI boundary.

#0  0x00007fffef9e1b20 in __cxxabiv1::__cxa_throw(void*, std::type_info*, void (*)(void*)) (obj=0x7fffddc32b20, tinfo=0x7ffff63fb810 <typeinfo for com::sun::star::uno::RuntimeException>, dest=0x7fffecad60b0)
    at /build/gcc/src/gcc/libstdc++-v3/libsupc++/eh_throw.cc:75
#1  0x00007fffecad9f2b in xmlreader::XmlReader::XmlReader(rtl::OUString const&) () at /usr/lib/libreoffice/program/libxmlreaderlo.so
#2  0x00007fffdd7b165c in  () at /usr/lib/libreoffice/program/../program/libconfigmgrlo.so
#3  0x00007fffdd797541 in  () at /usr/lib/libreoffice/program/../program/libconfigmgrlo.so
#4  0x00007fffdd797dfd in  () at /usr/lib/libreoffice/program/../program/libconfigmgrlo.so
#5  0x00007fffdd7991da in  () at /usr/lib/libreoffice/program/../program/libconfigmgrlo.so
#6  0x00007fffdd79ba3f in  () at /usr/lib/libreoffice/program/../program/libconfigmgrlo.so
#7  0x00007fffdd79c30f in  () at /usr/lib/libreoffice/program/../program/libconfigmgrlo.so
#8  0x00007fffdd7a03aa in  () at /usr/lib/libreoffice/program/../program/libconfigmgrlo.so
#9  0x00007ffff06cca35 in  () at /usr/lib/libreoffice/program/libutllo.so
#10 0x00007ffff06cd63a in  () at /usr/lib/libreoffice/program/libutllo.so
#11 0x00007ffff06bd0ab in utl::ConfigItem::ConfigItem(rtl::OUString const&, ConfigItemMode) () at /usr/lib/libreoffice/program/libutllo.so
#12 0x00007ffff072d677 in  () at /usr/lib/libreoffice/program/libutllo.so
#13 0x00007ffff072ece6 in SvtSysLocaleOptions::SvtSysLocaleOptions() () at /usr/lib/libreoffice/program/libutllo.so
#14 0x00007ffff61c5295 in  () at /usr/lib/libreoffice/program/libsofficeapp.so
#15 0x00007ffff61c5bb6 in libreofficekit_hook_2 () at /usr/lib/libreoffice/program/libsofficeapp.so


Actual Results:  
Undefined behavior in caller upon error.

Expected Results:
Errors are handled.


Reproducible: Always


User Profile Reset: No



Additional Info:
Version: 6.0.1.1
Build ID: 6.0.1-1
CPU threads: 8; OS: Linux 4.15; UI render: default; VCL: gtk3; 
Locale: en-US (en_US.UTF-8); Calc: group


User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:58.0) Gecko/20100101 Firefox/58.0