During update grub to last stable version, I got: * Copying files from /lib/grub and /usr/lib/grub to /boot /usr/portage/sys-boot/grub/grub-0.97-r3.ebuild: line 113: 25144 Done egrep -v '^[[:space:]]*(#|$|default|fallback|initrd|password|splashimage|timeout|title)' "${dir}"/grub/grub.conf 25145 Ошибка сегментирования | /sbin/grub --batch --device-map="${dir}"/grub/device.map > /dev/null "Ошибка сегментирования" is trasnlated as "Segmentation fault error". And by the installation after segfault continues. Reproducible: Always Steps to Reproduce: 1.emerge -vuD grub 2. 3.
Portage 2.1.1-r2 (default-linux/x86/2006.0, gcc-4.1.1, glibc-2.4-r4, 2.6.18-gentoo-r6 i686) ================================================================= System uname: 2.6.18-gentoo-r6 i686 AMD Athlon(tm) XP 2600+ Gentoo Base System version 1.12.6 Last Sync: Sat, 06 Jan 2007 07:30:01 +0000 app-admin/eselect-compiler: [Not Present] dev-java/java-config: 1.3.7, 2.0.31 dev-lang/python: 2.3.5-r2, 2.4.3-r4 dev-python/pycrypto: 2.0.1-r5 dev-util/ccache: [Not Present] dev-util/confcache: [Not Present] sys-apps/sandbox: 1.2.17 sys-devel/autoconf: 2.13, 2.61 sys-devel/automake: 1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10 sys-devel/binutils: 2.16.1-r3 sys-devel/gcc-config: 1.3.14 sys-devel/libtool: 1.5.22 virtual/os-headers: 2.6.17-r2 ACCEPT_KEYWORDS="x86" AUTOCLEAN="yes" CBUILD="i686-pc-linux-gnu" CFLAGS="-O2 -march=athlon-xp -fomit-frame-pointer -mfpmath=sse -msse -mmmx -m3dnow -pipe" CHOST="i686-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/NX/etc /usr/NX/home /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config" CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/gconf /etc/java-config/vms/ /etc/revdep-rebuild /etc/splash /etc/terminfo /etc/texmf/web2c" CXXFLAGS="-O2 -march=athlon-xp -fomit-frame-pointer -mfpmath=sse -msse -mmmx -m3dnow -pipe" DISTDIR="/usr/portage/distfiles" FEATURES="autoconfig distlocks metadata-transfer sandbox sfperms strict" GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo" LANG="ru_RU.UTF-8" LC_ALL="" LDFLAGS="-Wl,-O1 -Wl,--sort-common" LINGUAS="en ru" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude='/distfiles' --exclude='/local' --exclude='/packages'" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/home/evgeniy/portage /usr/portage/local/layman/nx" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="x86 3dnow X acl alsa alsa_cards_ali5451 alsa_cards_als4000 alsa_cards_atiixp alsa_cards_atiixp-modem alsa_cards_bt87x alsa_cards_ca0106 alsa_cards_cmipci alsa_cards_emu10k1x alsa_cards_ens1370 alsa_cards_ens1371 alsa_cards_es1938 alsa_cards_es1968 alsa_cards_fm801 alsa_cards_hda-intel alsa_cards_intel8x0 alsa_cards_intel8x0m alsa_cards_maestro3 alsa_cards_trident alsa_cards_usb-audio alsa_cards_via82xx alsa_cards_via82xx-modem alsa_cards_ymfpci alsa_pcm_plugins_adpcm alsa_pcm_plugins_alaw alsa_pcm_plugins_asym alsa_pcm_plugins_copy alsa_pcm_plugins_dmix alsa_pcm_plugins_dshare alsa_pcm_plugins_dsnoop alsa_pcm_plugins_empty alsa_pcm_plugins_extplug alsa_pcm_plugins_file alsa_pcm_plugins_hooks alsa_pcm_plugins_iec958 alsa_pcm_plugins_ioplug alsa_pcm_plugins_ladspa alsa_pcm_plugins_lfloat alsa_pcm_plugins_linear alsa_pcm_plugins_meter alsa_pcm_plugins_mulaw alsa_pcm_plugins_multi alsa_pcm_plugins_null alsa_pcm_plugins_plug alsa_pcm_plugins_rate alsa_pcm_plugins_route alsa_pcm_plugins_share alsa_pcm_plugins_shm alsa_pcm_plugins_softvol apache2 apm arts bash-completion berkdb bitmap-fonts cjk cli cracklib crypt cups dlloader doc dri eds elibc_glibc emacs emboss encode esd fam fbcon firefox font-server foomaticdb fortran gdbm gif gimpprint gpm gstreamer gtk gtk2 iconv imlib input_devices_keyboard input_devices_mouse isdnlog jpeg kde kdeenablefinal kdexdeltas kernel_linux libg++ libwww linguas_en linguas_ru logrotate mad maildir mikmod mmx motif mp3 mpeg ncurses nls nptl nptlonly ogg opengl oss pam pcre pdf perl png ppds pppd python qt3 qt4 quicktime readline reflection sdl session spel spell spl sse ssl tcpd tiff truetype truetype-fonts type1-fonts udev unicode usb userland_GNU video_cards_fbdev video_cards_nv video_cards_nvidia video_cards_vesa video_cards_vga vorbis xml xorg xv zlib" Unset: CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, PORTAGE_RSYNC_EXTRA_OPTS
so try updating grub yourself by hand and see if it segfaults
(In reply to comment #2) > so try updating grub yourself by hand and see if it segfaults > What do you mean by hand? If I made LANG=en_EN.UTF-8 sudo emerge -v =grub-0.97-r3 I got * Copying files from /lib/grub and /usr/lib/grub to /boot /usr/portage/sys-boot/grub/grub-0.97-r3.ebuild: line 113: 25287 Done egrep -v '^[[:space:]]*(#|$|default|fallback|initrd|password|splashimage|timeout|title)' "${dir}"/grub/grub.conf 25288 Segmentation fault | /sbin/grub --batch --device-map="${dir}"/grub/device.map > /dev/null
I had this same problem. This was caused by an old incorrect grub.conf file from a previous install. If the grub.conf partition info is incorrect or the grub.conf uses unusual commands or syntax the grub batch command will segfault.
this started happening on my system ... seems to be related to the kernel file size ... consider: # mount -vf /boot -o remount /dev/sda1 on /boot type ext2 (ro,noatime) # grep hd0 /boot/grub/device.map (hd0) /dev/sda # for f in vmlinuz-* ; do \ du -b $f ; \ printf "root (hd0,0)\nkernel /boot/$f\n" | \ grub --device-map=/boot/grub/device.map --batch > /dev/null ; \ done 2590629 vmlinuz-2.6.17.11-grsec 2589939 vmlinuz-2.6.17.6 2590273 vmlinuz-2.6.17.7-grsec 2590551 vmlinuz-2.6.17.9-grsec 2699735 vmlinuz-2.6.18-grsec 2742289 vmlinuz-2.6.19.1-grsec 2750664 vmlinuz-2.6.19.2-grsec 2741862 vmlinuz-2.6.20 2745881 vmlinuz-2.6.20.1 2824495 vmlinuz-2.6.20.10 2746045 vmlinuz-2.6.20.2 2823632 vmlinuz-2.6.20.4 2824372 vmlinuz-2.6.20.7 2848325 vmlinuz-2.6.21 2853155 vmlinuz-2.6.21.1 2865202 vmlinuz-2.6.21.2 2865060 vmlinuz-2.6.21.3 2885082 vmlinuz-2.6.21.5 2935944 vmlinuz-2.6.22 2956584 vmlinuz-2.6.22.2 2956584 vmlinuz-2.6.22.2.old 3151384 vmlinuz-2.6.23 Segmentation fault 3151416 vmlinuz-2.6.23.1 Segmentation fault 3151768 vmlinuz-2.6.23.14 Segmentation fault 3151384 vmlinuz-2.6.23.1.old Segmentation fault 3223896 vmlinuz-2.6.24 Segmentation fault 3284120 vmlinuz-2.6.24.4 Segmentation fault 3223896 vmlinuz-2.6.24.old Segmentation fault
gdb backtrace in case someone feels like poking this Program received signal SIGSEGV, Segmentation fault. 0x08065260 in load_image (kernel=0xf79e0c67 "/boot/vmlinuz", arg=0xf79cc000 "/boot/vmlinuz", suggested_type=KERNEL_TYPE_NONE, load_flags=1) at boot.c:448 448 *dest = 0; (gdb) bt #0 0x08065260 in load_image (kernel=0xf79e0c67 "/boot/vmlinuz", arg=0xf79cc000 "/boot/vmlinuz", suggested_type=KERNEL_TYPE_NONE, load_flags=1) at boot.c:448 #1 0x080603d5 in kernel_func (arg=0xf79e0c67 "/boot/vmlinuz", flags=1) at builtins.c:2582 #2 0x080638bb in enter_cmdline (heap=0xf79e0c60 "kernel /boot/vmlinuz", forever=1) at cmdline.c:172 #3 0x0805c51e in cmain () at stage2.c:1079 #4 0x0804d3a2 in init_bios_info () at common.c:337 #5 0x08049fd8 in doit () at asmstub.c:180 #6 0x08049e83 in grub_stage2 () at asmstub.c:263 #7 0x08049b29 in main (argc=3, argv=0xffd8e4c4) at main.c:264
vapier: can I please see your full "ls -la /boot"?
i can tar up a reduced set if you like ... $ ls -l /boot/ total 122261 lrwxrwxrwx 1 root root 1 2005-03-08 20:02 boot -> . lrwxrwxrwx 1 root root 15 2008-03-24 18:57 config -> config-2.6.24.4 -rw-r--r-- 1 root root 37940 2006-09-04 17:56 config-2.6.17.11-grsec -rw-r--r-- 1 root root 37076 2006-08-05 18:55 config-2.6.17.7-grsec -rw-r--r-- 1 root root 37939 2006-08-28 18:12 config-2.6.17.9-grsec -rw-r--r-- 1 root root 39857 2006-09-24 08:02 config-2.6.18-grsec -rw-r--r-- 1 root root 42756 2006-12-16 21:58 config-2.6.19.1-grsec -rw-r--r-- 1 root root 42803 2007-01-17 01:19 config-2.6.19.2-grsec -rw-r--r-- 1 root root 41091 2007-02-17 08:36 config-2.6.20 -rw-r--r-- 1 root root 43832 2007-03-02 14:41 config-2.6.20.1 -rw-r--r-- 1 root root 45050 2007-04-30 11:46 config-2.6.20.10 -rw-r--r-- 1 root root 43938 2007-03-11 17:14 config-2.6.20.2 -rw-r--r-- 1 root root 44086 2007-03-26 22:22 config-2.6.20.4 -rw-r--r-- 1 root root 45050 2007-04-18 16:27 config-2.6.20.7 -rw-r--r-- 1 root root 45165 2007-04-30 12:38 config-2.6.21 -rw-r--r-- 1 root root 45154 2007-05-14 20:31 config-2.6.21.1 -rw-r--r-- 1 root root 46200 2007-05-24 01:18 config-2.6.21.2 -rw-r--r-- 1 root root 46189 2007-06-02 10:00 config-2.6.21.3 -rw-r--r-- 1 root root 47707 2007-06-29 15:44 config-2.6.21.5 -rw-r--r-- 1 root root 45960 2007-07-08 21:12 config-2.6.22 -rw-r--r-- 1 root root 47362 2007-08-16 21:22 config-2.6.22.2 -rw-r--r-- 1 root root 47362 2007-08-16 21:22 config-2.6.22.2.old -rw-r--r-- 1 root root 47789 2007-10-09 22:37 config-2.6.23 -rw-r--r-- 1 root root 48173 2008-01-16 19:34 config-2.6.23.1 -rw-r--r-- 1 root root 48173 2008-01-16 19:52 config-2.6.23.14 -rw-r--r-- 1 root root 47789 2007-12-09 21:01 config-2.6.23.1.old -rw-r--r-- 1 root root 52501 2008-02-01 19:08 config-2.6.24 -rw-r--r-- 1 root root 53015 2008-03-24 18:57 config-2.6.24.4 -rw-r--r-- 1 root root 52501 2008-02-01 19:08 config-2.6.24.old lrwxrwxrwx 1 root root 13 2008-02-01 19:08 config.old -> config-2.6.24 drwxr-xr-x 2 root root 1024 2008-03-28 21:43 grub drwx------ 2 root root 12288 2005-01-23 21:13 lost+found drwxr-xr-x 2 root root 1024 2008-02-11 12:42 memtest86plus lrwxrwxrwx 1 root root 19 2008-03-24 18:57 System.map -> System.map-2.6.24.4 -rw-r--r-- 1 root root 1310224 2006-09-04 17:56 System.map-2.6.17.11-grsec -rw-r--r-- 1 root root 1308563 2006-08-05 18:55 System.map-2.6.17.7-grsec -rw-r--r-- 1 root root 1311084 2006-08-28 18:12 System.map-2.6.17.9-grsec -rw-r--r-- 1 root root 1369376 2006-09-24 08:02 System.map-2.6.18-grsec -rw-r--r-- 1 root root 1416681 2006-12-16 21:58 System.map-2.6.19.1-grsec -rw-r--r-- 1 root root 1418156 2007-01-17 01:19 System.map-2.6.19.2-grsec -rw-r--r-- 1 root root 1424384 2007-02-17 08:36 System.map-2.6.20 -rw-r--r-- 1 root root 1425468 2007-03-02 14:41 System.map-2.6.20.1 -rw-r--r-- 1 root root 1448555 2007-04-30 11:46 System.map-2.6.20.10 -rw-r--r-- 1 root root 1425728 2007-03-11 17:14 System.map-2.6.20.2 -rw-r--r-- 1 root root 1448555 2007-03-26 22:22 System.map-2.6.20.4 -rw-r--r-- 1 root root 1448555 2007-04-18 16:27 System.map-2.6.20.7 -rw-r--r-- 1 root root 1471131 2007-04-30 12:38 System.map-2.6.21 -rw-r--r-- 1 root root 1472417 2007-05-14 20:31 System.map-2.6.21.1 -rw-r--r-- 1 root root 1473250 2007-05-24 01:18 System.map-2.6.21.2 -rw-r--r-- 1 root root 1473793 2007-06-02 10:00 System.map-2.6.21.3 -rw-r--r-- 1 root root 1481176 2007-06-29 15:44 System.map-2.6.21.5 -rw-r--r-- 1 root root 1501097 2007-07-08 21:12 System.map-2.6.22 -rw-r--r-- 1 root root 1508507 2007-08-16 21:22 System.map-2.6.22.2 -rw-r--r-- 1 root root 1508507 2007-08-16 21:22 System.map-2.6.22.2.old -rw-r--r-- 1 root root 1597789 2007-10-09 22:37 System.map-2.6.23 -rw-r--r-- 1 root root 1597789 2008-01-16 19:34 System.map-2.6.23.1 -rw-r--r-- 1 root root 1598393 2008-01-16 19:52 System.map-2.6.23.14 -rw-r--r-- 1 root root 1597789 2007-12-09 21:01 System.map-2.6.23.1.old -rw-r--r-- 1 root root 1653835 2008-02-01 19:08 System.map-2.6.24 -rw-r--r-- 1 root root 1623690 2008-03-24 18:57 System.map-2.6.24.4 -rw-r--r-- 1 root root 1653835 2008-02-01 19:08 System.map-2.6.24.old lrwxrwxrwx 1 root root 17 2008-02-01 19:08 System.map.old -> System.map-2.6.24 lrwxrwxrwx 1 root root 16 2008-03-24 18:57 vmlinuz -> vmlinuz-2.6.24.4 -rw-r--r-- 1 root root 2590629 2006-09-04 17:56 vmlinuz-2.6.17.11-grsec -rw-r--r-- 1 root root 2589939 2006-07-19 14:26 vmlinuz-2.6.17.6 -rw-r--r-- 1 root root 2590273 2006-08-05 18:55 vmlinuz-2.6.17.7-grsec -rw-r--r-- 1 root root 2590551 2006-08-28 18:12 vmlinuz-2.6.17.9-grsec -rw-r--r-- 1 root root 2699735 2006-09-24 08:02 vmlinuz-2.6.18-grsec -rw-r--r-- 1 root root 2742289 2006-12-16 21:58 vmlinuz-2.6.19.1-grsec -rw-r--r-- 1 root root 2750664 2007-01-17 01:19 vmlinuz-2.6.19.2-grsec -rw-r--r-- 1 root root 2741862 2007-02-17 08:36 vmlinuz-2.6.20 -rw-r--r-- 1 root root 2745881 2007-03-02 14:41 vmlinuz-2.6.20.1 -rw-r--r-- 1 root root 2824495 2007-04-30 11:46 vmlinuz-2.6.20.10 -rw-r--r-- 1 root root 2746045 2007-03-11 17:14 vmlinuz-2.6.20.2 -rw-r--r-- 1 root root 2823632 2007-03-26 22:22 vmlinuz-2.6.20.4 -rw-r--r-- 1 root root 2824372 2007-04-18 16:27 vmlinuz-2.6.20.7 -rw-r--r-- 1 root root 2848325 2007-04-30 12:38 vmlinuz-2.6.21 -rw-r--r-- 1 root root 2853155 2007-05-14 20:31 vmlinuz-2.6.21.1 -rw-r--r-- 1 root root 2865202 2007-05-24 01:18 vmlinuz-2.6.21.2 -rw-r--r-- 1 root root 2865060 2007-06-02 10:00 vmlinuz-2.6.21.3 -rw-r--r-- 1 root root 2885082 2007-06-29 15:44 vmlinuz-2.6.21.5 -rw-r--r-- 1 root root 2935944 2007-07-08 21:12 vmlinuz-2.6.22 -rw-r--r-- 1 root root 2956584 2007-08-16 21:22 vmlinuz-2.6.22.2 -rw-r--r-- 1 root root 2956584 2007-08-16 21:22 vmlinuz-2.6.22.2.old -rw-r--r-- 1 root root 3151384 2007-10-09 22:37 vmlinuz-2.6.23 -rw-r--r-- 1 root root 3151416 2008-01-16 19:34 vmlinuz-2.6.23.1 -rw-r--r-- 1 root root 3151768 2008-01-16 19:52 vmlinuz-2.6.23.14 -rw-r--r-- 1 root root 3151384 2007-12-09 21:01 vmlinuz-2.6.23.1.old -rw-r--r-- 1 root root 3223896 2008-02-01 19:08 vmlinuz-2.6.24 -rw-r--r-- 1 root root 3284120 2008-03-24 18:57 vmlinuz-2.6.24.4 -rw-r--r-- 1 root root 3223896 2008-02-01 19:08 vmlinuz-2.6.24.old lrwxrwxrwx 1 root root 14 2007-08-17 00:12 vmlinuz.ok -> vmlinuz-2.6.22 lrwxrwxrwx 1 root root 14 2008-02-01 19:08 vmlinuz.old -> vmlinuz-2.6.24 -rw-r--r-- 1 root root 2590273 2006-08-19 07:38 vmlinuz-work $ ls -l /boot/grub/ total 476 -rw-r--r-- 1 root root 197 2008-03-04 08:32 default -rw-r--r-- 1 root root 30 2005-11-10 11:32 device.map -rw-r--r-- 1 root root 8096 2008-03-28 21:43 e2fs_stage1_5 -rw-r--r-- 1 root root 7844 2008-03-28 21:43 fat_stage1_5 -rw-r--r-- 1 root root 7120 2008-03-28 21:43 ffs_stage1_5 -rw-r--r-- 1 root root 709 2007-10-20 13:39 grub.conf -rw-r--r-- 1 root root 1842 2008-03-28 21:43 grub.conf.sample -rw-r--r-- 1 root root 7112 2008-03-28 21:43 iso9660_stage1_5 -rw-r--r-- 1 root root 8784 2008-03-28 21:43 jfs_stage1_5 lrwxrwxrwx 1 root root 9 2005-03-08 20:02 menu.lst -> grub.conf -rw-r--r-- 1 root root 7336 2008-03-28 21:43 minix_stage1_5 -rw-r--r-- 1 root root 9732 2008-03-28 21:43 reiserfs_stage1_5 -rw-r--r-- 1 root root 33856 2008-03-28 21:43 splash.xpm.gz -rw-r--r-- 1 root root 33856 2005-07-21 21:43 splash.xpm.gz.old -rw-r--r-- 1 root root 512 2008-03-28 21:43 stage1 -rw-r--r-- 1 root root 107236 2008-03-28 21:43 stage2 -rw-r--r-- 1 root root 107236 2008-03-28 21:43 stage2_eltorito -rw-r--r-- 1 root root 107236 2008-03-28 18:17 stage2.old -rw-r--r-- 1 root root 7376 2008-03-28 21:43 ufs2_stage1_5 -rw-r--r-- 1 root root 6724 2008-03-28 21:43 vstafs_stage1_5 -rw-r--r-- 1 root root 9540 2008-03-28 21:43 xfs_stage1_5
vapier+dushistov: please attach your grub.conf files. vapier: - your emerge --info please? - which revision of grub were you using for the backtrace you pasted here? - That code in boot.c does look a bit iffy around that point. I'm going to see if I can come up with a way to reproduce this myself, so I can get gdb to poke at some of the variables, but if not, I'll tell you which ones i'm interested in.
grub.conf doesnt matter ... grub doesnt read it i'm testing only the latest version of course (0.97-r5), but r3/4/5 all crash in the same way did you try building up a fatty kernel (>3.1megs) ? this is my amd64 dev box, so it's running the latest p.masked amd64 ... gcc-4.3/glibc-2.7/binutils-2.18.50.0.5
spanky: a chunk of that code does check for mem= in the config line, so that's why I asked about grub.conf.
... and as i said, grub doesnt read grub.conf. strace the example i posted and you'll see grub doesnt access any config files. but to be explicit, i dont use any weird mem options.
Please test grub-0.97-r5 revision 1.4, I have made a test patch for this, but I'm worried about negative sideeffects.
works for me, cheers