Bug 96243

Summary: Crashes when view path is incorrect
Product: LibreOffice Reporter: Bastien Nocera <bugzilla>
Component: LibreOfficeAssignee: David Tardon <dtardon>
Status: RESOLVED FIXED    
Severity: normal CC: dtardon, h3734236
Priority: medium    
Version: 5.1.0.0.beta1   
Hardware: All   
OS: All   
Whiteboard: target:5.2.0 target:5.1.0.1
Crash report or crash signature: Regression By:

Description Bastien Nocera 2015-12-04 12:27:59 UTC
Using http://koji.fedoraproject.org/koji/buildinfo?buildID=703072

$ cat test.js 
#!/usr/bin/gjs

const Gtk = imports.gi.Gtk;
const LOKDocView = imports.gi.LOKDocView;

Gtk.init(null);

let view = LOKDocView.View.new("/path/that/doesnt/exist", null, null);

$ GI_TYPELIB_PATH=$GI_TYPELIB_PATH:/usr/lib64/libreoffice/girepository-1.0/ LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib64/libreoffice/program/ gjs test.js 

failed to open library '/path/that/doesnt/exit/libmergedlo.so': /path/that/doesnt/exit/libmergedlo.so: cannot open shared object file: No such file or directory
failed to find hook in library '(null)'
Segmentation fault (core dumped)

The call should fail gracefully instead.
Comment 1 Commit Notification 2015-12-07 12:15:11 UTC
David Tardon committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=7f73ea2e3975b305e09467eb7980a3d01cd37de9

tdf#96243 don't crash if LibO install. wasn't found

It will be available in 5.2.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 2 Commit Notification 2015-12-07 12:15:17 UTC
David Tardon committed a patch related to this issue.
It has been pushed to "libreoffice-5-1":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=125382803df6502e467cb25b6ee70c24d5f4dfc0&h=libreoffice-5-1

tdf#96243 don't crash if LibO install. wasn't found

It will be available in 5.1.0.1.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.