Bug 126862 - Libjingle: fixes bugs (incidently fixes build under BSD)
Summary: Libjingle: fixes bugs (incidently fixes build under BSD)
Status: RESOLVED WORKSFORME
Alias: None
Product: kopete
Classification: Applications
Component: Jabber Plugin (show other bugs)
Version: unspecified
Platform: FreeBSD Ports FreeBSD
: NOR crash
Target Milestone: ---
Assignee: Kopete Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-05-06 21:23 UTC by Mário Srgio Fujikawa Ferreira
Modified: 2008-07-04 01:20 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
add missing pthread_mutexattr_init() (588 bytes, patch)
2006-05-06 21:24 UTC, Mário Srgio Fujikawa Ferreira
Details
Add FreeBSD way of telling a socket to not fragment packets (550 bytes, patch)
2006-05-06 21:25 UTC, Mário Srgio Fujikawa Ferreira
Details
Add matching pthread_mutexattr_destroy() to pthread_mutexattr_init() (366 bytes, patch)
2006-05-06 21:26 UTC, Mário Srgio Fujikawa Ferreira
Details
Allow build with latest speex 1.0.5 (936 bytes, patch)
2006-05-06 21:27 UTC, Mário Srgio Fujikawa Ferreira
Details
Allow build with latest ortp 0.9.1 (514 bytes, patch)
2006-05-06 21:28 UTC, Mário Srgio Fujikawa Ferreira
Details
Allow build with latest ortp 0.9.1 (1.64 KB, patch)
2006-05-06 21:31 UTC, Mário Srgio Fujikawa Ferreira
Details
Allow build with latest ortp 0.9.1 (670 bytes, patch)
2006-05-06 21:32 UTC, Mário Srgio Fujikawa Ferreira
Details
Allow build with latest ortp 0.9.1 (701 bytes, patch)
2006-05-06 21:32 UTC, Mário Srgio Fujikawa Ferreira
Details
Add speex_bits_destroy() where appropriate (412 bytes, patch)
2006-05-06 21:33 UTC, Mário Srgio Fujikawa Ferreira
Details
Add speex_bits_destroy() where appropriate (394 bytes, patch)
2006-05-06 21:33 UTC, Mário Srgio Fujikawa Ferreira
Details
Add a missing return statement (360 bytes, patch)
2006-05-06 21:34 UTC, Mário Srgio Fujikawa Ferreira
Details
Rewrite a g_return_if_fail() as g_return_val_if_fail() (obtained from latest linphone 1.3.5) (457 bytes, patch)
2006-05-06 21:34 UTC, Mário Srgio Fujikawa Ferreira
Details
big patch without the BSD one (9.61 KB, patch)
2006-07-31 23:47 UTC, Gabriel C
Details
gthread.patch to be used with bug-126862-without_the_BSD_one.patch (3.67 KB, patch)
2006-07-31 23:49 UTC, Gabriel C
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mário Srgio Fujikawa Ferreira 2006-05-06 21:23:23 UTC
Version:           0.12 beta 2 (using KDE KDE 3.5.2)
Installed from:    FreeBSD Ports
Compiler:          gcc (GCC) 3.4.4 [FreeBSD] 20050518 
OS:                FreeBSD

* Enable libjingle to be built with the latest stable speex 1.0.5
* Enable libjingle to be built with the latest stable ortp 0.9.1
* Add a check to prevent libjingle start without a soundcard (it    crashes otherwise)
* Add speex_bits_destroy() where appropriate
* Add a missing return statement
* Rewrite a g_return_if_fail() as g_return_val_if_fail() (obtained from latest linphone 1.3.5)
* Pthread's specification conformance
  - Initialize pthread_mutexattr_t before using it (fix crash)
  - Add a matching pthread_mutexattr_destroy() for each pthread_mutexattr_init()
* Add the FreeBSD way of telling a socket not to fragment packets
Comment 1 Mário Srgio Fujikawa Ferreira 2006-05-06 21:24:42 UTC
Created attachment 15941 [details]
add missing pthread_mutexattr_init()

Fixes crash when VoIP connecion is initiated
Comment 2 Mário Srgio Fujikawa Ferreira 2006-05-06 21:25:23 UTC
Created attachment 15942 [details]
Add FreeBSD way of telling a socket to not fragment packets
Comment 3 Mário Srgio Fujikawa Ferreira 2006-05-06 21:26:38 UTC
Created attachment 15943 [details]
Add matching pthread_mutexattr_destroy() to pthread_mutexattr_init()
Comment 4 Mário Srgio Fujikawa Ferreira 2006-05-06 21:27:28 UTC
Created attachment 15944 [details]
Allow build with latest speex 1.0.5
Comment 5 Mário Srgio Fujikawa Ferreira 2006-05-06 21:28:41 UTC
Created attachment 15945 [details]
Allow build with latest ortp 0.9.1
Comment 6 Mário Srgio Fujikawa Ferreira 2006-05-06 21:31:38 UTC
Created attachment 15946 [details]
Allow build with latest ortp 0.9.1

Also, add a check to prevent libjingle start without a soundcard (it crashes
otherwise)
Comment 7 Mário Srgio Fujikawa Ferreira 2006-05-06 21:32:20 UTC
Created attachment 15947 [details]
Allow build with latest ortp 0.9.1
Comment 8 Mário Srgio Fujikawa Ferreira 2006-05-06 21:32:42 UTC
Created attachment 15948 [details]
Allow build with latest ortp 0.9.1
Comment 9 Mário Srgio Fujikawa Ferreira 2006-05-06 21:33:21 UTC
Created attachment 15949 [details]
Add speex_bits_destroy() where appropriate
Comment 10 Mário Srgio Fujikawa Ferreira 2006-05-06 21:33:52 UTC
Created attachment 15950 [details]
Add speex_bits_destroy() where appropriate
Comment 11 Mário Srgio Fujikawa Ferreira 2006-05-06 21:34:17 UTC
Created attachment 15951 [details]
Add a missing return statement
Comment 12 Mário Srgio Fujikawa Ferreira 2006-05-06 21:34:47 UTC
Created attachment 15952 [details]
Rewrite a g_return_if_fail() as g_return_val_if_fail() (obtained from latest linphone 1.3.5)
Comment 13 Mário Srgio Fujikawa Ferreira 2006-05-06 21:41:42 UTC
Furthermore, kopete 0.12 beta2 configure script should detect the existence of <sys/soundcard.h> so that libjingle knows there is an OSS system available. Similar checks should be done to define __ALSA_ENABLED__, __JACK_ENABLED__, HAVE_PORTAUDIO and HAVE_SYS_AUDIO_H. If none of these are found, libjingle will crash due to the lack of a soundcard.

Moreover,
  - Define both FEATURE_ENABLE_SSL and HAVE_SSL in config.h if ssl is properly detected
  - If you are going to strictly follow the libjingle distribution, FEATURE_ENABLE_CHAT_ARCHIVING should also be defined in config.h. It is always defined on the standard libjingle distribution.

I have verified that kopete 0.12 beta2 works with the latest libjingle 0.3.0 instead of the old one shipped with kopete. Let me know if you need any help. The FreeBSD port of net-im/kopete should have an option to build with the latest libjingle instead of the old version.

Comment 14 Mário Srgio Fujikawa Ferreira 2006-05-06 21:48:09 UTC
These patches have been submitted to libjingle developers but they have been ignored so far.
Comment 15 Tom Shaw 2006-05-09 07:21:02 UTC
I tried all the patches on the latest svn here but it wouldn't compile with the
four "latest ortp" patches and the "latest speex" patch. This is with
ortp-0.9.1 and speex-1.1.12.

If I exclude those five patches and keep the others it compiles
fine with ortp-0.7.1.

This is the error I get with all the patches. 
/bin/sh ../../../libtool --silent --mode=link --tag=CXX i686-pc-linux-gnu-g++  -Wno-long-long -Wundef -ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align -Wconversion -Wchar-subscripts -Wall -W -Wpointer-arith -g3 -fno-inline -march=athlon-xp -O3 -msse2 -fprefetch-loop-arrays -ftracer -pipe -Wformat-security -Wmissing-format-attribute -Wno-non-virtual-dtor -fno-exceptions -fno-check-new -fno-common -DQT_CLEAN_NAMESPACE -DQT_NO_ASCII_CAST -DQT_NO_STL -DQT_NO_COMPAT -DQT_NO_TRANSLATION   -Wl,-O1 -o kopete_jabber.la -rpath /usr/lib/kde3 -no-undefined -Wl,--no-undefined -Wl,--allow-shlib-undefined -module -avoid-version -module -no-undefined -Wl,--no-undefined -Wl,--allow-shlib-undefined -R /usr/lib -R /usr/kde/3.5/lib -R /usr/qt/3/lib -R /usr/lib -R /usr/kde/3.5/lib  -L/usr/kde/3.5/lib -L/usr/qt/3/lib -L/usr/lib    -L/usr/kde/3.5/lib jabberprotocol.lo jabberaccount.lo jabberresource.lo jabberresourcepool.lo jabberbasecontact.lo jabbercontact.lo jabbergroupcontact.lo jabbergroupmembercontact.lo jabbercontactpool.lo jabberformtranslator.lo jabberformlineedit.lo jabberchatsession.lo jabbergroupchatmanager.lo jabberfiletransfer.lo jabbercapabilitiesmanager.lo jabbertransport.lo jabberbookmarks.lo ../../../kopete/libkopete/libkopete.la ui/libkopetejabberui.la libiris/iris/include/libiris.la libiris/iris/jabber/libiris_jabber.la libiris/iris/xmpp-core/libiris_xmpp_core.la libiris/iris/xmpp-im/libiris_xmpp_im.la libiris/qca/src/libqca.la libiris/cutestuff/network/libcutestuff_network.la libiris/cutestuff/util/libcutestuff_util.la libjabberclient.la jingle/libkopetejabberjingle.la
jingle/.libs/libkopetejabberjingle.a(ms.o): In function `ms_init':
/var/tmp/portage/kopete-svn-0.12.20060507/work/0.12.20060507/kopete/protocols/jabber/jingle/libjingle/talk/third_party/mediastreamer/ms.c:53: undefined reference to `g_thread_init'
collect2: ld returned 1 exit status
make[5]: *** [kopete_jabber.la] Error 1

Some system info.

gcc-3.4.5, glibc-2.3.6-r3, 2.6.16-ck9 i686
dev-lang/python:     2.4.3-r1
dev-python/pycrypto: 2.0.1-r5
dev-util/ccache:     2.4-r1
dev-util/confcache:  [Not Present]
sys-apps/sandbox:    1.2.18
sys-devel/autoconf:  2.13, 2.59-r7
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2
sys-devel/binutils:  2.16.1-r2
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.11-r5
CFLAGS="-march=athlon-xp -O3 -msse2 -fprefetch-loop-arrays -ftracer -pipe"
CHOST="i686-pc-linux-gnu"

Comment 16 Mário Srgio Fujikawa Ferreira 2006-05-10 14:28:40 UTC
The thing is I forgot to add a few little tweaks I do internally on the FreeBSD port of kopete 0.12 beta 2.

If you replace all occurences of glib-2.0 with gthread-2.0 glib-2.0 on the configure script, it builds like a charm.

Here is the FreeBSD patch:

# force usage of gthread for libjingle's benefit
cp configure configure.bak
sed -E -e 's|(glib-2.0)|gthread-2.0 \1|' configure.bak > configure
Comment 17 Oleg Girko 2006-06-05 23:18:31 UTC
Does anyone know the reason why these patches was not integrated into Kopete 0.12?
Comment 18 Matt Rogers 2006-06-06 01:42:30 UTC
I've heard that they cause other problems such as crashes and things of that 
nature, but i'm not certain.
Comment 19 Oleg Girko 2006-06-06 11:53:35 UTC
I think that this should be investigated more thoroughly, and if these patches break things, these things should be fixed, not patches rejected.
Most Linux distributions come with oRTP much newer than version 0.7.1, and requiring exactly this version makes building Kopete with Jingle support prohibitively painful (see bug #128698).
Comment 20 Olivier Goffart 2006-06-14 09:33:51 UTC
Have theses patch been tested, and does they works ?
I am unable to test them personally.

Please make a big single patch, that i could eventually commit
Comment 21 Gabriel C 2006-07-31 23:47:40 UTC
Created attachment 17189 [details]
big patch without the BSD one

Hi Gof I've made this patch from the small ones in this bug report without the
BSD one.I've tested kopete ( stable not SVN ) with this patch and I see no
difference :) same as 0.7.* ortp sometimes crashes , sometimes just does not
work but mabye is just me :P so feel free to test it :)

PS: you need gthread.patch as well to get kopete to compile
Comment 22 Gabriel C 2006-07-31 23:49:08 UTC
Created attachment 17190 [details]
gthread.patch to be used with bug-126862-without_the_BSD_one.patch
Comment 23 Will Stephenson 2006-08-30 12:06:25 UTC
gthread.patch from comment #22 patches configure as well as its sources...
But I'll see if this fixes the deadlock on connect problem that I see without it.
Comment 24 Will Stephenson 2006-08-31 14:07:59 UTC
No deadlock, established connection, but the other party could not hear me, nor could I hear them. 

Has anyone else got any tips how to get this working?  I wanted to get this mature enough to enable by default, but DarkShock (Michael) does not want to work on it at the moment, and I am not familiar with voice at all, so I'll probably give up for now.
Comment 25 Michael Gorven 2006-09-19 18:19:48 UTC
*** This bug has been confirmed by popular vote. ***
Comment 26 Christophe Marin 2008-07-04 01:17:48 UTC
Closing this bug which isn't one :)
Comment 27 Christophe Marin 2008-07-04 01:20:50 UTC
Note : The jingle support has been removed but should be back soon.