[pacman-dev] "memory clobber before allocated" -S bug
This is similar to what Travis reported, but instead of happening on packages that exist it happens when pacman3 can't find the package in the db. For example: [~] james->monkeybox : sudo pacman3 -S random_junk --debug=1 [20:23:18] debug: config: new section 'options' [20:23:18] debug: config: logfile: /var/log/pacman.log [20:23:18] debug: config: noupgrade: etc/passwd [20:23:18] debug: config: noupgrade: etc/group [20:23:18] debug: config: noupgrade: etc/shadow [20:23:18] debug: config: noupgrade: etc/sudoers [20:23:18] debug: config: noupgrade: etc/fstab [20:23:18] debug: config: noupgrade: etc/raidtab [20:23:18] debug: config: noupgrade: etc/mdadm.conf [20:23:18] debug: config: noupgrade: etc/ld.so.conf [20:23:18] debug: config: noupgrade: etc/inittab [20:23:18] debug: config: noupgrade: etc/rc.conf [20:23:18] debug: config: noupgrade: etc/rc.local [20:23:18] debug: config: noupgrade: etc/modprobe.conf [20:23:18] debug: config: noupgrade: etc/modules.conf [20:23:18] debug: config: noupgrade: etc/lilo.conf [20:23:18] debug: config: noupgrade: boot/grub/menu.lst [20:23:18] debug: config: noupgrade: etc/mkinitrd.conf [20:23:18] debug: config: holdpkg: pacman [20:23:18] debug: config: holdpkg: glibc [20:23:18] debug: config: new section 'current' [20:23:18] debug: opening database 'current' [20:23:18] debug: config: including /etc/pacman3.d/current [20:23:18] debug: attempt to re-register the 'current' database, using existing [20:23:18] debug: config: new section 'current' [20:23:18] debug: attempt to re-register the 'current' database, using existing [20:23:18] debug: config: new section 'extra' [20:23:18] debug: opening database 'extra' [20:23:18] debug: config: including /etc/pacman3.d/extra [20:23:18] debug: attempt to re-register the 'extra' database, using existing [20:23:18] debug: config: new section 'extra' [20:23:18] debug: attempt to re-register the 'extra' database, using existing [20:23:18] debug: config: new section 'community' [20:23:18] debug: opening database 'community' [20:23:18] debug: config: including /etc/pacman3.d/community [20:23:18] debug: attempt to re-register the 'community' database, using existing [20:23:18] debug: config: new section 'community' [20:23:18] debug: attempt to re-register the 'community' database, using existing [20:23:18] debug: opening database 'local' [20:23:18] debug: loading package cache (infolevel=0) for repository 'current' [20:23:18] debug: loading package cache (infolevel=0) for repository 'extra' [20:23:18] debug: loading package cache (infolevel=0) for repository 'community' [20:23:18] debug: package cache reloaded (infolevel=0x2) for repository 'current' [20:23:18] debug: package cache reloaded (infolevel=0x2) for repository 'extra' [20:23:18] debug: package cache reloaded (infolevel=0x2) for repository 'community' [20:23:18] debug: returning error 31 from _alpm_sync_addtarget : could not find or read package [20:23:18] debug: loading group cache for repository 'current' [20:23:19] debug: package cache reloaded (infolevel=0x1) for repository 'current' [20:23:19] debug: loading group cache for repository 'extra' [20:23:19] debug: package cache reloaded (infolevel=0x1) for repository 'extra' [20:23:19] debug: loading group cache for repository 'community' [20:23:19] debug: package cache reloaded (infolevel=0x1) for repository 'community' error: 'random_junk': not found in sync db memory clobbered before allocated block Aborted Yet, (credit goes to Dan for finding this) doing the samething with pacman3.static works perfectly. ~ Jamie / yankees26
On 1/24/07, James Rosten <seinfeld90@gmail.com> wrote:
This is similar to what Travis reported, but instead of happening on packages that exist it happens when pacman3 can't find the package in the db. For example:
[~] james->monkeybox : sudo pacman3 -S random_junk --debug=1
Here is some debug output, starting with the output of the not found error message. You may want to get right up to this point and do some work, printing variables and such. Keep in mind you need to run it on a non-static version of pacman; why it doesn't show up in the static linkage I have no idea. -Dan (starts at line 553, src/pacman/sync.c) 553 if(prov) { (gdb) n 563 ERR(NL, _("'%s': not found in sync db\n"), targ); (gdb) s pm_fprintf (file=0xb7e2c560, line=0, fmt=0x80542f8 "error: ") at log.c:114 114 if(neednl == 1 && line == NL) { (gdb) s 108 { (gdb) s 114 if(neednl == 1 && line == NL) { (gdb) s 119 va_start(args, fmt); (gdb) s 120 vsnprintf(str, LOG_STR_LEN, fmt, args); (gdb) s 119 va_start(args, fmt); (gdb) s 120 vsnprintf(str, LOG_STR_LEN, fmt, args); (gdb) s 123 len = strlen(str); (gdb) s 120 vsnprintf(str, LOG_STR_LEN, fmt, args); (gdb) s s123 len = strlen(str); (gdb) s 125 if(needpad == 1 && str[len-1] == '\n') { (gdb) s 131 fprintf(file, str); (gdb) s error: 132 if(needpad == 1) { (gdb) p needpad $1 = 0 (gdb) p len No symbol "len" in current context. (gdb) p str $2 = "error: \000d�\236�)\236ҷ\001\000\000\000T�\236���\236�l�\236�ĺ\236�k\nӷC\000\000US\000utf8\000\b\006\000\000\000LC_MESSAGES/pacman.mo\000\236�o\233ҷS\001��\024\233\005\bp\217ҷ��\236��S��8\233\005\b\005\000\000\000�\231\005\bD!���3\224\b`2\224\b(�\236�error: \000X)\224\b\220~��T�\236�p\217ҷ�Fз����XZ���\f\t\b��\236���\236�X?\224\b�\231\005\b\221>���B\005\b\000\000\000\000"... (gdb) s 144 fflush(file); (gdb) s 145 } (gdb) s pacman_sync (targets=0x8059c08) at sync.c:496 496 ERR(NL, _("pacman: %s\n"), alpm_strerror(pm_errno)); (gdb) s pm_fprintf (file=0xb7e2c560, line=1, fmt=0x80562ee "'%s': not found in sync db\n") at log.c:114 114 if(neednl == 1 && line == NL) { (gdb) s 108 { (gdb) s 114 if(neednl == 1 && line == NL) { (gdb) s 119 va_start(args, fmt); (gdb) s 120 vsnprintf(str, LOG_STR_LEN, fmt, args); (gdb) p str $3 = "T�\236���\236�C\000_US.utf8\000��\233ҷ�\231\005\b8\233\005\b\006\000\000\000\201>��LC_MESSAGES/pacman.mo\000ҷS\001��\024\233\005\bp\217ҷo\000\236�o\233ҷS\001��8\233\005\b\005\000\000\000�\231\005\b�S��8\233\005\b\005\000\000\000�\231\005\b'%s': not found in sync db\n\000\220~��T�\236�p\217ҷ�Fз����XZ���\f\t\b\200�\236���\236�X?\224\b�\231\005\b\221>���b\005\b\000\000\000\000"... (gdb) s 119 va_start(args, fmt); (gdb) s 120 vsnprintf(str, LOG_STR_LEN, fmt, args); (gdb) s 123 len = strlen(str); (gdb) s 120 vsnprintf(str, LOG_STR_LEN, fmt, args); (gdb) s 123 len = strlen(str); (gdb) s 125 if(needpad == 1 && str[len-1] == '\n') { (gdb) s 131 fprintf(file, str); (gdb) s 'random_junk': not found in sync db 132 if(needpad == 1) { (gdb) s 144 fflush(file); (gdb) s 145 } (gdb) s pacman_sync (targets=0x8059c08) at sync.c:758 758 if(data) { (gdb) s 759 alpm_list_free(data); (gdb) s memory clobbered before allocated block Program received signal SIGABRT, Aborted. 0xb7eec410 in ?? () (gdb)
On 1/24/07, Dan McGee <dpmcgee@gmail.com> wrote:
On 1/24/07, James Rosten <seinfeld90@gmail.com> wrote:
This is similar to what Travis reported, but instead of happening on packages that exist it happens when pacman3 can't find the package in the db. For example:
[~] james->monkeybox : sudo pacman3 -S random_junk --debug=1
Looks like this may be fixed now 8) See the commit for sync.c
participants (3)
-
Aaron Griffin
-
Dan McGee
-
James Rosten