wxWidgets / wxWidgets

Cross-Platform C++ GUI Library
https://www.wxwidgets.org/
6.1k stars 1.76k forks source link

wxWebView crashes C++ app on LoadURL #16439

Open wxtrac opened 10 years ago

wxtrac commented 10 years ago

Issue migrated from trac ticket # 16439

component: WebView | priority: normal | keywords: webview loadurl ubuntu

2014-08-20 18:48:34: gonzobongo created the issue


I'm developing a cross platform desktop app in C++ using wxWidgets for all the GUI. For the login I'm letting the user the option to log in with his FB account. For that I place a fb login button that when pressed displays a wxWebView that launches the fb authentication URL:

m_WebView->LoadURL(wxT("https://www.facebook.com/dialog/oauth?client_id=MY_FB_CLIENT_ID&response_type=token&redirect_uri=MY_REDIRECT_URI"));

I have defined also all the wxWebViewEventHandler's to retrieve the FB login token and all once I log-in succesfully. So far so good.

My problem comes when using and debugging the app on Ubuntu 14.04 (It worked with Mac and Windows and Fedora 20). I succeeded loading the Fb authentication uri, but right after I log in with my fb user, the webview window closes down and crashes my whole app, printing on the console the message "Segmentation fault (core dumped)".

It has to be a wxWidgets/webkit Ubuntu related bug because I can't reproduce it neither in Mac nor Windows nor Fedora distributions, and using the same code when compiling for all the different platforms.

I have also included all the necessary webkit flags when compiling wxWidgets (--enable-webkit --enable-webview --enable-webviewwebkit) without raising any error.

wxtrac commented 10 years ago

2014-08-20 22:54:37: @vadz commented


We need either a way to reproduce the crash in the webview sample or a full stack (with symbols) at the moment of the crash and preferably both.

wxtrac commented 9 years ago

2015-08-20 10:59:22: rtorrero commented


Hi,

We are experiencing the same issue here: with wxWidgets 3.0.2 only under Ubuntu (tested on 12.04, 14.04 and 15.04, all share the same issue).

Under CentOS 7 and Windows everything works.

We are not able to get usefull stack trace (stack seems corrupted).

Valgrind reports: ==19248## Warning: client switching stacks? SP change: 0x7fefff988 --> 0xede4da5c7037743719248## to suppress, use: --max-stackframe=1304677935819031889 or greater19248## Use of uninitialised value of size 819248== at 0x972FDEE: __longjmp_chk (__longjmp_chk.S:116)

Any idea where to begin looking?

wxtrac commented 9 years ago

2015-08-20 16:08:07: rtorrero commented


Hi again,

We have managed to isolate the line responsible for the segfault in our code:

::wxInitAllImageHandlers();

It is possible to reproduce this in the webview sample (inside wxwidget samples directory), just add the line inside the WebApp::OnInit() method.

Sometimes it doesn't crash immediately. Doing a search on google images usually does the job.

wxWidgets version: 3.0.2.0 OS: Ubuntu x86_64 15.04

wxtrac commented 9 years ago

2015-08-20 17:06:17: rtorrero commented


More info: The problem is also exposed when adding the JPEG handler manually.

WxImage::AddHandler(new wxJPEGHandler);
wxtrac commented 9 years ago

2015-08-20 23:13:18: @vadz commented


So this is probably due to an incompatibility between libjpeg used by wxWidgets and the one used by the webview library itself. However I'm still not sure how is this possible: don't they both link with the system version of the library?

wxtrac commented 9 years ago

2015-08-21 11:06:55: rtorrero commented


It seems that CentOS 7 is using libjpeg62, and both libwebkitgtk and wxwidgets link to it.

However, in Ubuntu libjpeg8 is used as default, and both libwekitgtk and wxwidgets are built against it. libjpeg62 is also available there, but still binary packages seem to be built against libjpeg8 anyways.

Could the issue be an incompatibility with libjpeg8?

wxtrac commented 9 years ago

2015-08-21 23:54:47: @vadz commented


If you look at the list of loaded modules when it crashes, which libjpeg do you see? Could it be that 6.2 is somehow loaded even when 8 should be used?

wxtrac commented 9 years ago

2015-08-24 10:13:11: rtorrero commented


Hope this is usefull:

For this test, I made two modifications to the webview sample:

Tests:

ruben@ubuntuvirt:~$ lsof -p 3573 | grep .so webview 3573 ruben mem REG 8,1 80888 1048064 /usr/lib/x86_64-linux-gnu/pkcs11/gnome-keyring-pkcs11.so webview 3573 ruben mem REG 8,1 228976 1048065 /usr/lib/x86_64-linux-gnu/pkcs11/p11-kit-trust.so webview 3573 ruben mem REG 8,1 80256 534334 /usr/lib/x86_64-linux-gnu/libtasn1.so.6.2.0 webview 3573 ruben mem REG 8,1 775112 533831 /usr/lib/x86_64-linux-gnu/libgnutls.so.26.22.6 webview 3573 ruben mem REG 8,1 268368 534151 /usr/lib/x86_64-linux-gnu/libp11-kit.so.0.0.0 webview 3573 ruben mem REG 8,1 106776 1047505 /usr/lib/x86_64-linux-gnu/gio/modules/libgiognutls.so webview 3573 ruben mem REG 8,1 22952 789607 /lib/x86_64-linux-gnu/libnss_dns-2.19.so webview 3573 ruben mem REG 8,1 10432 789615 /lib/x86_64-linux-gnu/libnss_mdns4_minimal.so.2 webview 3573 ruben mem REG 8,1 47712 789609 /lib/x86_64-linux-gnu/libnss_files-2.19.so webview 3573 ruben mem REG 8,1 18792 1047504 /usr/lib/x86_64-linux-gnu/gio/modules/libgiognomeproxy.so webview 3573 ruben mem REG 8,1 105440 531566 /usr/lib/mozilla/plugins/libtotem-gmp-plugin.so webview 3573 ruben mem REG 8,1 100720 531565 /usr/lib/mozilla/plugins/libtotem-cone-plugin.so webview 3573 ruben mem REG 8,1 72048 531567 /usr/lib/mozilla/plugins/libtotem-mully-plugin.so webview 3573 ruben mem REG 8,1 6096 531564 /usr/lib/mozilla/plugins/librhythmbox-itms-detection-plugin.so webview 3573 ruben mem REG 8,1 22872 528982 /usr/lib/libtotem-plparser-mini.so.18.1.0 webview 3573 ruben mem REG 8,1 80576 531568 /usr/lib/mozilla/plugins/libtotem-narrowspace-plugin.so webview 3573 ruben mem REG 8,1 346088 533976 /usr/lib/x86_64-linux-gnu/libhunspell-1.3.so.0.0.0 webview 3573 ruben mem REG 8,1 22456 1046857 /usr/lib/x86_64-linux-gnu/enchant/libenchant_myspell.so webview 3573 ruben mem REG 8,1 55848 1046855 /usr/lib/x86_64-linux-gnu/enchant/libenchant_hspell.so webview 3573 ruben mem REG 8,1 764848 528775 /usr/lib/libaspell.so.15.2.0 webview 3573 ruben mem REG 8,1 10080 1046854 /usr/lib/x86_64-linux-gnu/enchant/libenchant_aspell.so webview 3573 ruben mem REG 8,1 51208 1046856 /usr/lib/x86_64-linux-gnu/enchant/libenchant_ispell.so webview 3573 ruben mem REG 8,1 377176 533980 /usr/lib/x86_64-linux-gnu/libibus-1.0.so.5.0.505 webview 3573 ruben mem REG 8,1 31752 1047772 /usr/lib/x86_64-linux-gnu/gtk-3.0/3.0.0/immodules/im-ibus.so webview 3573 ruben mem REG 8,1 240240 533606 /usr/lib/x86_64-linux-gnu/libcroco-0.6.so.3.0.1 webview 3573 ruben mem REG 8,1 217704 534255 /usr/lib/x86_64-linux-gnu/librsvg-2.so.2.40.2 webview 3573 ruben mem REG 8,1 10480 1047434 /usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-svg.so webview 3573 ruben mem REG 8,1 23152 1047430 /usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-png.so webview 3573 ruben mem REG 8,1 34624 534143 /usr/lib/x86_64-linux-gnu/libogg.so.0.8.1 webview 3573 ruben mem REG 8,1 182584 534417 /usr/lib/x86_64-linux-gnu/libvorbis.so.0.4.5 webview 3573 ruben mem REG 8,1 39496 534049 /usr/lib/x86_64-linux-gnu/libltdl.so.7.3.0 webview 3573 ruben mem REG 8,1 72048 534338 /usr/lib/x86_64-linux-gnu/libtdb.so.1.2.12 webview 3573 ruben mem REG 8,1 31080 534421 /usr/lib/x86_64-linux-gnu/libvorbisfile.so.3.3.4 webview 3573 ruben mem REG 8,1 64256 533563 /usr/lib/x86_64-linux-gnu/libcanberra.so.0.2.5 webview 3573 ruben mem REG 8,1 18824 533561 /usr/lib/x86_64-linux-gnu/libcanberra-gtk3.so.0.1.9 webview 3573 ruben mem REG 8,1 23112 1047787 /usr/lib/x86_64-linux-gnu/gtk-3.0/modules/libcanberra-gtk3-module.so webview 3573 ruben mem REG 8,1 14656 1047785 /usr/lib/x86_64-linux-gnu/gtk-3.0/3.0.0/theming-engines/libunico.so webview 3573 ruben mem REG 8,1 38920 789596 /lib/x86_64-linux-gnu/libnih-dbus.so.1.0.0 webview 3573 ruben mem REG 8,1 96280 789598 /lib/x86_64-linux-gnu/libnih.so.1.0.0 webview 3573 ruben mem REG 8,1 108480 789539 /lib/x86_64-linux-gnu/libcgmanager.so.0.0.0 webview 3573 ruben mem REG 8,1 67600 789682 /lib/x86_64-linux-gnu/libudev.so.1.3.5 webview 3573 ruben mem REG 8,1 237504 1047808 /usr/lib/x86_64-linux-gnu/gvfs/libgvfscommon.so webview 3573 ruben mem REG 8,1 202696 1047508 /usr/lib/x86_64-linux-gnu/gio/modules/libgvfsdbus.so webview 3573 ruben mem REG 8,1 52448 1047503 /usr/lib/x86_64-linux-gnu/gio/modules/libdconfsettings.so webview 3573 ruben mem REG 8,1 118392 1047507 /usr/lib/x86_64-linux-gnu/gio/modules/libgioremote-volume-monitor.so webview 3573 ruben mem REG 8,1 68752 534389 /usr/lib/x86_64-linux-gnu/libunity-gtk3-parser.so.0.0.0 webview 3573 ruben mem REG 8,1 23168 1047789 /usr/lib/x86_64-linux-gnu/gtk-3.0/modules/libunity-gtk-module.so webview 3573 ruben mem REG 8,1 77488 1047788 /usr/lib/x86_64-linux-gnu/gtk-3.0/modules/liboverlay-scrollbar.so webview 3573 ruben mem REG 8,1 10336 1047406 /usr/lib/x86_64-linux-gnu/gconv/UTF-32.so webview 3573 ruben mem REG 8,1 18416 789567 /lib/x86_64-linux-gnu/libgpg-error.so.0.10.0 webview 3573 ruben mem REG 8,1 26512 533627 /usr/lib/x86_64-linux-gnu/libdatrie.so.1.3.1 webview 3573 ruben mem REG 8,1 281552 789548 /lib/x86_64-linux-gnu/libdbus-1.so.3.7.6 webview 3573 ruben mem REG 8,1 178328 533524 /usr/lib/x86_64-linux-gnu/libatspi.so.0.0.1 webview 3573 ruben mem REG 8,1 23512848 533982 /usr/lib/x86_64-linux-gnu/libicudata.so.52.1 webview 3573 ruben mem REG 8,1 47400 533666 /usr/lib/x86_64-linux-gnu/libdrm.so.2.4.0 webview 3573 ruben mem REG 8,1 22720 533475 /usr/lib/x86_64-linux-gnu/libXxf86vm.so.1.0.0 webview 3573 ruben mem REG 8,1 6096 534500 /usr/lib/x86_64-linux-gnu/libxshmfence.so.1.0.0 webview 3573 ruben mem REG 8,1 22624 534482 /usr/lib/x86_64-linux-gnu/libxcb-sync.so.1.0.0 webview 3573 ruben mem REG 8,1 10320 534470 /usr/lib/x86_64-linux-gnu/libxcb-present.so.0.0.0 webview 3573 ruben mem REG 8,1 10336 534460 /usr/lib/x86_64-linux-gnu/libxcb-dri3.so.0.0.0 webview 3573 ruben mem REG 8,1 18512 534458 /usr/lib/x86_64-linux-gnu/libxcb-dri2.so.0.0.0 webview 3573 ruben mem REG 8,1 92240 534462 /usr/lib/x86_64-linux-gnu/libxcb-glx.so.0.0.0 webview 3573 ruben mem REG 8,1 5992 533418 /usr/lib/x86_64-linux-gnu/libX11-xcb.so.1.0.0 webview 3573 ruben mem REG 8,1 166136 533811 /usr/lib/x86_64-linux-gnu/libglapi.so.0.0.0 webview 3573 ruben mem REG 8,1 170064 789556 /lib/x86_64-linux-gnu/libexpat.so.1.6.0 webview 3573 ruben mem REG 8,1 137400 789581 /lib/x86_64-linux-gnu/liblzma.so.5.0.0 webview 3573 ruben mem REG 8,1 101240 789660 /lib/x86_64-linux-gnu/libresolv-2.19.so webview 3573 ruben mem REG 8,1 134296 789664 /lib/x86_64-linux-gnu/libselinux.so.1 webview 3573 ruben mem REG 8,1 524704 789563 /lib/x86_64-linux-gnu/libgcrypt.so.11.8.2 webview 3573 ruben mem REG 8,1 533488 534147 /usr/lib/x86_64-linux-gnu/liborc-0.4.so.0.18.0 webview 3573 ruben mem REG 8,1 229968 533936 /usr/lib/x86_64-linux-gnu/libgsttag-1.0.so.0.204.0 webview 3573 ruben mem REG 8,1 160832 533630 /usr/lib/x86_64-linux-gnu/libdbus-glib-1.so.2.2.2 webview 3573 ruben mem REG 8,1 112936 533853 /usr/lib/x86_64-linux-gnu/libgraphite2.so.3.0.1 webview 3573 ruben mem REG 8,1 22616 533435 /usr/lib/x86_64-linux-gnu/libXdmcp.so.6.0.0 webview 3573 ruben mem REG 8,1 14456 533424 /usr/lib/x86_64-linux-gnu/libXau.so.6.0.0 webview 3573 ruben mem REG 8,1 252032 789637 /lib/x86_64-linux-gnu/libpcre.so.3.13.1 webview 3573 ruben mem REG 8,1 30944 533706 /usr/lib/x86_64-linux-gnu/libffi.so.6.0.1 webview 3573 ruben mem REG 8,1 31792 789662 /lib/x86_64-linux-gnu/librt-2.19.so webview 3573 ruben mem REG 8,1 34912 534476 /usr/lib/x86_64-linux-gnu/libxcb-render.so.0.0.0 webview 3573 ruben mem REG 8,1 10336 534480 /usr/lib/x86_64-linux-gnu/libxcb-shm.so.0.0.0 webview 3573 ruben mem REG 8,1 690968 534182 /usr/lib/x86_64-linux-gnu/libpixman-1.so.0.30.2 webview 3573 ruben mem REG 8,1 36936 534350 /usr/lib/x86_64-linux-gnu/libthai.so.0.2.0 webview 3573 ruben mem REG 8,1 73288 533437 /usr/lib/x86_64-linux-gnu/libXext.so.6.4.0 webview 3573 ruben mem REG 8,1 31104 534432 /usr/lib/x86_64-linux-gnu/libwayland-cursor.so.0.0.0 webview 3573 ruben mem REG 8,1 235864 534494 /usr/lib/x86_64-linux-gnu/libxkbcommon.so.0.0.0 webview 3573 ruben mem REG 8,1 52400 534430 /usr/lib/x86_64-linux-gnu/libwayland-client.so.0.2.0 webview 3573 ruben mem REG 8,1 39232 533431 /usr/lib/x86_64-linux-gnu/libXcursor.so.1.0.2 webview 3573 ruben mem REG 8,1 39128 533457 /usr/lib/x86_64-linux-gnu/libXrandr.so.2.2.0 webview 3573 ruben mem REG 8,1 10376 533447 /usr/lib/x86_64-linux-gnu/libXinerama.so.1.0.0 webview 3573 ruben mem REG 8,1 86056 534163 /usr/lib/x86_64-linux-gnu/libpangoft2-1.0.so.0.3600.3 webview 3573 ruben mem REG 8,1 173304 533518 /usr/lib/x86_64-linux-gnu/libatk-bridge-2.0.so.0.0.0 webview 3573 ruben mem REG 8,1 34880 533553 /usr/lib/x86_64-linux-gnu/libcairo-gobject.so.2.11301.0 webview 3573 ruben mem REG 8,1 22584 533439 /usr/lib/x86_64-linux-gnu/libXfixes.so.3.1.0 webview 3573 ruben mem REG 8,1 63880 533445 /usr/lib/x86_64-linux-gnu/libXi.so.6.1.0 webview 3573 ruben mem REG 8,1 413232 533463 /usr/lib/x86_64-linux-gnu/libXt.so.6.0.0 webview 3573 ruben mem REG 8,1 39352 533459 /usr/lib/x86_64-linux-gnu/libXrender.so.1.3.0 webview 3573 ruben mem REG 8,1 10248 533433 /usr/lib/x86_64-linux-gnu/libXdamage.so.1.1.0 webview 3573 ruben mem REG 8,1 10232 533429 /usr/lib/x86_64-linux-gnu/libXcomposite.so.1.0.0 webview 3573 ruben mem REG 8,1 338224 534442 /usr/lib/x86_64-linux-gnu/libwebp.so.5.0.0 webview 3573 ruben mem REG 8,1 1525776 533996 /usr/lib/x86_64-linux-gnu/libicuuc.so.52.1 webview 3573 ruben mem REG 8,1 2121040 533984 /usr/lib/x86_64-linux-gnu/libicui18n.so.52.1 webview 3573 ruben mem REG 8,1 754880 534318 /usr/lib/x86_64-linux-gnu/libsqlite3.so.0.8.6 webview 3573 ruben mem REG 8,1 666080 533748 /usr/lib/x86_64-linux-gnu/libfreetype.so.6.11.1 webview 3573 ruben mem REG 8,1 244704 533720 /usr/lib/x86_64-linux-gnu/libfontconfig.so.1.8.0 webview 3573 ruben mem REG 8,1 594456 1047949 /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1.2.0 webview 3573 ruben mem REG 8,1 1461496 534498 /usr/lib/x86_64-linux-gnu/libxml2.so.2.9.1 webview 3573 ruben mem REG 8,1 247952 534502 /usr/lib/x86_64-linux-gnu/libxslt.so.1.1.28 webview 3573 ruben mem REG 8,1 1513096 533807 /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0.4002.0 webview 3573 ruben mem REG 8,1 782640 534306 /usr/lib/x86_64-linux-gnu/libsoup-2.4.so.1.7.0 webview 3573 ruben mem REG 8,1 320288 534281 /usr/lib/x86_64-linux-gnu/libsecret-1.so.0.0.0 webview 3573 ruben mem REG 8,1 281288 534024 /usr/lib/x86_64-linux-gnu/libjpeg.so.8.0.2 webview 3573 ruben mem REG 8,1 138096 533516 /usr/lib/x86_64-linux-gnu/libatk-1.0.so.0.21009.1 webview 3573 ruben mem REG 8,1 1058192 533916 /usr/lib/x86_64-linux-gnu/libgstreamer-1.0.so.0.204.0 webview 3573 ruben mem REG 8,1 361152 533876 /usr/lib/x86_64-linux-gnu/libgstbase-1.0.so.0.204.0 webview 3573 ruben mem REG 8,1 286776 533940 /usr/lib/x86_64-linux-gnu/libgstvideo-1.0.so.0.204.0 webview 3573 ruben mem REG 8,1 155744 533908 /usr/lib/x86_64-linux-gnu/libgstpbutils-1.0.so.0.204.0 webview 3573 ruben mem REG 8,1 38952 533896 /usr/lib/x86_64-linux-gnu/libgstfft-1.0.so.0.204.0 webview 3573 ruben mem REG 8,1 303048 533872 /usr/lib/x86_64-linux-gnu/libgstaudio-1.0.so.0.204.0 webview 3573 ruben mem REG 8,1 52240 533868 /usr/lib/x86_64-linux-gnu/libgstapp-1.0.so.0.204.0 webview 3573 ruben mem REG 8,1 14592 533819 /usr/lib/x86_64-linux-gnu/libgmodule-2.0.so.0.4002.0 webview 3573 ruben mem REG 8,1 88864 533799 /usr/lib/x86_64-linux-gnu/libgeoclue.so.0.0.0 webview 3573 ruben mem REG 8,1 347024 533966 /usr/lib/x86_64-linux-gnu/libharfbuzz.so.0.927.0 webview 3573 ruben mem REG 8,1 10208 533964 /usr/lib/x86_64-linux-gnu/libharfbuzz-icu.so.0.927.0 webview 3573 ruben mem REG 8,1 46944 533682 /usr/lib/x86_64-linux-gnu/libenchant.so.1.6.0 webview 3573 ruben mem REG 8,1 6886704 534021 /usr/lib/x86_64-linux-gnu/libjavascriptcoregtk-3.0.so.0.16.16 webview 3573 ruben mem REG 8,1 18936 789692 /lib/x86_64-linux-gnu/libuuid.so.1.3.0 webview 3573 ruben mem REG 8,1 98288 533294 /usr/lib/x86_64-linux-gnu/libICE.so.6.3.0 webview 3573 ruben mem REG 8,1 125392 534490 /usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0 webview 3573 ruben mem REG 8,1 1840928 789534 /lib/x86_64-linux-gnu/libc-2.19.so webview 3573 ruben mem REG 8,1 141574 789654 /lib/x86_64-linux-gnu/libpthread-2.19.so webview 3573 ruben mem REG 8,1 90080 789561 /lib/x86_64-linux-gnu/libgcc_s.so.1 webview 3573 ruben mem REG 8,1 1071552 789584 /lib/x86_64-linux-gnu/libm-2.19.so webview 3573 ruben mem REG 8,1 979056 534328 /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.19 webview 3573 ruben mem REG 8,1 14664 789551 /lib/x86_64-linux-gnu/libdl-2.19.so webview 3573 ruben mem REG 8,1 100728 789697 /lib/x86_64-linux-gnu/libz.so.1.2.8 webview 3573 ruben mem REG 8,1 153936 789649 /lib/x86_64-linux-gnu/libpng12.so.0.50.0 webview 3573 ruben mem REG 8,1 1078368 789565 /lib/x86_64-linux-gnu/libglib-2.0.so.0.4002.0 webview 3573 ruben mem REG 8,1 330904 533835 /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.4002.0 webview 3573 ruben mem REG 8,1 1086808 533555 /usr/lib/x86_64-linux-gnu/libcairo.so.2.11301.0 webview 3573 ruben mem REG 8,1 315672 534159 /usr/lib/x86_64-linux-gnu/libpango-1.0.so.0.3600.3 webview 3573 ruben mem REG 8,1 134496 533783 /usr/lib/x86_64-linux-gnu/libgdk_pixbuf-2.0.so.0.3000.7 webview 3573 ruben mem REG 8,1 52528 534161 /usr/lib/x86_64-linux-gnu/libpangocairo-1.0.so.0.3600.3 webview 3573 ruben mem REG 8,1 680376 533779 /usr/lib/x86_64-linux-gnu/libgdk-3.so.0.1000.8 webview 3573 ruben mem REG 8,1 5297920 533944 /usr/lib/x86_64-linux-gnu/libgtk-3.so.0.1000.8 webview 3573 ruben mem REG 8,1 31657904 534440 /usr/lib/x86_64-linux-gnu/libwebkitgtk-3.0.so.0.22.14 webview 3573 ruben mem REG 8,1 30896 533416 /usr/lib/x86_64-linux-gnu/libSM.so.6.0.1 webview 3573 ruben mem REG 8,1 1265072 533420 /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0 webview 3573 ruben mem REG 8,1 149120 789510 /lib/x86_64-linux-gnu/ld-2.19.so

As you see, libjpeg.so.8.0.2 is beeing loaded.

It doesn't seem like it is loading any other library before crashing:

ruben@ubuntuvirt:~/wxwidgets-3/trunk/samples/webview$ cat strace-output.log | grep jpeg open("/usr/lib/x86_64-linux-gnu/libjpeg.so.8", O_RDONLY|O_CLOEXEC) = 3 stat("/usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstjpeg.so", {st_mode=S_IFREG|0644, st_size=44368, ...}) = 0 stat("/usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstjpegformat.so", {st_mode=S_IFREG|0644, st_size=40128, ...}) = 0

Configured wxWidgets 3.0.2 for `x86_64-unknown-linux-gnu'

Which GUI toolkit should wxWidgets use? GTK+ 3 with support for GTK+ printing libnotify Should wxWidgets be compiled into single library? no Should wxWidgets be linked as a shared library? no Should wxWidgets support Unicode? yes (using UTF-8) What level of wxWidgets compatibility should be enabled? wxWidgets 2.6 no wxWidgets 2.8 yes Which libraries should wxWidgets use? STL no jpeg builtin png sys regex builtin tiff builtin zlib sys expat sys libmspack no sdl no

Note how jpeg says 'builtin'. CentOS also reports 'builtin', however, CentOS doesn't crash.

wxtrac commented 9 years ago

2015-08-24 14:36:58: @vadz commented


"builtin" is definitely wrong, as I wrote in the comment:5 wx should be configured to use the system library under Linux, please look at your config.log, determine why configure didn't find it, fix the problem and re-configure with --with-libjpeg=sys and rebuild to fix it.

Of course, it's still wrong that it crashes when using the built-in library and I suspect that we need to do something similar to #16550 (after determining how to do this in the best way...) to fix this, but at least using the system library should make things work.

wxtrac commented 9 years ago

2015-08-24 15:33:01: rtorrero commented


After checking config.log it was obvious that I was missing libjpeg headers. Installing libjpeg-dev, rebuilding wxwidgets and the webview sample fixes the problem.

The configure script now reports to be using system's libjpeg instead of the builtin one.

Thanks!

PS: Until this is fixed it would probably be good idea to force an error in the configure script when sys libjpeg can't be used.

wxtrac commented 7 years ago

2017-08-24 21:13:26: sbrowne (Steve) commented


I'm still working through issues we just found regarding this too since we're just now introducing wxWebView in our application. One thing to keep in mind is that the Ubuntu packages for libwebkitgtk-1.0 are linked specifically against libjpeg.so.8. Meanwhile the OS has both 62 and 8 available. So linking against the sys version depends on which version of libjpeg*-dev you have installed at the time of building wxWidgets.

To add even more confusion we have another library that was statically linking libjpegturbo that was causing problems as well. We got around that one by using -Wl,--exclude-libs=ALL.

I'm thinking a similar thing could be used for resolving both this and the expat issues. The exclude libs parameter allows you to be more specific with something like -Wl,--exclude-libs=jpeg. I used this to compile wxWidgets --with-jpeg=builtin and excluded the symbol exports coming from libjpeg and it seems to be working around this issue. Note that while I agree that sys is preferred over builtin it still doesn't really solve the issue unless sys matches the libjpeg version used by libwebkitgtk. In our case we still need to support back to Ubuntu 8.04 which doesn't have libjpeg8 and wxWebView is just an optional component for us if libwebkitgtk is on the system.

So far my testing seems to be going well using builtin and exclude-libs=jpeg.