Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segmentation fault on destroy #40

Closed
GoogleCodeExporter opened this issue Feb 27, 2016 · 12 comments
Closed

Segmentation fault on destroy #40

GoogleCodeExporter opened this issue Feb 27, 2016 · 12 comments

Comments

@GoogleCodeExporter
Copy link

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
Copy link
Author

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
Copy link
Author

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

  • Changed state: Accepted

@GoogleCodeExporter
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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
Copy link
Author

Issue 41 has been merged into this issue.

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

@GoogleCodeExporter
Copy link
Author

Issue 43 has been merged into this issue.

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

@GoogleCodeExporter
Copy link
Author

Fixed in http://goo.gl/Mx1E.

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

  • Changed state: Fixed

@GoogleCodeExporter
Copy link
Author

It is working in Ubuntu 10.04

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant