Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 171580 - dev-libs/libmowgli: Request for keywording
Summary: dev-libs/libmowgli: Request for keywording
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Tony Vroon (RETIRED)
URL: http://www.pastebin.ca/403444
Whiteboard:
Keywords: KEYWORDREQ
: 196169 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-03-20 15:49 UTC by Tony Vroon (RETIRED)
Modified: 2009-05-01 13:08 UTC (History)
2 users (show)

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


Attachments
strace output (171580_test.strace,3.76 KB, text/plain)
2007-03-21 02:53 UTC, Jeroen Roovers (RETIRED)
Details
Test/Benchmark for dev-utils/libmowgli (mowgli-test.c,1.38 KB, text/plain)
2007-03-21 15:39 UTC, Danny van Dyk (RETIRED)
Details
Fixes a segfault when freeing allocated memory on 64bit little endian systems, by nenolod (libmowgli-0.1.2-heap-segfault.patch,1.36 KB, patch)
2007-03-21 22:14 UTC, Danny van Dyk (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tony Vroon (RETIRED) gentoo-dev 2007-03-20 15:49:38 UTC
This library will be used by Audacious in the future. This library was created by nenolod after he noticed that GLists aren't really lists but queues. You can use the benchmarking program linked in the URL field to confirm that the library is operational on your architecture.
I will forward any portability issues or concerns to upstream. If you have a patch, feel free to attach it here. Your cooperation is appreciated.
Comment 1 Raúl Porcel (RETIRED) gentoo-dev 2007-03-20 19:31:29 UTC
x86 has it keyworded, nothing to do :)
Comment 2 Tony Vroon (RETIRED) gentoo-dev 2007-03-21 00:31:50 UTC
"GList" vs mowgli_list_t test.
GList is in quotes because it's actually a queue, and thus is expected to be O(n).
Scores are measured in seconds required to finish the job.
100 iterations:
      GList: 0.0000779629            Mowgli: 0.0000140667
1000 iterations:
      GList: 0.0016171932            Mowgli: 0.0001211166
10000 iterations:
      GList: 0.2303349972            Mowgli: 0.0021960735
25000 iterations:
      GList: 3.2247440815            Mowgli: 0.0219058990
50000 iterations:
      GList: 16.5825288296           Mowgli: 0.1605970860
100000 iterations:
      GList: 69.0515899658           Mowgli: 0.8810250759

Keyworded PPC & PPC64. Testing done with GCC 4.1.2; 64UL on the PPC64.
For testers:
gcc -o bench test.c `pkg-config libmowgli --cflags --libs` `pkg-config glib-2.0 --cflags --libs`
Comment 3 Jeroen Roovers (RETIRED) gentoo-dev 2007-03-21 01:53:20 UTC
The emerge output contained the following warnings:

mowgli_hash.c:44: warning: implicit declaration of function ‘rand’
mowgli_hash.c:51: warning: implicit declaration of function ‘tolower’
mowgli_hook.c:102: warning: implicit declaration of function ‘g_return_val_if_fa
il’
mowgli_init.c:36: warning: implicit declaration of function ‘mowgli_node_init’

And then compilation of the test program failed thusly:

gentoo/bugs/171580 # make
gcc  -O2 -pipe  -lmowgli   -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include  -lglib-2.0   -I/usr/include/libmowgli -ldl    171580_test.c   -o 171580_test
/usr/lib/gcc/hppa2.0-unknown-linux-gnu/4.1.1/../../../libmowgli.so: undefined reference to `g_return_val_if_fail'
collect2: ld returned 1 exit status
make: *** [171580_test] Error 1

# scanelf -a /usr/lib/libmowgli.so
 TYPE    PAX   STK/REL/PTL TEXTREL RPATH BIND FILE
ET_DYN ---xe- --- --- RWX    -      -   LAZY /usr/lib/libmowgli.so

In short it needs work before it can be keyworded for HPPA. Alas, the build log is useless as it only displays the neat "kernel style" build messages. It become even more confusing or confused on closer inspection:

/var/tmp/portage/dev-libs/libmowgli-0.1.1/work/libmowgli-0.1.1 # grep -R libmcs .
./configure.ac:PACKAGE="libmcs"
./mk/rules.mk:pkgdatadir ?= $(datadir)/libmcs
./mk/rules.mk:pkglibdir ?= $(libdir)/libmcs
./mk/rules.mk:pkgincludedir ?= $(includedir)/libmcs
./mk/rules.mk:PACKAGE ?= libmcs
./configure:PACKAGE="libmcs"
./config.log:PACKAGE='libmcs'
./config.status:s,@PACKAGE@,|#_!!_#|libmcs,g

At which point I thought it best to wrap this up and wait for 0.1.2. :)
Comment 4 Jeroen Roovers (RETIRED) gentoo-dev 2007-03-21 02:53:29 UTC
Created attachment 113941 [details]
strace output
Comment 5 Jeroen Roovers (RETIRED) gentoo-dev 2007-03-21 03:01:30 UTC
Using CFLAGS="-O2 -pipe -mschedule=8000 -march=2.0 -ggdb -Wall -Wl,-z,now" I got something half working:

elmer /keeps/gentoo/bugs/171580 # make
gcc -o 171580_test  -O2 -pipe -I/usr/include/libmowgli  -lmowgli   -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include  -lglib-2.0   -I/usr/include/libmowgli -ldl 171580_test.c
elmer /keeps/gentoo/bugs/171580 # ./171580_test
"GList" vs mowgli_list_t test.
GList is in quotes because it's actually a queue, and thus is expected to be O(n).
Scores are measured in seconds required to finish the job.
100 iterations:
Segmentation fault

gdb says:

(gdb) run
Starting program: /keeps/gentoo/bugs/171580/171580_test
"GList" vs mowgli_list_t test.
GList is in quotes because it's actually a queue, and thus is expected to be O(n).
Scores are measured in seconds required to finish the job.
100 iterations:

Program received signal SIGSEGV, Segmentation fault.
mowgli_node_add (data=0x0, n=0x210b8, l=0xfb150450) at mowgli_list.c:100
100     mowgli_list.c: No such file or directory.
        in mowgli_list.c
(gdb) thread apply bt full
(gdb) bt full
#0  mowgli_node_add (data=0x0, n=0x210b8, l=0xfb150450) at mowgli_list.c:100
        tn = (mowgli_node_t *) 0x1
        __PRETTY_FUNCTION__ = "mowgli_node_add"
#1  0x00010830 in bench (iterations=100) at 171580_test.c:25
        tv = {tv_sec = 1174445053, tv_usec = 701249}
        i = 1
        l = {head = 0x20f46, tail = 0x1, count = 4212457900}
        list = <value optimized out>
Register (null) not available

[strace output submitted separately]
Comment 6 William Pitcock 2007-03-21 09:29:23 UTC
0.1.2 fixes these defects. Sorry about that. (It also works on my HPPA hardware.)
Comment 7 Tony Vroon (RETIRED) gentoo-dev 2007-03-21 11:14:45 UTC
Bumped in CVS. Do try again.
Comment 8 Jeroen Roovers (RETIRED) gentoo-dev 2007-03-21 14:56:13 UTC
(In reply to comment #6)
> 0.1.2 fixes these defects. Sorry about that. (It also works on my HPPA
> hardware.)

Same here:

elmer /keeps/gentoo/bugs/171580 # ./171580_test
"GList" vs mowgli_list_t test.
GList is in quotes because it's actually a queue, and thus is expected to be O(n).
Scores are measured in seconds required to finish the job.
100 iterations:
      GList: 0.0002679825            Mowgli: 0.0000350475
1000 iterations:
      GList: 0.0035519600            Mowgli: 0.0003941059
10000 iterations:
      GList: 0.3277170658            Mowgli: 0.0042901039
25000 iterations:
      GList: 2.0604171753            Mowgli: 0.0132899284
50000 iterations:
      GList: 8.3479809761            Mowgli: 0.0364811420
100000 iterations:
      GList: 50.1893849373           Mowgli: 0.1108620167

=dev-libs/libmowgli-0.1.2 marked ~hppa.
Comment 9 Danny van Dyk (RETIRED) gentoo-dev 2007-03-21 15:39:20 UTC
Created attachment 113978 [details]
Test/Benchmark for dev-utils/libmowgli

Testin on amd64 yielded a segfault during bench(100)

First try to fix:
mowgli_list_t l = mowgli_list_create();
...
mowgli_list_free(l); <--segfaulted like this:
Program received signal SIGSEGV, Segmentation fault.
0x00002aec0b7664bd in mowgli_node_move (m=0x511180, oldlist=0x511178, newlist=0x511160) at mowgli_list.c:271
271                     m->prev->next = m->next;
(gdb) bt
#0  0x00002aec0b7664bd in mowgli_node_move (m=0x511180, oldlist=0x511178, newlist=0x511160) at mowgli_list.c:271
#1  0x00002aec0b7655e1 in mowgli_heap_free (heap=0x5110d0, data=0x5111a0) at mowgli_heap.c:198
#2  0x00002aec0b7665cd in mowgli_list_free (l=0x5111a0) at mowgli_list.c:308
#3  0x0000000000400a45 in bench (iterations=100) at mowgli-test.c:29
#4  0x0000000000400a83 in main (argc=1, argv=0x7fff9f4621d8) at mowgli-test.c:42


Next try: keep the mowgli_list_t on the stack, but clear it like this:
mowgli_list_t l = { 0 };
This finally works, but it's not the clearest way. I'd like to hear from the author why the mowgli_list_free() call segfaults. Won't keyword until this is cleared.

I could fix it by clearing the allocated mowgli_list_t li
Comment 10 Danny van Dyk (RETIRED) gentoo-dev 2007-03-21 17:01:45 UTC
Just ignore the last line of the previous post please. :-)

Comment 11 William Pitcock 2007-03-21 21:40:26 UTC
(In reply to comment #9)
> Created an attachment (id=113978) [edit]
> Test/Benchmark for dev-utils/libmowgli
> 
> Testin on amd64 yielded a segfault during bench(100)
> 
> First try to fix:
> mowgli_list_t l = mowgli_list_create();
> ...
> mowgli_list_free(l); <--segfaulted like this:
> Program received signal SIGSEGV, Segmentation fault.
> 0x00002aec0b7664bd in mowgli_node_move (m=0x511180, oldlist=0x511178,
> newlist=0x511160) at mowgli_list.c:271
> 271                     m->prev->next = m->next;
> (gdb) bt
> #0  0x00002aec0b7664bd in mowgli_node_move (m=0x511180, oldlist=0x511178,
> newlist=0x511160) at mowgli_list.c:271
> #1  0x00002aec0b7655e1 in mowgli_heap_free (heap=0x5110d0, data=0x5111a0) at
> mowgli_heap.c:198
> #2  0x00002aec0b7665cd in mowgli_list_free (l=0x5111a0) at mowgli_list.c:308
> #3  0x0000000000400a45 in bench (iterations=100) at mowgli-test.c:29
> #4  0x0000000000400a83 in main (argc=1, argv=0x7fff9f4621d8) at
> mowgli-test.c:42
> 
> 
> Next try: keep the mowgli_list_t on the stack, but clear it like this:
> mowgli_list_t l = { 0 };
> This finally works, but it's not the clearest way. I'd like to hear from the
> author why the mowgli_list_free() call segfaults. Won't keyword until this is
> cleared.
> 
> I could fix it by clearing the allocated mowgli_list_t li
> 

There was a bug in the heap allocator. It has been fixed in 0.1.3.
Comment 12 Danny van Dyk (RETIRED) gentoo-dev 2007-03-21 22:14:54 UTC
Created attachment 114021 [details, diff]
Fixes a segfault when freeing allocated memory on 64bit little endian systems, by nenolod

The author provided the attached patch. Works fine on amd64.
Comment 13 Christoph Mende (RETIRED) gentoo-dev 2007-03-21 22:52:10 UTC
0.1.2 works for me on amd64:
odin ~ # ./bench
"GList" vs mowgli_list_t test.
GList is in quotes because it's actually a queue, and thus is expected to be O(n).
Scores are measured in seconds required to finish the job.
100 iterations:
      GList: 0.0000510216            Mowgli: 0.0000050068
1000 iterations:
      GList: 0.0009350777            Mowgli: 0.0000832081
10000 iterations:
      GList: 0.2458400726            Mowgli: 0.0009701252
25000 iterations:
      GList: 3.1194939613            Mowgli: 0.0046420097
50000 iterations:
      GList: 15.7011108398           Mowgli: 0.0317502022
100000 iterations:
      GList: 66.3843708038           Mowgli: 0.1786589622

Portage 2.1.2.2 (default-linux/amd64/2006.1/desktop, gcc-4.1.1, glibc-2.5-r0, 2.6.20-beyond2 x86_64)
=================================================================
System uname: 2.6.20-beyond2 x86_64 AMD Athlon(tm) 64 X2 Dual Core Processor 4600+
Gentoo Base System release 1.12.9
Timestamp of tree: Wed, 21 Mar 2007 21:50:01 +0000
ccache version 2.4 [enabled]
dev-java/java-config: 1.3.7, 2.0.31
dev-lang/python:     2.4.3-r4
dev-python/pycrypto: 2.0.1-r5
dev-util/ccache:     2.4-r6
sys-apps/sandbox:    1.2.17
sys-devel/autoconf:  2.13, 2.61
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10
sys-devel/binutils:  2.16.1-r3
sys-devel/gcc-config: 1.3.14
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.17-r2
ACCEPT_KEYWORDS="amd64"
AUTOCLEAN="yes"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=k8 -O2 -pipe -msse3"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/X11/xkb"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/gconf /etc/java-config/vms/ /etc/php/apache1-php5/ext-active/ /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/splash /etc/terminfo"
CXXFLAGS="-march=k8 -O2 -pipe -msse3"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig buildsyspkg ccache collision-protect distlocks metadata-transfer multilib-strict parallel-fetch sandbox sfperms strict test"
GENTOO_MIRRORS="ftp://linux.rz.ruhr-uni-bochum.de/gentoo-mirror/ ftp://ftp.uni-erlangen.de/pub/mirrors/gentoo ftp://ftp.join.uni-muenster.de/pub/linux/distributions/gentoo ftp://ftp.wh2.tu-dresden.de/pub/mirrors/gentoo ftp://ftp.join.uni-muenster.de/pub/linux/distributions/gentoo ftp://ftp-stud.fht-esslingen.de/pub/Mirrors/gentoo/ ftp://ftp.gentoo.mesh-solutions.com/gentoo/ ftp://pandemonium.tiscali.de/pub/gentoo/ "
LANG="en_US.ISO-8859-15"
LC_ALL="en_US.ISO-8859-15"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_EXTRA_OPTS="--exclude-from=/etc/portage/rsync_excludes"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --filter=H_**/files/digest-*"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage/overlay"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="X a52 aac acpi alsa amd64 amr audiofile berkdb bitmap-fonts bzip2 cairo cdinstall cdr cli cracklib crypt cups dbus dri dts dvd dvdr dvdread eds emboss encode fam firefox fortran gdbm gif gpm gstreamer gtk gtk2 hal iconv jpeg ldap libg++ lirc logrotate mad midi mikmod mp3 mpeg ncurses nls nptl nptlonly offensive ogg opengl pam pcre php png ppds pppd quicktime readline reflection sdl session smp socks5 spl ssl svg symlink tcpd test tiff truetype truetype-fonts type1-fonts unicode v4l vorbis x264 xinerama xorg xv xvid zlib" ALSA_CARDS="emu10k1" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" ELIBC="glibc" INPUT_DEVICES="evdev keyboard" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIRC_DEVICES="inputlirc" USERLAND="GNU" VIDEO_CARDS="nvidia"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LDFLAGS, LINGUAS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS
Comment 14 Gustavo Zacarias (RETIRED) gentoo-dev 2007-03-22 13:22:56 UTC
~sparc it's got.
Comment 15 Tony Vroon (RETIRED) gentoo-dev 2007-03-22 15:31:15 UTC
Comment on attachment 114021 [details, diff]
Fixes a segfault when freeing allocated memory on 64bit little endian systems, by nenolod

0.1.3 is in portage, it already incorporates this patch.
Comment 16 Danny van Dyk (RETIRED) gentoo-dev 2007-03-22 17:15:04 UTC
0.1.3 is ~amd64
Comment 17 Raúl Porcel (RETIRED) gentoo-dev 2007-04-02 11:05:15 UTC
~ia64 done.

Please note:
dodoc: README does not exist
dodoc: TODO does not exist
Comment 18 Tony Vroon (RETIRED) gentoo-dev 2007-04-02 11:36:09 UTC
Fixed dodoc statement, thanks Raúl.
Comment 19 Fernando J. Pereda (RETIRED) gentoo-dev 2007-05-18 21:28:18 UTC
This is what I get on alpha with the provided testcase:

---8<---
GNU gdb 6.6
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "alpha-unknown-linux-gnu"...
Using host libthread_db library "/lib/libthread_db.so.1".
(gdb) r
Starting program: /root/bench 
"GList" vs mowgli_list_t test.
GList is in quotes because it's actually a queue, and thus is expected to be O(n).
Scores are measured in seconds required to finish the job.
100 iterations:

Program received signal SIGSEGV, Segmentation fault.
mowgli_node_add (data=0x0, n=0x1200140f0, l=0x11fa21b70) at mowgli_list.c:102
102     mowgli_list.c: No such file or directory.
        in mowgli_list.c
(gdb) bt
#0  mowgli_node_add (data=0x0, n=0x1200140f0, l=0x11fa21b70) at mowgli_list.c:102
#1  0x0000000120000c04 in bench (iterations=100) at test-mowgli.c:25
#2  0x0000000120000d60 in main (argc=1, argv=0x11fa21cf8) at test-mowgli.c:41
(gdb) 
---8<---

- ferdy
Comment 20 Raúl Porcel (RETIRED) gentoo-dev 2007-10-26 12:45:08 UTC
~alpha done, works fine for me
Comment 21 Jakub Moc (RETIRED) gentoo-dev 2008-01-26 08:32:24 UTC
*** Bug 196169 has been marked as a duplicate of this bug. ***
Comment 22 Jakub Moc (RETIRED) gentoo-dev 2008-02-12 23:42:04 UTC
 05 Dec 2007; Joshua Kinard <kumba@gentoo.org> libmowgli-0.5.0.ebuild:
  Marked unstable on mips.

Comment 23 Raúl Porcel (RETIRED) gentoo-dev 2009-05-01 13:08:21 UTC
audacious doesn't have arm/s390 keywords.

Closing