Averroes / pywebkitgtk

Automatically exported from code.google.com/p/pywebkitgtk
Other
0 stars 0 forks source link

Segmentation fault on destroy #40

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
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.

Original issue reported on code.google.com by Andrew.R...@gmail.com on 1 Sep 2009 at 3:18

GoogleCodeExporter commented 8 years ago
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?

Original comment by Andrew.R...@gmail.com on 1 Sep 2009 at 3:29

GoogleCodeExporter commented 8 years ago

Original comment by jmalo...@gmail.com on 10 Sep 2009 at 11:26

GoogleCodeExporter commented 8 years ago
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.)

Original comment by jayred...@gmail.com on 24 Sep 2009 at 4:00

GoogleCodeExporter commented 8 years ago
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)

Original comment by steven.s...@gmail.com on 6 Nov 2009 at 5:59

GoogleCodeExporter commented 8 years ago
This issue belongs to Ubuntu, see
https://bugs.launchpad.net/ubuntu/+source/pywebkitgtk/+bug/480398

Original comment by serg...@gmail.com on 16 Nov 2009 at 12:14

GoogleCodeExporter commented 8 years ago
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?

Original comment by Andrew.R...@gmail.com on 16 Nov 2009 at 9:59

GoogleCodeExporter commented 8 years ago
Attached is a test case that demonstrates the bug. A segfault will occur when 
the
user clicks the button and then closes the generated window.

Original comment by jayred...@gmail.com on 13 Dec 2009 at 12:15

Attachments:

GoogleCodeExporter commented 8 years ago
I can also verify that the bug does _not_ appear in Ubuntu 9.04 with 
python-webkit
1.0.2-1ubuntu1 and libwebkit 1.0.1-4ubuntu0.1. It appears likely that the bug 
was
introduced in later versions.

Original comment by jayred...@gmail.com on 15 Dec 2009 at 4:52

GoogleCodeExporter commented 8 years ago
Issue 41 has been merged into this issue.

Original comment by jmalo...@gmail.com on 7 Aug 2010 at 10:03

GoogleCodeExporter commented 8 years ago
Issue 43 has been merged into this issue.

Original comment by jmalo...@gmail.com on 7 Aug 2010 at 10:04

GoogleCodeExporter commented 8 years ago
Fixed in http://goo.gl/Mx1E.

Original comment by jmalo...@gmail.com on 7 Aug 2010 at 10:24

GoogleCodeExporter commented 8 years ago
It is working in Ubuntu 10.04

Original comment by Andrew.R...@gmail.com on 7 Aug 2010 at 7:14