Package: apt-spy
Version: 3.1-19
Severity: normal
Hi!
While playing with apt-spy, I encountered a very strange bug involving
the name of the directory and the name of the file containing the mirrors.
To reproduce it, as root:
# COMMAND="apt-spy -d stable -t 15 -n 10 -w ten-best-mirrors.txt"
# DIR=/usr/local/src/apt-spy/WORK/modifs
# mkdir -p $DIR
# cp /var/cache/apt-spy/mirrors.txt $DIR/mirrors.txt.ubuntu
# $COMMAND -m $DIR/mirrors.txt.ubuntu
It gives:
apt-spy: malloc.c:3096: sYSMALLOc: Assertion `(old_top == (((mbinptr) (((char
*) &((av)->bins[((1) - 1) * 2])) - __builtin_offsetof (struct malloc_chunk,
fd)))) && old_size == 0) || ((unsigned long) (old_size) >= (unsigned
long)((((__builtin_offsetof (struct malloc_chunk, fd_nextsize))+((2 *
(sizeof(size_t))) - 1)) & ~((2 * (sizeof(size_t))) - 1))) && ((old_top)->size &
0x1) && ((unsigned long)old_end & pagemask) == 0)' failed.
Aborted
I compiled without stripping symbols and ran gdb:
(gdb) run -d stable -t 15 -n 10 -w ten-best-mirrors.txt -m
/usr/local/src/apt-spy/WORK/modifs/mirrors.txt.ubuntu
Starting program: /usr/local/src/apt-spy/TESTS/apt-spy-3.1/apt-spy -d stable -t
15 -n 10 -w ten-best-mirrors.txt -m
/usr/local/src/apt-spy/WORK/modifs/mirrors.txt.ubuntu
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
apt-spy: malloc.c:3096: sYSMALLOc: Assertion `(old_top == (((mbinptr) (((char
*) &((av)->bins[((1) - 1) * 2])) - __builtin_offsetof (struct malloc_chunk,
fd)))) && old_size == 0) || ((unsigned long) (old_size) >= (unsigned
long)((((__builtin_offsetof (struct malloc_chunk, fd_nextsize))+((2 *
(sizeof(size_t))) - 1)) & ~((2 * (sizeof(size_t))) - 1))) && ((old_top)->size &
0x1) && ((unsigned long)old_end & pagemask) == 0)' failed.
Program received signal SIGABRT, Aborted.
0x00007ffff7826405 in *__GI_raise (sig=<optimized out>) at
../nptl/sysdeps/unix/sysv/linux/raise.c:64
64 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
in ../nptl/sysdeps/unix/sysv/linux/raise.c
(gdb) up
#1 0x00007ffff7829680 in *__GI_abort () at abort.c:92
92 abort.c: No such file or directory.
in abort.c
(gdb) up
#2 0x00007ffff786680a in __malloc_assert (assertion=<optimized out>,
file=<optimized out>, line=<optimized out>,
function=<optimized out>) at malloc.c:351
351 malloc.c: No such file or directory.
in malloc.c
(gdb) up
#3 0x00007ffff7869733 in sYSMALLOc (av=<optimized out>, nb=<optimized out>) at
malloc.c:3093
3093 in malloc.c
(gdb) up
#4 _int_malloc (av=0x7ffff7b73e60, bytes=<optimized out>) at malloc.c:4747
4747 in malloc.c
(gdb) up
#5 0x00007ffff786b420 in *__GI___libc_malloc (bytes=163) at malloc.c:3660
3660 in malloc.c
(gdb) up
#6 0x00000000004018eb in next_entry (infile_p=0x407370) at file.c:98
98 temp = malloc(buffsize + 1);
(gdb) up
#7 0x000000000040316c in find_country (mirror_list=0x407370,
country_code=0x407f00 "CH ") at parse.c:199
199 while ((line = next_entry(mirror_list)) != NULL) {
(gdb) up
#8 0x0000000000402dd9 in build_area_file (config_p=0x407c70,
infile_p=0x4075b0, mirror_list=0x407370, area=0x406340 "ALL") at parse.c:94
94 if (find_country(mirror_list, country_code) == 1) {
(gdb) up
#9 0x0000000000402848 in main (argc=0, argv=0x7fffffffe090) at main.c:287
287 if (build_area_file(config_p, infile_p,
mirror_p, area) != 0) {
but strangely:
# cp -v $DIR/mirrors.txt.ubuntu $DIR/mirrors.txt
# $COMMAND -m $DIR/mirrors.txt
doesn't produce an error.
And That's the same with:
# cd $DIR
# $COMMAND -m ./mirrors.txt.ubuntu
I even tried with a longer filename but there is no error with:
# cp -v $DIR/mirrors.txt.ubuntu $DIR/mirrors.txt.azertyuiopqsdfghjklmwxcvbn
# $COMMAND -m $DIR/mirrors.txt.azertyuiopqsdfghjklmwxcvbn
It seems there is something wrong in the "next_entry" function in file.c.
At least it would be useful to add some error checking to abort the program
cleanly and give some information to the user.
-- System Information:
Debian Release: wheezy/sid
APT prefers testing
APT policy: (800, 'testing'), (750, 'stable'), (500, 'oldstable'), (50,
'experimental'), (50, 'unstable')
Architecture: amd64 (x86_64)
Kernel: Linux 3.0.0-1-amd64 (SMP w/2 CPU cores)
Locale: LANG=fr_FR.utf-8, LC_CTYPE=fr_FR.utf-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
Versions of packages apt-spy depends on:
ii libc6 2.13-21
ii libcurl3 7.21.7-3
apt-spy recommends no packages.
apt-spy suggests no packages.
-- no debconf information
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]