[Bug 387141] [NEW] SEGV when stylesheet.xml can't be found

Derrick Hudson dman at dman13.dyndns.org
Mon Jun 15 02:34:48 UTC 2009


Public bug reported:

Binary package hint: bibledit

Bibledit will crash (SEGV) when creating a new project if it can't find
the stylesheets.

The partial stack trace is:

    #0  0xb705c445 in std::string::assign () from /usr/lib/libstdc++.so.6
    #1  0x080ae4b9 in ustring::operator= (this=0xbfa5d984, other=@0x0)
        at /usr/include/c++/4.3/bits/basic_string.h:502
    #2  0x080e3c9f in stylesheet_get_actual () at stylesheetutils.cpp:729
    #3  0x08146298 in Editor::create_or_update_formatting_data (this=0x90e9290)
        at editor.cpp:1212
    #4  0x08149e77 in Editor (this=0x90e9290, vbox=0x90d5170, 
        project_in=@0xbfa5da64) at editor.cpp:66
    #5  0x082b11c4 in WindowEditor::switch_to_view (this=0x90e70a8, 
        viewusfm=false, project=

Line 729 of stylesheets.cpp doesn't check to see if the vector contains
any elements before accessing the first element.

  // Else take first sheet in the list.
  else {
    sheet = stylesheets[0];
  }


This occurred with a local build from the source package of 3.7-1 (from the 9.10 repo).  I did not have the bibledit-data package installed, and did not (yet) read the installation instructions when building from source.

I applied the attached patch, which avoids the SEGV crash.  The
exception throwing is not quite correct (I haven't written any C++ in
quite a while).  The output with this patch is included below.  Notice
that prior to the point of the crash, the stylesheet file could not be
found.  That error should be recognized and reported at that point.

=====
$ ./src/bibledit-bin
cp: cannot stat `/usr/share/bibledit/stylesheet.xml': No such file or directory

(bibledit-bin:24427): Gtk-WARNING **: Error loading icon from file '/usr/share/bibledit/bibledit.xpm':
	Failed to open file '/usr/share/bibledit/bibledit.xpm': No such file or directory

** (bibledit-bin:24427): CRITICAL **: InterprocessCommunication: Sending: connect error Socket Type: 0 Call Type: 3
Recalculating windows positions and sizes

(bibledit-bin:24427): GLib-CRITICAL **: g_dir_read_name: assertion `dir
!= NULL' failed

(bibledit-bin:24427): GLib-CRITICAL **: g_dir_close: assertion `dir !=
NULL' failed

(bibledit-bin:24427): GLib-CRITICAL **: g_dir_read_name: assertion `dir
!= NULL' failed

(bibledit-bin:24427): GLib-CRITICAL **: g_dir_close: assertion `dir != NULL' failed
stylesheets.size: 0
A serious problem occurred
zsh: exit 1     ./src/bibledit-bin
=====

** Affects: bibledit (Ubuntu)
     Importance: Undecided
         Status: New

-- 
SEGV when stylesheet.xml can't be found
https://bugs.launchpad.net/bugs/387141
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
ubuntu-bugs at lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs




More information about the universe-bugs mailing list