fdisk, cfdisk and sfdisk fail with a "unable to seek /dev/***" message Reproducible: Always Steps to Reproduce: 1.fdisk -l /dev/hda 2. 3. Actual Results: "unable to seek /dev/hda" Expected Results: Report of hda's partition table Other users have reported the same problem, neither cfdisk or sfdiosk work either. Switching to vanilla gcc and re-emerging util-linux seems to fix the problem. The same problem does not appear to exist on hardened amd64. Will post emerge info when I get back to my machine, but cflags are; -O2 -march=pentium3 -pipe -fomit-frame-pointer
tinderbox mozilla # file `which fdisk` /sbin/fdisk: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), stripped tinderbox mozilla # fdisk -l /dev/sda Disk /dev/sda: 36.4 GB, 36420075008 bytes 255 heads, 63 sectors/track, 4427 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/sda1 * 1 13 104391 83 Linux /dev/sda2 14 136 987997+ 82 Linux swap / Solaris /dev/sda3 137 4427 34467457+ 83 Linux tinderbox mozilla # emerge -V Portage 2.0.51.22-r3 (hardened/x86/2.6, gcc-3.3.6, glibc-2.3.5-r2, 2.6.11-hardened-r15 i686) This is using sys-apps/util-linux-2.12r Toolchain = gcc version 3.3.6 (Gentoo Hardened 3.3.6, ssp-3.3.6-1.0, pie-8.7.8) This is pure stable and I can't reproduce.
I can reproduce the problem on two AMD 32bit systems. Portage 2.0.51.22-r3 (hardened/x86/2.6, gcc-3.3.6, glibc-2.3.5-r2, 2.6.11-hardened-r15 i686) ================================================================= System uname: 2.6.11-hardened-r15 i686 AMD Athlon(tm) Processor marmolata ~ # file `which fdisk` /sbin/fdisk: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), stripped The things that have been updated on my system since I last remember fdisk working are: gcc-3.3.5.20050130-r1 update to gcc-3.3.6 udev-058 to udev-068 util-linux-2.12i-r1 to util-linux-2.12q-r3 to util-linux-2.12r glibc-2.3.5-r1 to glibc-2.3.5-r2 Re-emerging util-linux with vanilla gcc fixes the problem.
Does this only happen on AMD 32bit system? Does mering with hardened specs enabled with CFLAGS="-nopie" work around the problem? Anybody got a proper trace, error logs while compiling? Wondering if it has anything todo with lseek64() vs llseek()
I have few xeon servers with hardened gcc, and fdisk/sfdisk/cfdisk don't work properly anymore, please look at the original post: http://forums.gentoo.org/viewtopic.php?p=2781689 thanks simba
[ebuild R ] sys-apps/util-linux-2.12r +crypt -nls -old-crypt +pam +perl (-selinux) -static 0 kB Total size of downloads: 0 kB frog netwox # fdisk -l /dev/hda Disk /dev/hda: 80.0 GB, 80026361856 bytes 255 heads, 63 sectors/track, 9729 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/hda1 1 6 48163+ 83 Linux /dev/hda2 * 7 1222 9767520 8e Linux LVM /dev/hda3 1223 2438 9767520 8e Linux LVM /dev/hda4 2439 9729 58564957+ 5 Extended /dev/hda5 2439 3654 9767488+ 83 Linux /dev/hda6 3655 9697 48540366 83 Linux /dev/hda7 9698 9729 257008+ 82 Linux swap / Solaris frog netwox # emerge info Portage 2.0.53_rc3 (hardened/x86/2.6, gcc-3.4.4, glibc-2.3.5-r1, 2.6.12-gentoo-r6 i686) ================================================================= System uname: 2.6.12-gentoo-r6 i686 AMD Athlon(tm) XP 1900+ Gentoo Base System version 1.6.13 distcc 2.18.3 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled] ccache version 2.3 [disabled] dev-lang/python: 2.3.5-r2 sys-apps/sandbox: 1.2.13 sys-devel/autoconf: 2.13, 2.59-r6 sys-devel/automake: 1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1 sys-devel/binutils: 2.16.1 sys-devel/libtool: 1.5.18-r1 virtual/os-headers: 2.6.11-r2 ACCEPT_KEYWORDS="x86" AUTOCLEAN="yes" CBUILD="i686-pc-linux-gnu" CFLAGS="-march=athlon-xp -O2 -pipe" CHOST="i686-pc-linux-gnu" --------------------------------------------------------------------------- --------------------------------------------------------------------------- * Switching to i686-pc-linux-gnu-3.3.5 compiler ... frog netwox # fdisk -l /dev/hda Disk /dev/hda: 80.0 GB, 80026361856 bytes 255 heads, 63 sectors/track, 9729 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/hda1 1 6 48163+ 83 Linux /dev/hda2 * 7 1222 9767520 8e Linux LVM /dev/hda3 1223 2438 9767520 8e Linux LVM /dev/hda4 2439 9729 58564957+ 5 Extended /dev/hda5 2439 3654 9767488+ 83 Linux /dev/hda6 3655 9697 48540366 83 Linux /dev/hda7 9698 9729 257008+ 82 Linux swap / Solaris frog netwox # emerge info Portage 2.0.53_rc3 (hardened/x86/2.6, gcc-3.3.5, glibc-2.3.5-r1, 2.6.12-gentoo-r6 i686) ================================================================= System uname: 2.6.12-gentoo-r6 i686 AMD Athlon(tm) XP 1900+ Gentoo Base System version 1.6.13 distcc 2.18.3 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled] ccache version 2.3 [disabled] dev-lang/python: 2.3.5-r2 sys-apps/sandbox: 1.2.13 sys-devel/autoconf: 2.13, 2.59-r6 sys-devel/automake: 1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1 sys-devel/binutils: 2.16.1 sys-devel/libtool: 1.5.18-r1 virtual/os-headers: 2.6.11-r2 ACCEPT_KEYWORDS="x86" AUTOCLEAN="yes" CBUILD="i686-pc-linux-gnu" CFLAGS="-march=athlon-xp -O2 -pipe" CHOST="i686-pc-linux-gnu" Having trouble reproducing need more info particularly on linux-headers versions
CFLAGS+=-fno-omit-frame-pointer ; solves it right after the include ../MCONFIG in fdisk/Makefile Thanks for the bug report. Fixed in util-linux-2.12r-r1 And thanks to Solar for actually fixing it.