Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 580442 - sys-boot/grub:2 grub-install segfaults when installing on zfs?
Summary: sys-boot/grub:2 grub-install segfaults when installing on zfs?
Status: RESOLVED CANTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Mike Gilbert
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-04-18 15:16 UTC by wu
Modified: 2016-05-18 15:11 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description wu 2016-04-18 15:16:59 UTC
first, i installed grub2 with USE libzfs and -mutislot enabled. 
 after everything has done 
 #grub-probe / 
 segmetation fault 
 #grub-mkconfig -o /boot/grub/grub.cfg 
 prompts with no outputs 
 #grub-install /dev/sda 
 segmentation fault 
 i suspect this is a bug.
Comment 1 Mike Gilbert gentoo-dev 2016-04-18 15:40:37 UTC
Please obtain a backtrace.

https://wiki.gentoo.org/wiki/Project:Quality_Assurance/Backtraces
Comment 2 Mike Gilbert gentoo-dev 2016-04-18 15:41:17 UTC
Also, I need to know the exact version of grub you are using.
Comment 3 wu 2016-04-18 15:58:27 UTC
(In reply to Mike Gilbert from comment #2)
> Also, I need to know the exact version of grub you are using.

2.02_beta3-r1
Comment 4 wu 2016-04-18 16:02:11 UTC
(In reply to Mike Gilbert from comment #1)
> Please obtain a backtrace.
> 
> https://wiki.gentoo.org/wiki/Project:Quality_Assurance/Backtraces

please wait
Comment 5 wu 2016-04-18 16:10:29 UTC
(In reply to Mike Gilbert from comment #1)
> Please obtain a backtrace.
> 
> https://wiki.gentoo.org/wiki/Project:Quality_Assurance/Backtraces

(chroot)livecd / # which grub-probe
/usr/sbin/grub-probe
(chroot)livecd / # gdb /usr/sbin/grub-probe
GNU gdb (Gentoo 7.10.1 vanilla) 7.10.1
Copyright (C) 2015 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-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://bugs.gentoo.org/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /usr/sbin/grub-probe...(no debugging symbols found)...done.
(gdb) set args /
(gdb) run
Starting program: /usr/sbin/grub-probe /
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7ba48af in zpool_get_config () from /lib64/libzfs.so.3
(gdb) quit
A debugging session is active.
                                                                                                                                                                                                                                                                               
        Inferior 1 [process 15603] will be killed.                                                                                                                                                                                                                             
                                                                                                                                                                                                                                                                               
Quit anyway? (y or n) y
Comment 6 wu 2016-04-18 16:12:21 UTC
(In reply to Mike Gilbert from comment #1)
> Please obtain a backtrace.
> 
> https://wiki.gentoo.org/wiki/Project:Quality_Assurance/Backtraces

(chroot)livecd / # which grub-install
/usr/sbin/grub-install
(chroot)livecd / # gdb /usr/sbin/grub-install
GNU gdb (Gentoo 7.10.1 vanilla) 7.10.1
Copyright (C) 2015 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-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://bugs.gentoo.org/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /usr/sbin/grub-install...(no debugging symbols found)...done.
(gdb) set args /dev/sda
(gdb) run
Starting program: /usr/sbin/grub-install /dev/sda
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Installing for i386-pc platform.

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff797e8af in zpool_get_config () from /lib64/libzfs.so.3
Comment 7 Mike Gilbert gentoo-dev 2016-04-18 16:45:53 UTC
When you get the SIGSEGV in gdb, please run the "bt" command instead of immediately quitting.
Comment 8 wu 2016-04-19 01:43:30 UTC
(chroot)livecd / # gdb /usr/sbin/grub-probe
GNU gdb (Gentoo 7.10.1 vanilla) 7.10.1
Copyright (C) 2015 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-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://bugs.gentoo.org/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /usr/sbin/grub-probe...(no debugging symbols found)...done.
(gdb) set args /
(gdb) run
Starting program: /usr/sbin/grub-probe /
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7ba48af in zpool_get_config () from /lib64/libzfs.so.3
(gdb) bt
#0  0x00007ffff7ba48af in zpool_get_config () from /lib64/libzfs.so.3
#1  0x0000000000460484 in ?? ()
#2  0x0000000000461588 in ?? ()
#3  0x0000000000460a4b in ?? ()
#4  0x0000000000403641 in ?? ()
#5  0x0000000000402f05 in ?? ()
#6  0x00007ffff7606620 in __libc_start_main () from /lib64/libc.so.6
#7  0x0000000000402ff9 in ?? ()
(gdb) quit
A debugging session is active.

        Inferior 1 [process 27424] will be killed.                                                                                                                                                                                                                             
                                                                                                                                                                                                                                                                               
Quit anyway? (y or n) y
Comment 9 wu 2016-04-19 01:45:30 UTC
(chroot)livecd / # gdb /usr/sbin/grub-install
GNU gdb (Gentoo 7.10.1 vanilla) 7.10.1
Copyright (C) 2015 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-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://bugs.gentoo.org/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /usr/sbin/grub-install...(no debugging symbols found)...done.
(gdb) set args /dev/sda
(gdb) run
Starting program: /usr/sbin/grub-install /dev/sda
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Installing for i386-pc platform.

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff797e8af in zpool_get_config () from /lib64/libzfs.so.3
(gdb) bt
#0  0x00007ffff797e8af in zpool_get_config () from /lib64/libzfs.so.3
#1  0x0000000000482484 in ?? ()
#2  0x0000000000483588 in ?? ()
#3  0x0000000000482a4b in ?? ()
#4  0x00000000004032fb in ?? ()
#5  0x00007ffff73e0620 in __libc_start_main () from /lib64/libc.so.6
#6  0x00000000004051b9 in ?? ()
(gdb) quit
A debugging session is active.

        Inferior 1 [process 11926] will be killed.

Quit anyway? (y or n) y
Comment 10 Richard Yao (RETIRED) gentoo-dev 2016-04-19 03:10:33 UTC
The kernel modules are out of sync with the userland code that expect the stable API. Originally, the tools were supposed to use the old API, but people doing upstream review wanted them to use the new API, which broke compatibility. The new modules support the old tools though. On the bright side, they were intended to be a final compatibility break before things were stable going forward.

GRUB2 links to libzfs as part of a hack to find out about imported pools. This does not work when libzfs' interface to the kernel modules have changed. My notes have a dance where you install the userland tools that do not have the stable API first, run `grub2-*` and then install the new userland code before you boot to keep them in sync with the patched modules (although the patched modules support the old userland code):

https://github.com/ryao/zfs-overlay/blob/master/zfs-install

Anyway, we have had issues in the past because the /dev/zfs API was not stabilized. Some were outright breakage with 0.6.2 -> 0.6.3 while others were just mismatches. This was intended to kill the mismatches once and for all so that system boot is reliable going forward. The downside is that you need to do the userland tool dance during the initial install until everyone is on the same page.
Comment 11 wu 2016-05-14 02:56:52 UTC
when does newer release of grub:2 come out?
Comment 12 wu 2016-05-18 15:08:36 UTC
can zfs userland utilities be compatible with newest kernel?
Comment 13 wu 2016-05-18 15:11:06 UTC
can zfs userland utilies of version 6.3 series be compatible with newest kernel?