maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Development (https://talk.maemo.org/forumdisplay.php?f=13)
-   -   webkit fails within python on N900 (https://talk.maemo.org/showthread.php?t=54909)

Paul Ortyl 2010-06-02 12:57

webkit fails within python on N900
 
Hi,

I have just came across the following problem with webkit.

The following statement in N900 fails with SIGABRT

~ $ python
Python 2.5.4 (r254:67916, May 17 2010, 21:00:32)
[GCC 4.2.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import webkit
>>> webkit.WebView()
Aborted

The same in my desktop environment (not the SDK) and the application using webkit works fine, on N900 at the call to webkit.WebView() comes SIGABRT

Strace of the following ends with:
open("/etc/passwd", O_RDONLY) = 3
fcntl64(3, F_GETFD) = 0
fcntl64(3, F_SETFD, FD_CLOEXEC) = 0
fstat64(3, {st_mode=S_IFREG|0644, st_size=1102, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40ffd000
read(3, "root:xxxxxxxxxxx:0:0:root:/roo"..., 4096) = 1102
close(3) = 0
munmap(0x40ffd000, 4096) = 0
getuid32() = 29999
uname({sys="Linux", node="Nokia-N900", ...}) = 0
access("/sbin/syslogd", R_OK|X_OK) = -1 ENOENT (No such file or directory)
rt_sigprocmask(SIG_UNBLOCK, [ABRT], NULL, 8) = 0
tgkill(1949, 1949, SIGABRT) = 0
--- SIGABRT (Aborted) @ 0 (0) ---
+++ killed by SIGABRT +++

The strace of the working desktop version looks similar up to the uname() call.

Any ideas how to get it to work on N900?

Paul

Slocan 2010-06-02 14:31

Re: webkit fails within python on N900
 
Looks like you need to initialize threading support first. This works:
Code:

>>> import webkit,gobject
>>> gobject.threads_init()
>>> webkit.WebView()
<webkit.WebView object at 0x290968 (WebKitWebView at 0x2ff800)>

If you look at the source package http://maemo.org/packages/package_in...ebkit/1.0.2-4/ , there is a webbrowser.py in it as an example. Another program using it would be FeedingIt.

Paul Ortyl 2010-06-02 14:56

Re: webkit fails within python on N900
 
Thanks, I confirm, this works.

But why the desktop version did not need thread initialisation.... never mind...

Slocan 2010-06-02 15:49

Re: webkit fails within python on N900
 
Quote:

Originally Posted by Paul Ortyl (Post 695950)
But why the desktop version did not need thread initialisation.... never mind...

Actually, the desktop version on Ubuntu Lucid does crash for me as well, with a message that is a little more useful:
Code:

>>> import webkit
web>>> webkit.WebView()

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

Googling a bit around seems to indicate some versions of webkit initialize the thread system itself, and some need it specified. Not sure why, really...

Keeper 2010-07-13 10:05

Re: webkit fails within python on N900
 
Hello,
where do I get the package? It is not in the repositories I have installed.
Thanks for an answer :)
Tim

Slocan 2010-07-13 19:05

Re: webkit fails within python on N900
 
Quote:

Originally Posted by Keeper (Post 750103)
Hello,
where do I get the package? It is not in the repositories I have installed.
Thanks for an answer :)
Tim

The python2.5-webkit package is in all of the Extras (aka Maemo.org), Extras-testing and Extras-devel repository, but since it's just a library, it would not show in the App Manager. If you have any of these enabled, then you can do, as root, on the X-term:
apt-get install python2.5-webkit
A GUI way to install it would be to install a package that depends on it (FeedingIt being the main example).


All times are GMT. The time now is 17:12.

vBulletin® Version 3.8.8