EionRobb / skype4pidgin

Skype Plugin for Pidgin, libpurple and more
https://github.com/EionRobb/skype4pidgin/tree/master/skypeweb#skypeweb-plugin-for-pidgin
624 stars 88 forks source link

[skypeweb] libpurple-3 support broken #614

Closed jderehag closed 6 years ago

jderehag commented 6 years ago

Seems like the libpurple-3 support is broken (has it ever worked?).

$> git checkout 1.4 # which should have worked $>make cc -fPIC -O2 -g -pipe -shared -o libskypeweb3.so libskypeweb.c skypeweb_connection.c skypeweb_contacts.c skypeweb_login.c skypeweb_messages.c skypeweb_util.c pkg-config purple-3 glib-2.0 json-glib-1.0 zlib --libs --cflags -g -ggdb

skypeweb_util.c:21:32: fatal error: ciphers/sha256hash.h: No such file or directory

include "ciphers/sha256hash.h"

$>find . -name "sha256hash.h" ./purple2compat/ciphers/sha256hash.h

So apparently its in the purple2compat dir, (which is not in the include path for purple3, see CC line above).

When switching to 1.5 we get additional errors: $>git checkout 1.5 $>make clean; make rm -f libskypeweb3.so cc -fPIC -O2 -g -pipe -shared -o libskypeweb3.so libskypeweb.c skypeweb_connection.c skypeweb_contacts.c skypeweb_login.c skypeweb_messages.c skypeweb_util.c pkg-config purple-3 glib-2.0 json-glib-1.0 zlib --libs --cflags -g -ggdb

skypeweb_login.c: In function ‘skypeweb_skyper_hash’: skypeweb_login.c:392:9: warning: implicit declaration of function ‘purple_base64_encode’ [-Wimplicit-function-declaration] return purple_base64_encode(hashed, len); ^ skypeweb_login.c:392:9: warning: return makes pointer from integer without a cast [-Wint-conversion] skypeweb_util.c:21:32: fatal error: ciphers/sha256hash.h: No such file or directory

include "ciphers/sha256hash.h"

                            ^

compilation terminated. Makefile:92: recipe for target 'libskypeweb3.so' failed make: *** [libskypeweb3.so] Error 1

So now we have an additional warning for purple_base64_encode, which it seems was removed from libpurple in revision 38894 (havent figured out exactly why they removed it). But I suspect you should use glib base64 encode directly.

EionRobb commented 6 years ago

Ah yup, we should be using glib for hashing https://developer.gnome.org/glib/stable/glib-Data-Checksums.html and glib for base64 https://developer.gnome.org/glib/stable/glib-Base64-Encoding.html#g-base64-encode

There's a big move to get rid of unnecessary code out of Pidgin and libpurple, and these two were part of that.

jderehag commented 6 years ago

I suspect alot of that code can actually be removed from the purple2compat layer altogether? Those functions should be available in glib either way, so switching should work for both purple2 & 3?

EionRobb commented 6 years ago

Can you give https://github.com/EionRobb/skype4pidgin/commit/d192665b8ff362c956cf7ab801730c9f736559c4 a try?

jderehag commented 6 years ago

---------------- Edit ----------------- Everything worked up until I closed pidgin where we got an assert.

(08:19:08) plugins: Unloading plugin /usr/lib/purple-3/libskypeweb3.so
(08:19:08) protocols: Removing protocol prpl-skypeweb
Error in `pidgin': free(): invalid size: 0x00007ffea6ac3260
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x777e5)[0x7f838755b7e5]
/lib/x86_64-linux-gnu/libc.so.6(+0x8037a)[0x7f838756437a]
/lib/x86_64-linux-gnu/libc.so.6(cfree+0x4c)[0x7f838756853c]
/usr/lib/libpurple.so.20(+0x99089)[0x7f8381f7c089]
/usr/lib/libpurple.so.20(+0x9922a)[0x7f8381f7c22a]
/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0(g_object_unref+0x19a)[0x7f83825a2d9a]
/lib/x86_64-linux-gnu/libglib-2.0.so.0(+0x3866a)[0x7f8387b0366a]
/usr/lib/libpurple.so.20(purple_protocols_remove+0xc2)[0x7f8381f7f572]
/usr/lib/purple-3/libskypeweb3.so(gplugin_unload+0x33)[0x7f835b162663]
/usr/lib/x86_64-linux-gnu/libgplugin.so.0(+0xa719)[0x7f83870d1719]
/usr/lib/x86_64-linux-gnu/libgplugin.so.0(gplugin_loader_unload_plugin+0xc7)[0x7f83870cc527]
/usr/lib/x86_64-linux-gnu/libgplugin.so.0(+0x5803)[0x7f83870cc803]
/usr/lib/libpurple.so.20(purple_plugin_unload+0x6b)[0x7f8381f71b5b]
/usr/lib/libpurple.so.20(purple_plugins_uninit+0x3a)[0x7f8381f734ca]
/usr/lib/libpurple.so.20(purple_core_quit+0xb5)[0x7f8381f4d815]
/usr/lib/libpidgin.so.20(+0xbf37e)[0x7f8387e9b37e]
/lib/x86_64-linux-gnu/libglib-2.0.so.0(g_main_context_dispatch+0x15a)[0x7f8387b1504a]
/lib/x86_64-linux-gnu/libglib-2.0.so.0(+0x4a3f0)[0x7f8387b153f0]
/lib/x86_64-linux-gnu/libglib-2.0.so.0(g_main_loop_run+0xc2)[0x7f8387b15712]
/usr/lib/x86_64-linux-gnu/libgtk-3.so.0(gtk_main+0x85)[0x7f83839fc395]
/usr/lib/libpidgin.so.20(pidgin_start+0xa14)[0x7f8387e9be04]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0)[0x7f8387504830]
pidgin(_start+0x29)[0x4008b9]


EionRobb commented 6 years ago

@jderehag That looks like it might be a different issue? Can you open a new issue on github and get a backtrace with debug symbols?