Bug#549627: grub: similar problems

Friedrich Delgado Friedrichs friedel at nomaden.org
Sun Oct 11 20:58:28 UTC 2009


Felix Zielcke schrieb:
> It would have been better if you have made a seperate bug report for
> this.
> Anyway I fixed this now by cloning the report and setting you as
> submitter. And also properly reassigned both reports to grub-common
> where this belongs to.

I'm sorry, but it's really the best I could do. I'm trying hard *not*
to file duplicate reports, but in this case I overlooked a significant
difference between the two problems.

> The relevant part here is the update-grub output and the exit code of
> it.
> 139 in update-grub is very strange to me.
> 
> In the /etc/grub.d/* files either change the first line of them from
> `#! /bin/sh -e' to `#! /bin/sh -ex' or you can write `set -x' in the
> line after it.
> 40_custom can be skipped if you didn't modify it.
> Then run update-grub, it should tell now which command fails.
---Zitatende---

Did so, the result is this:

Preparing to replace linux-image-2.6-amd64 2.6.30+20 (using .../linux-image-2.6-amd64_2.6.30+21_amd64.deb) ...
Unpacking replacement linux-image-2.6-amd64 ...
Setting up linux-image-2.6.30-2-amd64 (2.6.30-8) ...
Running depmod.
Running update-initramfs.
update-initramfs: Generating /boot/initrd.img-2.6.30-2-amd64
Running update-grub.
Generating grub.cfg ...
+ transform=s,x,x,
+ prefix=/usr
+ exec_prefix=/usr
+ libdir=/usr/lib
++ echo /boot/grub
++ sed s,x,x,
+ grub_prefix=/boot/grub
+ . /usr/lib/grub/grub-mkconfig_lib
++ transform=s,x,x,
++ prefix=/usr
++ exec_prefix=/usr
++ datarootdir=/usr/share
++ datadir=/usr/share
++ sbindir=/usr/sbin
+++ echo grub
+++ sed s,x,x,
++ pkgdatadir=/usr/share/grub
+++ echo grub-probe
+++ sed s,x,x,
++ grub_probe=/usr/sbin/grub-probe
+ '[' x0 = x ']'
+ '[' x5 = x ']'
+ '[' x = x ']'
+ GRUB_GFXMODE=640x480
+ cat
+ case ${GRUB_TERMINAL_INPUT}:${GRUB_TERMINAL_OUTPUT} in
+ case x${GRUB_TERMINAL_INPUT} in
+ case x${GRUB_TERMINAL_OUTPUT} in
++ /usr/sbin/grub-probe --target=device /usr/share/grub/unicode.pf2
+ prepare_grub_to_access_device /dev/mapper/lvm-root
+ device=/dev/mapper/lvm-root
++ /usr/sbin/grub-probe --device /dev/mapper/lvm-root --target=abstraction
+ abstraction=
User postinst hook script [update-grub] exited with value 139
dpkg: error processing linux-image-2.6.30-2-amd64 (--configure):
 subprocess installed post-installation script returned error exit status 139
dpkg: dependency problems prevent configuration of linux-image-2.6-amd64:
 linux-image-2.6-amd64 depends on linux-image-2.6.30-2-amd64; however:
  Package linux-image-2.6.30-2-amd64 is not configured yet.
dpkg: error processing linux-image-2.6-amd64 (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 linux-image-2.6.30-2-amd64
 linux-image-2.6-amd64
E: Sub-process /usr/bin/dpkg returned an error code (1)
A package failed to install.  Trying to recover:
Setting up linux-image-2.6.30-2-amd64 (2.6.30-8) ...
Running depmod.
Running update-initramfs.
update-initramfs: Generating /boot/initrd.img-2.6.30-2-amd64
initrd.img(/boot/initrd.img-2.6.30-2-amd64
) points to /boot/initrd.img-2.6.30-2-amd64
 (/boot/initrd.img-2.6.30-2-amd64) -- doing nothing at /var/lib/dpkg/info/linux-image-2.6.30-2-amd64.postinst line 569.
vmlinuz(/boot/vmlinuz-2.6.30-2-amd64
) points to /boot/vmlinuz-2.6.30-2-amd64
 (/boot/vmlinuz-2.6.30-2-amd64) -- doing nothing at /var/lib/dpkg/info/linux-image-2.6.30-2-amd64.postinst line 569.
Running update-grub.
Generating grub.cfg ...
+ transform=s,x,x,
+ prefix=/usr
+ exec_prefix=/usr
+ libdir=/usr/lib
++ echo /boot/grub
++ sed s,x,x,
+ grub_prefix=/boot/grub
+ . /usr/lib/grub/grub-mkconfig_lib
++ transform=s,x,x,
++ prefix=/usr
++ exec_prefix=/usr
++ datarootdir=/usr/share
++ datadir=/usr/share
++ sbindir=/usr/sbin
+++ echo grub
+++ sed s,x,x,
++ pkgdatadir=/usr/share/grub
+++ echo grub-probe
+++ sed s,x,x,
++ grub_probe=/usr/sbin/grub-probe
+ '[' x0 = x ']'
+ '[' x5 = x ']'
+ '[' x = x ']'
+ GRUB_GFXMODE=640x480
+ cat
+ case ${GRUB_TERMINAL_INPUT}:${GRUB_TERMINAL_OUTPUT} in
+ case x${GRUB_TERMINAL_INPUT} in
+ case x${GRUB_TERMINAL_OUTPUT} in
++ /usr/sbin/grub-probe --target=device /usr/share/grub/unicode.pf2
+ prepare_grub_to_access_device /dev/mapper/lvm-root
+ device=/dev/mapper/lvm-root
++ /usr/sbin/grub-probe --device /dev/mapper/lvm-root --target=abstraction
+ abstraction=
User postinst hook script [update-grub] exited with value 139
dpkg: error processing linux-image-2.6.30-2-amd64 (--configure):
 subprocess installed post-installation script returned error exit status 139
dpkg: dependency problems prevent configuration of linux-image-2.6-amd64:
 linux-image-2.6-amd64 depends on linux-image-2.6.30-2-amd64; however:
  Package linux-image-2.6.30-2-amd64 is not configured yet.
dpkg: error processing linux-image-2.6-amd64 (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 linux-image-2.6.30-2-amd64
 linux-image-2.6-amd64
Press return to continue.

If I try the command

/usr/sbin/grub-probe --device /dev/mapper/lvm-root \
--target=abstraction

as root I get a segmentation fault.

I can't get a meaningful backtrace out of it, even though I have
libc6-debug installed. valgrind reports an invalid read in libc, which
looks like it happens in grub-probe, but I have no debugging symbols
for it.

abrasax:/tmp# gdb --args /usr/sbin/grub-probe --device /dev/mapper/lvm-root --target=abstraction
GNU gdb (GDB) 6.8.50.20090628-cvs-debian
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
(no debugging symbols found)
(gdb) r
Starting program: /usr/sbin/grub-probe --device /dev/mapper/lvm-root --target=abstraction

Program received signal SIGSEGV, Segmentation fault.
0x000000000040189f in ?? ()
(gdb) bt
#0  0x000000000040189f in ?? ()
#1  0x0000000000401cd6 in ?? ()
#2  0x00007ffff7aae5c6 in __libc_start_main (main=0x401ac0 <fflush at plt+1360>, argc=4,
    ubp_av=0x7fffffffe7e8, init=0x41e8e0, fini=<value optimized out>,
    rtld_fini=<value optimized out>, stack_end=0x7fffffffe7d8) at libc-start.c:222
#3  0x00000000004015a9 in ?? ()
#4  0x00007fffffffe7d8 in ?? ()
#5  0x000000000000001c in ?? ()
#6  0x0000000000000004 in ?? ()
#7  0x00007fffffffea0c in ?? ()
#8  0x00007fffffffea21 in ?? ()
#9  0x00007fffffffea3f in ?? ()
#10 0x00007fffffffea2a in ?? ()
#11 0x0000000000000000 in ?? ()
(gdb) quit
The program is running.  Quit anyway (and kill it)? (y or n) y
abrasax:/tmp# ldd /usr/sbin/grub-probe
        linux-vdso.so.1 =>  (0x00007fff431bd000)
        libc.so.6 => /lib/libc.so.6 (0x00007f4ab4ad5000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f4ab4e26000)
abrasax:/tmp# dlocate /lib/libc.so.6
libc6: /lib/libc.so.6
abrasax:/tmp# valgrind /usr/sbin/grub-probe --device /dev/mapper/lvm-root --target=abstraction
==15910== Memcheck, a memory error detector
==15910== Copyright (C) 2002-2009, and GNU GPL'd, by Julian Seward et al.
==15910== Using Valgrind-3.5.0-Debian and LibVEX; rerun with -h for copyright info
==15910== Command: /usr/sbin/grub-probe --device /dev/mapper/lvm-root --target=abstraction
==15910==
==15910== Warning: noted but unhandled ioctl 0x1261 with no size/direction hints
==15910==    This could cause spurious value errors to appear.
==15910==    See README_MISSING_SYSCALL_OR_IOCTL for guidance on writing a proper wrapper.
==15910== Warning: noted but unhandled ioctl 0x1261 with no size/direction hints
==15910==    This could cause spurious value errors to appear.
==15910==    See README_MISSING_SYSCALL_OR_IOCTL for guidance on writing a proper wrapper.
==15910== Warning: noted but unhandled ioctl 0x1261 with no size/direction hints
==15910==    This could cause spurious value errors to appear.
==15910==    See README_MISSING_SYSCALL_OR_IOCTL for guidance on writing a proper wrapper.
==15910== Invalid read of size 8
==15910==    at 0x40189F: ??? (in /usr/sbin/grub-probe)
==15910==    by 0x401CD5: ??? (in /usr/sbin/grub-probe)
==15910==    by 0x4E445C5: (below main) (libc-start.c:222)
==15910==  Address 0x8 is not stack'd, malloc'd or (recently) free'd
==15910==
==15910==
==15910== Process terminating with default action of signal 11 (SIGSEGV): dumping core
==15910==  Access not within mapped region at address 0x8
==15910==    at 0x40189F: ??? (in /usr/sbin/grub-probe)
==15910==    by 0x401CD5: ??? (in /usr/sbin/grub-probe)
==15910==    by 0x4E445C5: (below main) (libc-start.c:222)
==15910==  If you believe this happened as a result of a stack
==15910==  overflow in your program's main thread (unlikely but
==15910==  possible), you can try to increase the size of the
==15910==  main thread stack using the --main-stacksize= flag.
==15910==  The main thread stack size used in this run was 8388608.
==15910==
==15910== HEAP SUMMARY:
==15910==     in use at exit: 476,278 bytes in 155 blocks
==15910==   total heap usage: 317 allocs, 162 frees, 1,942,936 bytes allocated
==15910==
==15910== LEAK SUMMARY:
==15910==    definitely lost: 153 bytes in 7 blocks
==15910==    indirectly lost: 0 bytes in 0 blocks
==15910==      possibly lost: 0 bytes in 0 blocks
==15910==    still reachable: 476,125 bytes in 148 blocks
==15910==         suppressed: 0 bytes in 0 blocks
==15910== Rerun with --leak-check=full to see details of leaked memory
==15910==
==15910== For counts of detected and suppressed errors, rerun with: -v
==15910== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 5 from 5)
Segmentation fault
abrasax:/tmp#



-- 
        Friedrich Delgado Friedrichs <friedel at nomaden.org>
                             TauPan on Ircnet and Freenode ;)





More information about the Pkg-grub-devel mailing list