Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 581282

Summary: dev-qt/qtwebkit-5.6.0: undefined reference to pthread_getspecific, pthread_setspecific, pthread_key_create
Product: Gentoo Linux Reporter: cryptopsy
Component: Current packagesAssignee: Qt Bug Alias <qt>
Status: RESOLVED FIXED    
Severity: normal CC: bkohler, eandry, karl.j.linden, rdalek1967
Priority: Normal Keywords: PATCH, UPSTREAM
Version: unspecified   
Hardware: All   
OS: Linux   
URL: http://code.qt.io/cgit/qt/qtwebkit.git/commit/?id=5f359baacdf92fabcece83f0a2b30f74c7c02a3c
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: build.log
emerge --info
dmesg memory information
non-memory-error build.log
truncated due to file size
build.log
build log with -j1
build log bz2
Patch file

Description cryptopsy 2016-04-26 17:32:08 UTC
My browser (qutebrowser) recently stopped working after a world update. It depends on PyQt5-5-5.1 which depends on the 5.6.0 Qt stuff.
Comment 1 cryptopsy 2016-04-26 17:35:53 UTC
Created attachment 432160 [details]
build.log

missing .cfi_endproc directive
truncated because file size (>15mb, max is 1mb)
Comment 2 cryptopsy 2016-04-26 17:36:22 UTC
Created attachment 432162 [details]
emerge --info
Comment 3 Ben Kohler gentoo-dev 2016-04-26 18:25:08 UTC
This looks like you may have run out of memory, can you check dmesg output?
Comment 4 cryptopsy 2016-04-26 19:47:14 UTC
That seems to be correct, if I don't reply back by the next day you can close this bug. Although, I think it should have given a memory like some other packages do.
Comment 5 Tomáš Mózes 2016-04-26 20:28:16 UTC
Feel free to re-open if it's still valid.
Comment 6 cryptopsy 2016-04-26 20:35:51 UTC
with watch 'du -sh' it, never reached over 600mb in the build folder. It's building in a tmpfs of 7gb, 1gb of which is used by the portage tree.
Comment 7 cryptopsy 2016-04-26 20:36:11 UTC
Created attachment 432192 [details]
dmesg memory information
Comment 8 cryptopsy 2016-04-27 10:41:59 UTC
Created attachment 432254 [details]
non-memory-error build.log
Comment 9 cryptopsy 2016-04-27 10:42:41 UTC
(In reply to Tomáš Mózes from comment #5)
> Feel free to re-open if it's still valid.

does it automatically re-open if i reply on it or do i have to reopen it somehow?
Comment 10 Ben Kohler gentoo-dev 2016-04-27 12:38:40 UTC
I don't think there is anything to do here.  The *minimum* amount of memory required to build qtwebkit isn't all that high.  If we checked for 4GB, which is enough in most cases, your system would pass that test.  But you have done a lot of extra things which eat up more memory-- the tmpfs stuff, having a full X session playing movies, using MAKEOPTS="-j4", using emerge -j2.  

emerge cannot account for all of these things, and it only checks for total system memory, not free memory at build time.  Some of the responsibility for preventing OOM does fall on the user.
Comment 11 cryptopsy 2016-04-27 13:00:17 UTC
I replicated the emerge without any significant usage of the tmpfs to make sure this wasn't the case, reduced to -j2, and --jobs did not interfere with it because it was the only package building
Comment 12 cryptopsy 2016-04-27 15:17:20 UTC
Created attachment 432276 [details]
truncated due to file size

Built with -j1 , emake failed

ThreadIdentifierDataPthreads.cpp:(.text+0xce): undefined reference to `pthread_setspecific' error

dmesg shows no memory error
Comment 13 Ben Kohler gentoo-dev 2016-04-27 15:37:15 UTC
Compress the log so you can attach it in full, that last attachment doesn't have anything useful in it
Comment 14 cryptopsy 2016-04-27 17:13:00 UTC
Created attachment 432286 [details]
build.log

built with -j4 because on -j1 it runs at 25% CPU and was taking too long to finish.
Comment 15 cryptopsy 2016-04-27 19:38:39 UTC
Created attachment 432320 [details]
build log with -j1

built with -j1 again to verify my claims and provide you a bz2 of the build.log for -j1
Comment 16 cryptopsy 2016-04-28 15:06:41 UTC
Looks like its broken upstream: https://codereview.qt-project.org/#/c/150601/
Comment 17 Davide Pesavento (RETIRED) gentoo-dev 2016-04-29 01:51:18 UTC
x86_64-pc-linux-gnu-g++ -Wl,-O1 -Wl,--as-needed -Wl,--gc-sections -Wl,--no-undefined -Wl,--no-undefined -fdebug-types-section -Wl,--enable-new-dtags -shared -Wl,-Bsymbolic-functions -Wl,-soname,libQt5WebKit.so.5 -o libQt5WebKit.so.5.6.0   -lQt5Gui -lQt5Network -lQt5Core -lpthread -Wl,-whole-archive -lWebKit1 -Wl,-no-whole-archive -L/tmp/.portage/portage/dev-qt/qtwebkit-5.6.0/work/qtwebkit-opensource-src-5.6.0/Source/WebKit/ -Wl,-whole-archive -lWebKit2 -Wl,-no-whole-archive -L/tmp/.portage/portage/dev-qt/qtwebkit-5.6.0/work/qtwebkit-opensource-src-5.6.0/Source/WebKit2/ -lrt -Wl,-whole-archive -lWebCore -Wl,-no-whole-archive -L/tmp/.portage/portage/dev-qt/qtwebkit-5.6.0/work/qtwebkit-opensource-src-5.6.0/Source/WebCore/ -lz -lXrender -lXcomposite -lXrender -lleveldb -lmemenv -ljpeg -lpng -lwebp -Wl,-whole-archive -lANGLE -Wl,-no-whole-archive -L/tmp/.portage/portage/dev-qt/qtwebkit-5.6.0/work/qtwebkit-opensource-src-5.6.0/Source/ThirdParty/ANGLE/ -Wl,-whole-archive -lJavaScriptCore -Wl,-no-whole-archive -L/tmp/.portage/portage/dev-qt/qtwebkit-5.6.0/work/qtwebkit-opensource-src-5.6.0/Source/JavaScriptCore/ -Wl,-whole-archive -lWTF -Wl,-no-whole-archive -L/tmp/.portage/portage/dev-qt/qtwebkit-5.6.0/work/qtwebkit-opensource-src-5.6.0/Source/WTF/ -lXext -lX11 -lm -lX11 -lxslt -lxml2 -lz -lm -ldl -lm -lxml2 -lxml2 -lglib-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lgstreamer-1.0 -lgobject-2.0 -lglib-2.0 -lgstapp-1.0 -lgstbase-1.0 -lgstreamer-1.0 -lgobject-2.0 -lglib-2.0 -lgstbase-1.0 -lgstreamer-1.0 -lgobject-2.0 -lglib-2.0 -lgstpbutils-1.0 -lgstreamer-1.0 -lgobject-2.0 -lglib-2.0 -lgstreamer-1.0 -lgobject-2.0 -lglib-2.0 -lgstvideo-1.0 -lgstbase-1.0 -lgstreamer-1.0 -lgobject-2.0 -lglib-2.0 -lgstaudio-1.0 -lgstbase-1.0 -lgstreamer-1.0 -lgobject-2.0 -lglib-2.0 -lsqlite3 -licui18n -licuuc -licudata -lQt5Sql -lQt5Gui -lQt5Network -lQt5Core -lGL 
/tmp/.portage/portage/dev-qt/qtwebkit-5.6.0/work/qtwebkit-opensource-src-5.6.0/Source/WebKit//.obj/qt/WebCoreSupport/EditorClientQt.o: In function `WTF::ThreadSpecific<WebCore::ThreadGlobalData>::destroy(void*)':
EditorClientQt.cpp:(.text._ZN3WTF14ThreadSpecificIN7WebCore16ThreadGlobalDataEE7destroyEPv[_ZN3WTF14ThreadSpecificIN7WebCore16ThreadGlobalDataEE7destroyEPv]+0xe): undefined reference to `pthread_setspecific'
EditorClientQt.cpp:(.text._ZN3WTF14ThreadSpecificIN7WebCore16ThreadGlobalDataEE7destroyEPv[_ZN3WTF14ThreadSpecificIN7WebCore16ThreadGlobalDataEE7destroyEPv]+0x2b): undefined reference to `pthread_setspecific'
/tmp/.portage/portage/dev-qt/qtwebkit-5.6.0/work/qtwebkit-opensource-src-5.6.0/Source/WebKit//.obj/qt/WebCoreSupport/EditorClientQt.o: In function `WebCore::editorCommandForKeyDownEvent(WebCore::KeyboardEvent const*)':
EditorClientQt.cpp:(.text._ZN7WebCore28editorCommandForKeyDownEventEPKNS_13KeyboardEventE+0x23): undefined reference to `pthread_getspecific'
EditorClientQt.cpp:(.text._ZN7WebCore28editorCommandForKeyDownEventEPKNS_13KeyboardEventE+0x447): undefined reference to `pthread_key_create'
EditorClientQt.cpp:(.text._ZN7WebCore28editorCommandForKeyDownEventEPKNS_13KeyboardEventE+0x45c): undefined reference to `pthread_getspecific'
EditorClientQt.cpp:(.text._ZN7WebCore28editorCommandForKeyDownEventEPKNS_13KeyboardEventE+0x495): undefined reference to `pthread_setspecific'
/tmp/.portage/portage/dev-qt/qtwebkit-5.6.0/work/qtwebkit-opensource-src-5.6.0/Source/WebKit//.obj/qt/WebCoreSupport/NotificationPresenterClientQt.o: In function `WebCore::NotificationPresenterClientQt::notificationClicked(WebCore::NotificationWrapper*)':
NotificationPresenterClientQt.cpp:(.text._ZN7WebCore29NotificationPresenterClientQt19notificationClickedEPNS_19NotificationWrapperE+0x4b): undefined reference to `pthread_getspecific'
NotificationPresenterClientQt.cpp:(.text._ZN7WebCore29NotificationPresenterClientQt19notificationClickedEPNS_19NotificationWrapperE+0xb0): undefined reference to `pthread_key_create'
NotificationPresenterClientQt.cpp:(.text._ZN7WebCore29NotificationPresenterClientQt19notificationClickedEPNS_19NotificationWrapperE+0xe4): undefined reference to `pthread_setspecific'
/tmp/.portage/portage/dev-qt/qtwebkit-5.6.0/work/qtwebkit-opensource-src-5.6.0/Source/WebKit//.obj/qt/WebCoreSupport/NotificationPresenterClientQt.o: In function `WebCore::NotificationPresenterClientQt::removeReplacedNotificationFromQueue(WebCore::Notification*)':
NotificationPresenterClientQt.cpp:(.text._ZN7WebCore29NotificationPresenterClientQt35removeReplacedNotificationFromQueueEPNS_12NotificationE+0x14b): undefined reference to `pthread_getspecific'
NotificationPresenterClientQt.cpp:(.text._ZN7WebCore29NotificationPresenterClientQt35removeReplacedNotificationFromQueueEPNS_12NotificationE+0x1f4): undefined reference to `pthread_setspecific'
NotificationPresenterClientQt.cpp:(.text._ZN7WebCore29NotificationPresenterClientQt35removeReplacedNotificationFromQueueEPNS_12NotificationE+0x21d): undefined reference to `pthread_key_create'

(+ many more...)
Comment 18 Thomas Masper 2016-04-29 10:20:24 UTC
I can confirm that I can build successfully qtwebkit-5.6.0 after applying the patch shown here: 
https://codereview.qt-project.org/#/c/150601/1//ALL,unified

thomas
Comment 19 Dale 2016-04-30 02:04:18 UTC
I've got the same failure.  Mine started about a week or so ago.  If a dev needs some info to compare, let me know what to post.
Comment 20 cryptopsy 2016-04-30 06:43:08 UTC
How should we patch? Or will a the be updated soon enough and we should just wait?
Comment 21 Thomas Masper 2016-04-30 08:43:03 UTC
I just copied the patch file (I called the file "fix-libpthread.patch") in the path:
/etc/portage/patches/dev-qt/qtwebkit-5.6.0/
(just create the folders as needed), 
then run emerge as usual. Portage automatically applied the patch and build the package.

Don't know if it's the correct way to handle it but it works on my box!

thomas
Comment 22 cryptopsy 2016-04-30 10:48:13 UTC
what do i put in the patch file, patchset 1, or 2? I don't know how to use this patch, thanks.
Comment 23 cryptopsy 2016-04-30 15:02:49 UTC
I put the contents of this patch into /etc/portage/patches/dev-qt/qtwebkit-5.6.0/pthread.patch

patch:
http://code.qt.io/cgit/qt/qtwebkit.git/patch/?id=5f359baacdf92fabcece83f0a2b30f74c7c02a3c
Comment 24 cryptopsy 2016-04-30 15:20:11 UTC
Is it normal that PyQt5-5.5.1 pulsl in qtwebkit-5.6.0 ? shouldn't it pull in qtwebkit-5.5.1 ? And PyQt5-5.6.1 pull in qtwebkit-5.6.x ?
Comment 25 cryptopsy 2016-04-30 16:58:35 UTC
Created attachment 432718 [details]
build log bz2

With that patch at that location, it didn't succeed (build.log bz2 attached)
Comment 26 Thomas Masper 2016-04-30 19:01:39 UTC
(In reply to cryptopsy from comment #25)
> Created attachment 432718 [details]
> build log bz2
> 
> With that patch at that location, it didn't succeed (build.log bz2 attached)

Are you sure the patch is correctly applied? When you did merge can you see in the message that the patch is applied? From your log I cannot see any User patches applied, just "qtwebkit-5.4.2-system-leveldb.patch".
You should see a message like the one below (see the lines from "Applying patches from ..." to "* User patches applied.": fix-libpthread.patch is the patch that I copied from upstream). 

 * qtwebkit-opensource-src-5.6.0.tar.xz SHA256 SHA512 WHIRLPOOL size ;-) ...                                                                                                          [ ok ]
 >>> Unpacking source...
 >>> Unpacking qtwebkit-opensource-src-5.6.0.tar.xz to /var/tmp/portage/dev-qt/qtwebkit-5.6.0/work
 >>> Source unpacked in /var/tmp/portage/dev-qt/qtwebkit-5.6.0/work
 >>> Preparing source in /var/tmp/portage/dev-qt/qtwebkit-5.6.0/work/qtwebkit-opensource-src-5.6.0 ...
 * Applying qtwebkit-5.4.2-system-leveldb.patch ...                                                                                                                                   [ ok ]
 * Applying qtwebkit-5.2.1-disable-gstreamer.patch ...                                                                                                                                [ ok ]
 * Applying qtwebkit-5.5.1-disable-jit.patch ...                                                                                                                                      [ ok ]
 * Applying patches from /etc/portage/patches/dev-qt/qtwebkit-5.6.0 ...
 *   fix-libpthread.patch ...                                                                                                                                                         [ ok ]
 * User patches applied.
...

thomas
Comment 27 cryptopsy 2016-04-30 21:16:59 UTC
it doesn't seem like the patch is being applied, maybe i used the wrong patch?
Comment 28 cryptopsy 2016-04-30 21:58:04 UTC
my portage bashrc file has this, which should be sufficient, but i guess it isn't
# cat /etc/portage/bashrc 
post_src_prepare() {
    if type epatch_user &> /dev/null ; then
        epatch_user
    fi
}
Comment 29 Dale 2016-05-01 04:13:48 UTC
Created attachment 432738 [details, diff]
Patch file

I had trouble at first and finally got a patch that works.  It seems to lose something during copy and paste.  I had to use nano -w to edit and get it to work right.  File attached, I hope it is attached correctly.  Hope this helps others having problems.
Comment 30 cryptopsy 2016-05-01 08:53:34 UTC
grepping for epatch in the ebuild, it is not there, so /etc/portage/bashrc needs to be created according to this guid. 

https://wiki.gentoo.org/wiki//etc/portage/patches

but for me, it still does not load temp/build.log output
Comment 31 Davide Pesavento (RETIRED) gentoo-dev 2016-05-01 11:04:39 UTC
There's no need for bashrc. Qt >= 5.6.0 uses EAPI-6 ebuilds, which always call eapply_user, therefore support for user patching is *built-in* in all of them. In fact, that bashrc snippet does nothing in EAPI 6.

(In reply to cryptopsy from comment #20)
> How should we patch? Or will a the be updated soon enough and we should just
> wait?

Just wait. The patch will be committed as soon as possible (few days max).
Comment 32 Dale 2016-05-01 13:19:29 UTC
(In reply to cryptopsy from comment #30)
> grepping for epatch in the ebuild, it is not there, so /etc/portage/bashrc
> needs to be created according to this guid. 
> 
> https://wiki.gentoo.org/wiki//etc/portage/patches
> 
> but for me, it still does not load temp/build.log output

Right click the patch I included above and select save link target as.  I used the file name fix-libpthread.patch.  The end MUST be .patch from what I read.  Then create directories until you can place it in this path: 

/etc/portage/patches/dev-qt/qtwebkit-5.6.0/ 

For me, I had to create patches and on down since I have never done this before.  Once you put the file there, it should work.  I didn't change anything else.  It does not copy and paste well so saving the file itself should work better than copy and paste.  I'm on portage 2.2.28.  If needed, start a forum thread and post link here or post on gentoo-user and I'll try to help there to keep from cluttering up the roach report.  The only problem I had, the copy and paste problem.  It didn't indent and wrap correctly.  If it's not right, emerge pukes on your keyboard.
Comment 33 cryptopsy 2016-05-01 19:36:23 UTC
It still didn't work, i made a thread https://forums.gentoo.org/viewtopic-p-7914482.html
Comment 34 Davide Pesavento (RETIRED) gentoo-dev 2016-05-05 01:03:31 UTC
Fixed in git. Thanks everyone.

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6df5012422e5b2b2877819e52c1eb9457cafc80c