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

Bug 345635

Summary: Asterisk segfaults when openh323 and pwlib were built using -Wl,--as-needed
Product: Gentoo Linux Reporter: Grigoriy Puzankin <gpuzankin>
Component: [OLD] LibraryAssignee: Tony Vroon (RETIRED) <chainsaw>
Severity: normal CC: bug, esigra, voip+disabled
Priority: High    
Version: unspecified   
Hardware: AMD64   
OS: Linux   
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 129413    

Description Grigoriy Puzankin 2010-11-15 16:17:32 UTC
Asterisk dumps core when loading module compiled against emerged libraries pwlib and openh323 using -Wl,--as-needed.

I'm building Asterisk from original source code (1.6.2.x, 1.8.0) on x86_64. But it also happens on x86 platform too.

Reproducible: Always

Steps to Reproduce:
1. Emerge dev-libs/pwlib and net-libs/openh323 using -Wl,--as-needed (default).
2. Compile Asterisk with h323 support (bundled module chan_h323) against those libraries.
3. Asterisk dumps core when loading module.

Portage (default/linux/amd64/10.0, gcc-4.4.4, glibc-2.11.2-r0, 2.6.34-gentoo-r6 x86_64)
System uname: Linux-2.6.34-gentoo-r6-x86_64-Intel-R-_Core-TM-2_Quad_CPU_Q9400_@_2.66GHz-with-gentoo-1.12.13
Timestamp of tree: Tue, 26 Oct 2010 22:45:01 +0000
ccache version 2.4 [enabled]
app-shells/bash:     4.1_p7
dev-lang/python:     2.6.5-r3, 3.1.2-r4
dev-util/ccache:     2.4-r7
sys-apps/baselayout: 1.12.13
sys-apps/sandbox:    2.3-r1
sys-devel/autoconf:  2.65-r1
sys-devel/automake:  1.11.1
sys-devel/binutils:  2.20.1-r1
sys-devel/gcc:       4.4.4-r2
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.10
sys-devel/make:      3.81-r2
virtual/os-headers:  2.6.30-r1
CFLAGS="-march=native -O2 -pipe"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/eselect/postgresql /etc/gconf /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=native -O2 -pipe"
FEATURES="assume-digests ccache distlocks fixpackages news parallel-fetch protect-owned sandbox sfperms strict unmerge-logs unmerge-orphans userfetch"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="en ru"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
USE="acl amd64 bash-completion berkdb bzip2 cli cracklib crypt cups cxx diskio dri fortran gdbm gpm iconv idn ipv6 lm_sensors mmx modules mudflap multilib ncurses nls nptl nptlonly openmp pam pcre perl pppd python readline session sse sse2 ssl sysfs tcpd threads unicode xorg zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en ru" PHP_TARGETS="php5-2" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="fbdev glint intel mach64 mga neomagic nouveau nv r128 radeon savage sis tdfx trident vesa via vmware voodoo" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account" 
Comment 1 Grigoriy Puzankin 2010-11-15 16:18:14 UTC
Adding block to
Comment 2 Tony Vroon (RETIRED) gentoo-dev 2010-12-01 16:44:05 UTC
If you do not use the Asterisk ebuild, I can not support you.
Comment 3 Grigoriy Puzankin 2010-12-01 18:25:24 UTC
I have cleaned up previous Asterisk installation and built Asterisk from net-misc/asterisk- ebuild. Trying to load gives errors:

*CLI> module load
Unable to load module
Command 'module load ' failed.
*CLI> [Dec  1 21:18:32] WARNING[18363]: loader.c:387 load_dynamic_module: Error loading module '': /usr/lib/asterisk/modules/ undefined symbol: _ZNK7PObject7CompareERKS_

I know what it means. When building Asterisk from sources I can cleanup channels/h323 directory and rebuild module, but not with ebuild.

Also building Asterisk from sources gives the same error when pwlib and openh323 compiled with --as-needed option.
Comment 4 Tony Vroon (RETIRED) gentoo-dev 2010-12-06 10:55:43 UTC
There is no h323 support in the Asterisk ebuild as this is known broken. The only action I can take based on this bug report is to more aggressively obliterate the H323 support so that it never hits the disk.
(I still believe that the h323 module in question was produced by you and not the ebuild though)
Comment 5 Tony Vroon (RETIRED) gentoo-dev 2010-12-06 11:16:24 UTC
Unless I hear otherwise (i.e. in the form of patches that enable a demonstrably non-broken H323 module without relying on packages that have been masked for removal), the newest Asterisk patch set for 1.6.2 will contain a removal patch for the H323 configure checks & build system components. 
Comment 6 Tony Vroon (RETIRED) gentoo-dev 2011-09-20 07:47:44 UTC
+  20 Sep 2011; Tony Vroon <> asterisk-,
+  asterisk-
+  Explicitly block against the abandoned net-libs/openh323 package in the tree.
+  Closes bug #345635 by Grigoriy Puzankin and bug #383629 by Aidan Marks.