My favorites | Sign in
Project Logo
                
New issue | Search
for
| Advanced search | Search tips
Issue 40: Segmentation fault on destroy
5 people starred this issue and may be notified of changes. Back to list
Status:  Accepted
Owner:  ----
Type-Defect
Priority-Medium


Sign in to add a comment
 
Reported by Andrew.R...@gmail.com, Sep 01, 2009
What steps will reproduce the problem?
1. Start a child GTK dialog with a WebView child from a parent GTK dialog
2. On close of the child GTK dialog, call WebView.destroy()
3. Segmentation Fault

What is the expected output? What do you see instead?
I expect the control to be destroyed. Instead it faults over half of the time.

What version of the product are you using? On what operating system?
1.1.5-1
Ubuntu Jaunty

Please provide any additional information below.

class BrowserDialog(gtk.Dialog):
  def __init__(self, parent):
    gtk.Dialog.__init__(self, parent = parent, title = 'Find install file')
    self._scrolled_window = sw = gtk.ScrolledWindow()
    self.browser = b = webkit.WebView()
    ...
    self.connect('delete_event', self._handle_close)
    ...

  def _handle_close(self, *args):
    ...
    print 'before self.browser.destroy()'
    # segmentation fault here:
    self.browser.destroy()
    print 'before self.destroy()'
    self.destroy()


I am not sure if this is a bug, or if I am simply not using it correctly.
Almost all examples on the web are bad ones for this use case as they are
lazy and call gtk.main_quit() when the browser closes. In my use case I pop
up a browser in a child dialog, so I want to be able to close that dialog
and ensure the memory for the browser is reclaimed.
Comment 1 by Andrew.R...@gmail.com, Sep 01, 2009
Note that I cannot run the tabbed_browser.py demo from the 1.1.6 download either:

./tabbed_browser.py

GLib-ERROR **: The thread system is not yet initialized.
aborting...
Aborted

I tried with python 2.6 and 2.5 and got the same error.

Perhaps it is because my install is 1.1.5-1 and the download is 1.1.6?
Comment 2 by jmalonzo, Sep 10, 2009
(No comment was entered for this change.)
Status: Accepted
Comment 3 by jayreding, Sep 23, 2009
I have a similar problem with BloGTK 2.0. It appears as though there's a segfault if
the user opens an editor window, closes it (destroying the WebKit.WebView) and then
tries to open a third editor window. It seems that the triggering condition for the
segfault is related to the destruction of the WebView.

I'm also using the Ubuntu packaged version 1.15. This bug does not appear on the
version packaged with Jaunty (1.0.3, I believe.)
Comment 4 by steven.snelgrove, Nov 05, 2009
I just heard about pywebkitgtk and was trying to download it and get it running. I am
on Ubuntu 9.10 and am using the distribution libraries. When I try the demo program,
I an error like the one talked about in the other posts.

$ python demos/browser.py 

GLib-ERROR **: The thread system is not yet initialized.
aborting...
Aborted (core dumped)

Comment 5 by sergray, Nov 16, 2009
This issue belongs to Ubuntu, see
https://bugs.launchpad.net/ubuntu/+source/pywebkitgtk/+bug/480398
Comment 6 by Andrew.R...@gmail.com, Nov 16, 2009
I do not thing that this is a duplicate of bug 480398. The browser demo is working
now in Ubuntu, but I am still having the segfault problem of webkit when I close my
dialogs when webkit is loaded in them. In my main CLI code, I have this:
  jdevMgr = jdev.JDevInstallManager()

  gtk.gdk.threads_init()
  try:
    mw = mainUi.MainWindow(jdevMgr)
    mw.show()
    gtk.main()
  except KeyboardInterrupt:
    pass

So my GTK threads are initialized, so I do not think this is the same problem. The
"mainUI.MainWindow" class of mine is the one that launches the dialog with webkit in
it. If I am wrong, what must be done besides initializing the threads before the
gtk.main() call?
Sign in to add a comment

Hosted by Google Code