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

libpurple backend hangs when MySQL support is enabled #150

Open
vitalyster opened this Issue Jun 8, 2016 · 7 comments

Comments

Projects
None yet
2 participants
@vitalyster
Collaborator

vitalyster commented Jun 8, 2016

Started from 84814a1 it hangs there:

#0  0x00007f76ab2aa4db in pthread_join (threadid=140147412866816, thread_return=0x0) at pthread_join.c:92
#1  0x00007f76a911babc in my_thread_global_init () from /usr/lib/x86_64-linux-gnu/libmysqlclient.so.18
#2  0x00007f76a91195d0 in my_init () from /usr/lib/x86_64-linux-gnu/libmysqlclient.so.18
#3  0x00007f76acc049ba in call_init (l=<optimized out>, argc=argc@entry=9, argv=argv@entry=0x7ffc0ded0ab8, env=env@entry=0x7ffc0ded0b08) at dl-init.c:78
#4  0x00007f76acc04aa3 in call_init (env=0x7ffc0ded0b08, argv=0x7ffc0ded0ab8, argc=9, l=<optimized out>) at dl-init.c:36
#5  _dl_init (main_map=main_map@entry=0x1c53a40, argc=9, argv=0x7ffc0ded0ab8, env=0x7ffc0ded0b08) at dl-init.c:126
#6  0x00007f76acc08c08 in dl_open_worker (a=a@entry=0x7ffc0ded0078) at dl-open.c:577
#7  0x00007f76acc04874 in _dl_catch_error (objname=objname@entry=0x7ffc0ded0068, errstring=errstring@entry=0x7ffc0ded0070,
    mallocedp=mallocedp@entry=0x7ffc0ded0067, operate=operate@entry=0x7f76acc08930 <dl_open_worker>, args=args@entry=0x7ffc0ded0078) at dl-error.c:187
#8  0x00007f76acc083fb in _dl_open (file=0x1c52d90 "/usr/lib/purple-2/perl.so", mode=-2147483646, caller_dlopen=<optimized out>, nsid=-2, argc=9,
    argv=0x7ffc0ded0ab8, env=0x7ffc0ded0b08) at dl-open.c:661
#9  0x00007f76a786502b in dlopen_doit (a=a@entry=0x7ffc0ded0290) at dlopen.c:66
#10 0x00007f76acc04874 in _dl_catch_error (objname=0x1c4c940, errstring=0x1c4c948, mallocedp=0x1c4c938, operate=0x7f76a7864fd0 <dlopen_doit>,
    args=0x7ffc0ded0290) at dl-error.c:187
#11 0x00007f76a78655dd in _dlerror_run (operate=operate@entry=0x7f76a7864fd0 <dlopen_doit>, args=args@entry=0x7ffc0ded0290) at dlerror.c:163
#12 0x00007f76a78650c1 in __dlopen (file=<optimized out>, mode=<optimized out>) at dlopen.c:87
#13 0x00007f76aba04942 in g_module_open () from /usr/lib/x86_64-linux-gnu/libgmodule-2.0.so.0
#14 0x00007f76ac194c8d in purple_plugin_probe () from /usr/lib/libpurple.so.0
#15 0x00007f76ac1952de in purple_plugins_probe () from /usr/lib/libpurple.so.0
#16 0x00007f76ac177dc8 in purple_core_init () from /usr/lib/libpurple.so.0
#17 0x000000000044be32 in initPurple () at /home/vt/spectrum2/packaging/debian/spectrum2-2163-55221a7/backends/libpurple/main.cpp:2136
#18 0x000000000044d16f in main (argc=9, argv=0x7ffc0ded0ab8) at /home/vt/spectrum2/packaging/debian/spectrum2-2163-55221a7/backends/libpurple/main.cpp:2279

Disabling MySQL support prevent hanging.

@vitalyster vitalyster added the Bug label Jun 8, 2016

@vitalyster

This comment has been minimized.

Collaborator

vitalyster commented Jun 8, 2016

@vitalyster

This comment has been minimized.

Collaborator

vitalyster commented Jun 9, 2016

libmariadbclient does not have this problem

@dequis

This comment has been minimized.

dequis commented Jul 21, 2016

libmysqlclient 5.6 and 5.7 don't have this problem either.

libmysqlclient 5.5 does have this problem.

@dequis

This comment has been minimized.

dequis commented Jul 21, 2016

The part of that commit that breaks it is adding transport to target_link_libraries of the libpurple backend.

diff --git a/backends/libpurple/CMakeLists.txt b/backends/libpurple/CMakeLists.txt
index cbf2575..0a15fd2 100644
--- a/backends/libpurple/CMakeLists.txt
+++ b/backends/libpurple/CMakeLists.txt
@@ -7,7 +7,7 @@ if(MSVC)
 target_link_libraries(spectrum2_libpurple_backend sqlite3 ${PURPLE_LIBRARY} ${GLIB2_LIBRARIES} ${LIBXML2_LIBRARIES} ${EVENT_LIBRARIES} transport-plugin ${PROTOBUF_LIBRARY})
 else()
        if (NOT WIN32)
-       target_link_libraries(spectrum2_libpurple_backend ${PURPLE_LIBRARY} ${GLIB2_LIBRARIES} ${EVENT_LIBRARIES} transport-plugin pthread)
+       target_link_libraries(spectrum2_libpurple_backend transport ${PURPLE_LIBRARY} ${GLIB2_LIBRARIES} ${EVENT_LIBRARIES} transport-plugin pthread)
        else()
        target_link_libraries(spectrum2_libpurple_backend ${PURPLE_LIBRARY} ${GLIB2_LIBRARIES} ${EVENT_LIBRARIES} transport-plugin)
        endif()
@vitalyster

This comment has been minimized.

Collaborator

vitalyster commented Jul 21, 2016

libpurple backend now have access to db, so db libraries must be linked

@vitalyster

This comment has been minimized.

Collaborator

vitalyster commented Jan 20, 2017

I just realized: when using libpurple with mysql private headers in path it includes plugin.h from mysql private headers. (newer mysql doesn't have plugin.h) How to prevent this?

@vitalyster

This comment has been minimized.

Collaborator

vitalyster commented Jan 20, 2017

replacing #include <plugin.h> with #include "plugin.h" in libpurple.h fixes the problem

vitalyster added a commit that referenced this issue Sep 1, 2017

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