Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 55447 - Gaim's perl scripts generate "Attempted to free Unreferenced Scalars" on buddy join/leave
Summary: Gaim's perl scripts generate "Attempted to free Unreferenced Scalars" on budd...
Status: RESOLVED CANTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Gentoo Net-im project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-06-28 10:33 UTC by Wallex
Modified: 2006-01-08 06:23 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
Sample perl plugin that does nothing. (sample.pl,701 bytes, text/plain)
2004-06-28 10:35 UTC, Wallex
Details
My test perl plugin (don.pl,932 bytes, text/plain)
2004-06-30 07:11 UTC, Don Seiler (RETIRED)
Details
updated example with Connection handler (don.pl,1.20 KB, text/plain)
2004-06-30 10:53 UTC, Don Seiler (RETIRED)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Wallex 2004-06-28 10:33:55 UTC
I get these messages each time a buddy log ins/out from Gaim:
Attempt to free unreferenced scalar: SV 0x557719fc.
Attempt to free unreferenced scalar: SV 0x557719f0.
Attempt to free unreferenced scalar: SV 0x557d3b0c.
Attempt to free unreferenced scalar: SV 0x557719fc.
Attempt to free unreferenced scalar: SV 0x557719f0.
(one line per buddy), I've tried trimming down the perl script to the minimum necessary (it does NOTHING), yet the message persists. I fear this compromises Gaim's stability, for it tends to crash more often when any perl plugin is loaded. I've had this problem since I started using perl plugins for gaim (v .77, I think. I just emerged .79 today and it's still there). 
I have no idea why I haven't found any other reports of this around, maybe it's just some obscure combination setting on my machine? Is there something else I should try changing, re-emerging? (I've reemerged perl and gaim to no avail)
(Never used Perl before, so hope it's not a stupid problem on the code of the script, but I did used reference and searched around on how to write perl plugins for gaim, even though the documentation on the issue is... lacking, shall we say).

Reproducible: Always
Steps to Reproduce:
1. Load perl plugin.
2. Wait for a buddy to sign-in
3. Check stderr output.

Actual Results:  
Got the "attempt to free unreferenced scalar" message.

Expected Results:  
Display no warnings/errors.

Using Gaim 0.79 (USE: cjk, crypt, perl, spell)/ Perl 5.8.2-r1 (USE: berkdb,
gdbm, threads) on a AMD XP 2500 system.

emerge info:
Portage 2.0.50-r8 (default-x86-1.4, gcc-3.3.3, glibc-2.3.3.20040420-r0,
2.4.26-gentoo-r3)
=================================================================
System uname: 2.4.26-gentoo-r3 i686 AMD Athlon(tm) XP 2500+
Gentoo Base System version 1.4.16
Autoconf: sys-devel/autoconf-2.59-r3
Automake: sys-devel/automake-1.8.3
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CFLAGS="-march=athlon-xp -O3 -pipe -fomit-frame-pointer -finline-functions
-finline-limit=600 -mfpmath=387 -ffast-math -ftracer -funroll-loops
-fprefetch-loop-arrays -freduce-all-givs"
CHOST="i686-pc-linux-gnu"
COMPILER="gcc3"
CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config
/usr/kde/3/share/config /usr/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-march=athlon-xp -O3 -pipe -fomit-frame-pointer -finline-functions
-finline-limit=600 -mfpmath=387 -ffast-math -ftracer -funroll-loops
-fprefetch-loop-arrays -freduce-all-givs"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs ccache digest sandbox userpriv"
GENTOO_MIRRORS="ftp://mirrors.sec.informatik.tu-darmstadt.de/gentoo/
ftp://ftp.tu-clausthal.de/pub/linux/gentoo/ http://128.213.5.34/gentoo/
http://mirror.datapipe.net/gentoo http://gentoo.binarycompass.org"
MAKEOPTS="-j2 -s"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY=""
SYNC="rsync://rsync.samerica.gentoo.org/gentoo-portage"
USE="# #Gcc #Specific #Usagi #Zsh 2.6 3dnow Claws Cups End Gentoo-Kernel Gimp
Glibc I IPv6 Mozilla Ntp Perl Related Sylpheed USE Vim X acpi acpi4linux alsa
apm avi because berkdb canna cap cdr cjk crypt cscope cups dga dillo dvd encode
erandom fam fbcon flac for freewnn gd gdbm gif gimpprint ginac gpm gtk gtk2 imap
imlib innodb is jabber jikes jpeg kerberos kernel libg++ libwww listing mad mbox
mikmod mmx moznocompose moznoirc moznomail mpeg ncurses need objc oggvorbis
opengl pam parse-clocks pcre pdflib perl png ppds python quicktime readline
samba scanner sdl slang spell sse ssl support svga tags tcltk tcpd theora
threads tiff truetype unicode usagi usb use vim-with-x vimdiff! wait wmf x86
xface xml xml2 xmms xv zlib"
Comment 1 Wallex 2004-06-28 10:35:31 UTC
Created attachment 34338 [details]
Sample perl plugin that does nothing.
Comment 2 Wallex 2004-06-28 13:03:09 UTC
Oh.. tried running Gaim after compiling it with USE="debug" and "gaim -v", and the surrounding lines of where the buddy joins and the unreferenced scalar message pops up are:

prefs: writing prefs out to disk.
oscar: removing chatnav input watcher
Attempt to free unreferenced scalar: SV 0x82e32b8.
perl: ret_val = (nil)
dns: Successfully sent DNS request to child 20929
Attempt to free unreferenced scalar: SV 0x82e32d0.
perl: ret_val = (nil)
dns: Host '205.188.7.38' resolved
proxy: Connecting to 205.188.7.38:5190 with no proxy
proxy: Connect would have blocked.

So.. um, the unreferenced scalar is a return value of nil? (Wished I knew more about perl)
Comment 3 Don Seiler (RETIRED) gentoo-dev 2004-06-29 07:47:37 UTC
Indulge me for a second and cut your CFLAGS down to this:

-march=athlon-xp -O3 -pipe

Then rebuild perl, gtk+ and gaim (in that order) and try again.
Comment 4 Wallex 2004-06-29 11:02:29 UTC
Nope.. no good.
My current perl + gtk+ + gaim combo is: 
CHOST="i686-pc-linux-gnu"
CFLAGS="-march=athlon-xp -pipe"

emerge -av perl gtk+ gaim

These are the packages that I would merge, in order:

Calculating dependencies ...done!
[ebuild   R   ] dev-lang/perl-5.8.2-r1  +berkdb -doc +gdbm +threads -uclibc  0 kB 
[ebuild   R   ] x11-libs/gtk+-2.4.1  -doc +jpeg +tiff  0 kB 
[ebuild   R   ] net-im/gaim-0.79  +cjk +crypt +debug -gnutls -nas -nls +perl -silc +spell  0 kB 

And I still get (from gaim -d):
Attempt to free unreferenced scalar: SV 0x82e60c8.
perl: ret_val = (nil)
from each buddy that joins... so the issue is not within the compilation flags. Perhaps it needs deeper debugging (even though I haven't used gdb before...)
Comment 5 Don Seiler (RETIRED) gentoo-dev 2004-06-30 06:54:30 UTC
I'm able to use the fortuneprofile.pl plugin just fine with no errors.  I don't know much about Gaim perl plugins to look at your code but are you certain there are no problems with it?
Comment 6 Don Seiler (RETIRED) gentoo-dev 2004-06-30 06:56:05 UTC
Also what about libperl.
Comment 7 Don Seiler (RETIRED) gentoo-dev 2004-06-30 07:11:39 UTC
Created attachment 34485 [details]
My test perl plugin

I made a test plugin based on the instructions at
http://gaim.sourceforge.net/api/perl-howto.html and it works fine.  Try this
one out and let me know what you get.
Comment 8 Wallex 2004-06-30 07:57:52 UTC
The "My Test perl plugin" works fine with no "unreferenced scalar" messages, but on the same perl-writing how-to page a little below says how to handle Gaim signals, and using THAT sample code there it will print out the unreferenced scalar message. Either the documentation is outdated and it doesn't really states how to write a Perl plugin that can do handles correctly, or there's something broken somewhere (I admit I don't know how to write code in perl, but I used as base ANOTHER plugin that did something similar to what I wanted, and that one also had the same issue).
If someone can provide a sample perl plugin that uses the connection handle and it doesn't reports any issues, then I'll be dumb and admit defeat. I'll go look for other Gaim perl plugins in the meantime and see if any of them does it right.

libperl? Ok I'll go reemerge that with minimal C flags (but does this means I also have to reemerge perl, gtk and gaim afterwards?)
Comment 9 Don Seiler (RETIRED) gentoo-dev 2004-06-30 08:06:05 UTC
OK using their signal example I get this in my log:

perl: ret_val = (nil)

But otherwise everything else looks fine.  I get no messages about scalars at all.
Comment 10 Don Seiler (RETIRED) gentoo-dev 2004-06-30 08:08:34 UTC
I don't think you'll need to re-merge gtk+ or gaim but it couldn't hurt.
Comment 11 Wallex 2004-06-30 10:05:13 UTC
emerge -av --oneshot libperl perl glib gtk+ gaim

These are the packages that I would merge, in order:

Calculating dependencies ...done!
[ebuild   R   ] sys-devel/libperl-5.8.2  +berkdb +debug +gdbm +threads  0 kB 
[ebuild   R   ] dev-lang/perl-5.8.2-r1  +berkdb -doc +gdbm +threads -uclibc  0 kB 
[ebuild   R   ] dev-libs/glib-2.4.1  -doc  0 kB 
[ebuild   R   ] x11-libs/gtk+-2.4.1  -doc +jpeg +tiff  0 kB 
[ebuild   R   ] net-im/gaim-0.79  +cjk +crypt +debug -gnutls -nas -nls +perl -silc +spell  0 kB 

Using CFLAGS="-march=athlon-xp -pipe"

And the problem persists. I doubt I messed up the perl plugin syntax, could someone attach an example I can use which uses connection handles? (At least now I know the problem never happens with timers, but only on callbacks for Connection handles). Apparently this is just some rare obscure bug that only I am victim to and noone will be able to track down...
Comment 12 Don Seiler (RETIRED) gentoo-dev 2004-06-30 10:53:48 UTC
Created attachment 34505 [details]
updated example with Connection handler

Here I've completed the perl-howto with the Connection handler for when you
sign-on.  It works fine for me.  I get the "nil" debug output, but no scalar
warnings or errors.
Comment 13 Wallex 2004-06-30 11:09:16 UTC
Yep... it's definitely a problem on my end and not in the plugin, for that updated plugin still causes the "unreferenced scalar messages".

Altough now I don't know what could be done to track down the cause... for all the related packages are already compilized with minimum CFLAGS (I don't even use -O), so it's likely a very obscure issue that noone else has encountered before...
Comment 14 Don Seiler (RETIRED) gentoo-dev 2004-07-30 07:53:04 UTC
Is this still happening for you?  My latest revision of gaim-0.80 filters out all unstable C[XX]FLAGS, although if you're problem is in a deep dependency it might not matter.
Comment 15 Wallex 2004-07-31 08:11:33 UTC
Yes it's still there... I did an emerge -Duav world last night, and nothing has changed with version 0.80. It isn't a CFLAG issue since I did a while "emerge -Deav gaim" before using as the sole "CFLAG= march=athlon-xp pipe". (unless the cause is the athlon-xp flag itself?)
This is a memory leak kind of problem, I noticed my swap gets filled up in a matter of days, and closing Gaim "freezes" X for some time while it is doing who knows what with memory and thrasing my disk to no end.
Comment 16 Ronald Hill 2005-02-12 22:59:59 UTC
I've been researching this out on the Internet, and it actually appears that since perl version > 5.2, perl gaim plugins haven't worked properly. It's apparently not limited Also, reading item 3 on the lastest news post on http://gaim.sourceforge.net, as well as http://sourceforge.net/mailarchive/forum.php?thread_id=6290972&forum_id=9587, the gaim developers have stated that perl scripting capability is fading from gaim pretty fast. If there's anything I can do to help, I'd be happy to try it. Below is a copy of my version info, as well as an attempt to use the Gaim module in Perl:

*  dev-lang/perl
      Latest version available: 5.8.6-r2
      Latest version installed: 5.8.6-r2
*  sys-devel/libperl
      Latest version available: 5.8.6
      Latest version installed: 5.8.6
rhill@gentoo1 ~ $ perl -e 'use Gaim;'
perl: symbol lookup error: /usr/lib/perl5/vendor_perl/5.8.6/i686-linux/auto/Gaim/Gaim.so: undefined symbol: gaim_perl_callXS

rhill@gentoo1 ~ $ emerge --info
Portage 2.0.51-r15 (default-linux/x86/2004.3, gcc-3.4.3, glibc-2.3.4.20041102-r0, 2.6.10-gentoo-r6 i686)
=================================================================
System uname: 2.6.10-gentoo-r6 i686 AMD Athlon(tm) XP 2000+
Gentoo Base System version 1.6.9
Python:              dev-lang/python-2.3.4 [2.3.4 (#1, Jan 11 2005, 04:29:45)]
dev-lang/python:     2.3.4
sys-devel/autoconf:  2.59-r6, 2.13
sys-devel/automake:  1.7.9-r1, 1.8.5-r3, 1.5, 1.4_p6, 1.6.3, 1.9.4
sys-devel/binutils:  2.15.92.0.2-r2
sys-devel/libtool:   1.5.10-r4
virtual/os-headers:  2.6.8.1-r2
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CFLAGS="-march=athlon-xp -O2 -fomit-frame-pointer -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.3/env /usr/kde/3.3/share/config /usr/kde/3.3/shutdown /usr/kde/3/share/config /usr/lib/X11/xkb /usr/lib/mozilla/defaults/pref /usr/share/config /usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/ /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-march=athlon-xp -O2 -fomit-frame-pointer -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs autoconfig ccache distlocks sandbox sfperms"
GENTOO_MIRRORS="http://gentoo.ccccom.com http://mirror.datapipe.net/gentoo ftp://ftp.ucsb.edu/pub/mirrors/linux/gentoo/ http://mirror.datapipe.net/gentoo http://mirrors.acm.cs.rpi.edu/gentoo/"
LANG="en_US"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/home/rhill/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="x86 16bit S3TC X X509 aac aalib acl acpi activefilter aim alsa amd ansi apache2 apm arts artworkextra audiofile authdaemond avantgo avi bash-completion bcmath bdf berkdb bidi bitmap-fonts blender-game bluetooth bzip2 bzlib cap cddb cdinstall cdparanoia cdr cdrom cgi chroot cjk clanJavaScript clanVoice client code crypt encode esd f77 fam flac font-server foomaticdb fortran gdbm gif gnome gpm gstreamer gtk gtk2 imagemagick imap imlib ipv6 jack java jpeg jython kadu-modules kadu-voice kakasi kerberos krb4 latex lcms leim libclamav libdsk libg++ libgd libgda libsamplerate libwww live lua lufsusermount lzo lzw lzw-tiff m17n-lib mad maildir matroska mbox mcal mdb memlimit migemo mikmod mime mixer mjpeg mls mmap mng monkey motif mozcalendar mozdevelop mozilla mozp3p mozsvg mozxmlterm mp3 mpeg mpeg4 mpi mplayer msn mule music mysql mythtv nagios-dns nagios-ntp nagios-ping nagios-ssh native ncurses net netcdf network neural nis nls nowin nptl ntlm nviz oav objc ocaml offensive ofx oggvorbis openal opengl opie oscar ospfapi oss pam parse-clocks pcap pcntl pcre pdf pdflib perl pg-hier pg-intdatetime pg-vacuumdelay php physfs pic plotutils png portaudio posix postgresql povray ppds pri print procmail pthreads python quicktime quotas quotes readline real resperl rhino rogue rplay samba sasl sdl servlet-2.3 servlet-2.4 session sftplogging shared sharedmem silc simplexml skk slp smime sndfile snortsam sockets socks5 softquota sox speex spell spl ssl stencil-buffer stroke struts svg svga sysvipc szip t1lib tcltk tcpd tcsim tetex tga theora tidy tiff transcode truetype truetype-fonts type1-fonts uim underscores unicode usb v4l v4l2 vcd vda videos virus-scan wddx winbind wmf wxwindows xanim xatrix xchatdccserver xchattext xemacs xface xgetdefault xine xml2 xmlrpc xmms xosd xpm xprint xrandr xscreensaver xsl xv xvid xvmc yahoo yaz yp yv12 zaptel zeo zlib zvbi"
Unset:  ASFLAGS, CBUILD, CTARGET, LC_ALL, LDFLAGS
Comment 17 Don Seiler (RETIRED) gentoo-dev 2005-02-15 14:55:11 UTC
If you want to try and help fix gaim's perl plugin loader, feel free to contact the gaim developer upstream.  Probably requires working knowledge of C and perl.
Comment 18 Don Seiler (RETIRED) gentoo-dev 2005-02-24 12:12:04 UTC
Please note that `perl -e 'use Gaim;'` shouldn't ever work.  That's not the proper way to test things.
Comment 19 Kathryn Kulick (RETIRED) gentoo-dev 2006-01-08 06:23:29 UTC
Going through trying to sort out what bugs are open and needing fixed, closing this as the gaim version listed is no longer in the tree.