Bug#891773: Related bug #871229 (but it didn't break my system))

2018-03-02 Thread Diederik de Haas
On vrijdag 2 maart 2018 09:49:39 CET John Paul Adrian Glaubitz wrote:
> Here's an updated patch sparc64-support.patch which should address the
> issue,
> it contains these two patches:
> > http://lists.gnu.org/archive/html/grub-devel/2018-03/msg00016.html
> > http://lists.gnu.org/archive/html/grub-devel/2018-03/msg00018.html
> 
> @Martin and Diederik, could you test these updated packages?
> 
> > https://people.debian.org/~glaubitz/grub-891773/

Still works without segfaults.
Any particular info you'd like to see as well?

signature.asc
Description: This is a digitally signed message part.


Bug#891773: Related bug #871229 (but it didn't break my system))

2018-03-02 Thread John Paul Adrian Glaubitz

On 03/02/2018 02:58 PM, Diederik de Haas wrote:

Still works without segfaults.
Any particular info you'd like to see as well?


No. But you should re-test version -3 that was just uploaded once it
becomes available.

Adrian

--
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - glaub...@debian.org
`. `'   Freie Universitaet Berlin - glaub...@physik.fu-berlin.de
  `-GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913



Bug#891773: Related bug #871229 (but it didn't break my system))

2018-03-02 Thread John Paul Adrian Glaubitz
Hi!

Here's an updated patch sparc64-support.patch which should address the issue,
it contains these two patches:

> http://lists.gnu.org/archive/html/grub-devel/2018-03/msg00016.html
> http://lists.gnu.org/archive/html/grub-devel/2018-03/msg00018.html

@Martin and Diederik, could you test these updated packages?

> https://people.debian.org/~glaubitz/grub-891773/

@Colin, could you update the sparc64-support.patch to include the
two changes above? I have also attached an updated patch.

Thanks to everyone for helping to catch this regression!

Adrian

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - glaub...@debian.org
`. `'   Freie Universitaet Berlin - glaub...@physik.fu-berlin.de
  `-GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913
>From 48ab5733b350bb96ae3c3b1513093f8a847be9e9 Mon Sep 17 00:00:00 2001
From: Eric Snowberg 
Date: Thu, 22 Feb 2018 10:03:46 +
Subject: Add support for modern sparc64 hardware

Origin: other, https://github.com/esnowberg/grub2-sparc/tree/sparc-next-v4
Bug-Debian: https://bugs.debian.org/854568
Last-Update: 2018-03-02

Patch-Name: sparc64-support.patch
---
 grub-core/Makefile.core.def|1 +
 grub-core/boot/sparc64/ieee1275/boot.S |   10 +
 grub-core/commands/ls.c|2 +
 grub-core/commands/nativedisk.c|1 +
 grub-core/disk/ieee1275/obdisk.c   | 1079 
 grub-core/disk/ieee1275/ofdisk.c   |   30 +-
 grub-core/kern/ieee1275/cmain.c|3 +
 grub-core/kern/ieee1275/ieee1275.c |  199 +
 grub-core/kern/ieee1275/init.c |   36 +-
 grub-core/kern/ieee1275/openfw.c   |   27 +
 grub-core/kern/parser.c|1 -
 grub-core/kern/sparc64/ieee1275/ieee1275.c |   53 ++
 grub-core/osdep/linux/blocklist.c  |5 +
 grub-core/osdep/linux/ofpath.c |  194 -
 include/grub/disk.h|1 +
 include/grub/ieee1275/ieee1275.h   |   27 +
 include/grub/ieee1275/obdisk.h |   25 +
 include/grub/sparc64/ieee1275/ieee1275.h   |2 +
 util/grub-install.c|1 +
 util/ieee1275/grub-ofpathname.c|4 +-
 util/setup.c   |   87 ++-
 21 files changed, 1733 insertions(+), 55 deletions(-)
 create mode 100644 grub-core/disk/ieee1275/obdisk.c
 create mode 100644 include/grub/ieee1275/obdisk.h

Index: grub2-2.02+dfsg1/grub-core/Makefile.core.def
===
--- grub2-2.02+dfsg1.orig/grub-core/Makefile.core.def
+++ grub2-2.02+dfsg1/grub-core/Makefile.core.def
@@ -270,6 +270,7 @@ kernel = {
   sparc64_ieee1275 = kern/sparc64/cache.S;
   sparc64_ieee1275 = kern/sparc64/dl.c;
   sparc64_ieee1275 = kern/sparc64/ieee1275/ieee1275.c;
+  sparc64_ieee1275 = disk/ieee1275/obdisk.c;
 
   arm = kern/arm/dl.c;
   arm = kern/arm/dl_helper.c;
Index: grub2-2.02+dfsg1/grub-core/boot/sparc64/ieee1275/boot.S
===
--- grub2-2.02+dfsg1.orig/grub-core/boot/sparc64/ieee1275/boot.S
+++ grub2-2.02+dfsg1/grub-core/boot/sparc64/ieee1275/boot.S
@@ -69,6 +69,10 @@ prom_seek_name:		.asciz "seek"
 prom_read_name:		.asciz "read"
 prom_exit_name:		.asciz "exit"
 grub_name:		.asciz "GRUB "
+#ifdef CDBOOT
+prom_close_name:	.asciz "close"
+#endif
+
 #define GRUB_NAME_LEN	5
 
 	.align	4
@@ -213,6 +217,12 @@ bootpath_known:
 	call	prom_call_3_1_o1
 #ifdef CDBOOT
 	 LDUW_ABS(kernel_size, 0x00, %o3)
+
+	GET_ABS(prom_close_name, %o0)
+	mov	1, %g1
+	mov	0, %o5
+	call	prom_call
+	 mov	BOOTDEV_REG, %o1
 #else
 	 mov	512, %o3
 #endif
Index: grub2-2.02+dfsg1/grub-core/commands/ls.c
===
--- grub2-2.02+dfsg1.orig/grub-core/commands/ls.c
+++ grub2-2.02+dfsg1/grub-core/commands/ls.c
@@ -201,6 +201,8 @@ grub_ls_list_files (char *dirname, int l
   if (grub_errno == GRUB_ERR_UNKNOWN_FS)
 	grub_errno = GRUB_ERR_NONE;
 
+  grub_device_close (dev);
+  dev = NULL;
   grub_normal_print_device_info (device_name);
 }
   else if (fs)
Index: grub2-2.02+dfsg1/grub-core/commands/nativedisk.c
===
--- grub2-2.02+dfsg1.orig/grub-core/commands/nativedisk.c
+++ grub2-2.02+dfsg1/grub-core/commands/nativedisk.c
@@ -66,6 +66,7 @@ get_uuid (const char *name, char **uuid,
   /* Firmware disks.  */
 case GRUB_DISK_DEVICE_BIOSDISK_ID:
 case GRUB_DISK_DEVICE_OFDISK_ID:
+case GRUB_DISK_DEVICE_OBDISK_ID:
 case GRUB_DISK_DEVICE_EFIDISK_ID:
 case GRUB_DISK_DEVICE_NAND_ID:
 case GRUB_DISK_DEVICE_ARCDISK_ID:
Index: grub2-2.02+dfsg1/grub-core/disk/ieee1275/obdisk.c
===
--- /dev/null
+++ grub2-2.02+dfsg1/grub-core/disk/ieee1275/obdisk.c
@@ -0,0 +1,1079 @@
+/* obdisk.c - Open Boot disk access. 

Bug#891773: Related bug #871229 (but it didn't break my system))

2018-03-01 Thread John Paul Adrian Glaubitz

On 03/01/2018 05:15 PM, Diederik de Haas wrote:

No more segfaults :-)


Alright. Attaching an updated patch for sparc64 support for Colin.

Adrian

--
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - glaub...@debian.org
`. `'   Freie Universitaet Berlin - glaub...@physik.fu-berlin.de
  `-GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913
>From 48ab5733b350bb96ae3c3b1513093f8a847be9e9 Mon Sep 17 00:00:00 2001
From: Eric Snowberg 
Date: Thu, 22 Feb 2018 10:03:46 +
Subject: Add support for modern sparc64 hardware

Origin: other, https://github.com/esnowberg/grub2-sparc/tree/sparc-next-v4
Bug-Debian: https://bugs.debian.org/854568
Last-Update: 2018-03-01

Patch-Name: sparc64-support.patch
---
 grub-core/Makefile.core.def|1 +
 grub-core/boot/sparc64/ieee1275/boot.S |   10 +
 grub-core/commands/ls.c|2 +
 grub-core/commands/nativedisk.c|1 +
 grub-core/disk/ieee1275/obdisk.c   | 1079 
 grub-core/disk/ieee1275/ofdisk.c   |   30 +-
 grub-core/kern/ieee1275/cmain.c|3 +
 grub-core/kern/ieee1275/ieee1275.c |  199 +
 grub-core/kern/ieee1275/init.c |   36 +-
 grub-core/kern/ieee1275/openfw.c   |   27 +
 grub-core/kern/parser.c|1 -
 grub-core/kern/sparc64/ieee1275/ieee1275.c |   53 ++
 grub-core/osdep/linux/blocklist.c  |5 +
 grub-core/osdep/linux/ofpath.c |  194 -
 include/grub/disk.h|1 +
 include/grub/ieee1275/ieee1275.h   |   27 +
 include/grub/ieee1275/obdisk.h |   25 +
 include/grub/sparc64/ieee1275/ieee1275.h   |2 +
 util/grub-install.c|1 +
 util/ieee1275/grub-ofpathname.c|4 +-
 util/setup.c   |   87 ++-
 21 files changed, 1733 insertions(+), 55 deletions(-)
 create mode 100644 grub-core/disk/ieee1275/obdisk.c
 create mode 100644 include/grub/ieee1275/obdisk.h

Index: grub2-2.02+dfsg1/grub-core/Makefile.core.def
===
--- grub2-2.02+dfsg1.orig/grub-core/Makefile.core.def
+++ grub2-2.02+dfsg1/grub-core/Makefile.core.def
@@ -270,6 +270,7 @@ kernel = {
   sparc64_ieee1275 = kern/sparc64/cache.S;
   sparc64_ieee1275 = kern/sparc64/dl.c;
   sparc64_ieee1275 = kern/sparc64/ieee1275/ieee1275.c;
+  sparc64_ieee1275 = disk/ieee1275/obdisk.c;
 
   arm = kern/arm/dl.c;
   arm = kern/arm/dl_helper.c;
Index: grub2-2.02+dfsg1/grub-core/boot/sparc64/ieee1275/boot.S
===
--- grub2-2.02+dfsg1.orig/grub-core/boot/sparc64/ieee1275/boot.S
+++ grub2-2.02+dfsg1/grub-core/boot/sparc64/ieee1275/boot.S
@@ -69,6 +69,10 @@ prom_seek_name:		.asciz "seek"
 prom_read_name:		.asciz "read"
 prom_exit_name:		.asciz "exit"
 grub_name:		.asciz "GRUB "
+#ifdef CDBOOT
+prom_close_name:	.asciz "close"
+#endif
+
 #define GRUB_NAME_LEN	5
 
 	.align	4
@@ -213,6 +217,12 @@ bootpath_known:
 	call	prom_call_3_1_o1
 #ifdef CDBOOT
 	 LDUW_ABS(kernel_size, 0x00, %o3)
+
+	GET_ABS(prom_close_name, %o0)
+	mov	1, %g1
+	mov	0, %o5
+	call	prom_call
+	 mov	BOOTDEV_REG, %o1
 #else
 	 mov	512, %o3
 #endif
Index: grub2-2.02+dfsg1/grub-core/commands/ls.c
===
--- grub2-2.02+dfsg1.orig/grub-core/commands/ls.c
+++ grub2-2.02+dfsg1/grub-core/commands/ls.c
@@ -201,6 +201,8 @@ grub_ls_list_files (char *dirname, int l
   if (grub_errno == GRUB_ERR_UNKNOWN_FS)
 	grub_errno = GRUB_ERR_NONE;
 
+  grub_device_close (dev);
+  dev = NULL;
   grub_normal_print_device_info (device_name);
 }
   else if (fs)
Index: grub2-2.02+dfsg1/grub-core/commands/nativedisk.c
===
--- grub2-2.02+dfsg1.orig/grub-core/commands/nativedisk.c
+++ grub2-2.02+dfsg1/grub-core/commands/nativedisk.c
@@ -66,6 +66,7 @@ get_uuid (const char *name, char **uuid,
   /* Firmware disks.  */
 case GRUB_DISK_DEVICE_BIOSDISK_ID:
 case GRUB_DISK_DEVICE_OFDISK_ID:
+case GRUB_DISK_DEVICE_OBDISK_ID:
 case GRUB_DISK_DEVICE_EFIDISK_ID:
 case GRUB_DISK_DEVICE_NAND_ID:
 case GRUB_DISK_DEVICE_ARCDISK_ID:
Index: grub2-2.02+dfsg1/grub-core/disk/ieee1275/obdisk.c
===
--- /dev/null
+++ grub2-2.02+dfsg1/grub-core/disk/ieee1275/obdisk.c
@@ -0,0 +1,1079 @@
+/* obdisk.c - Open Boot disk access.  */
+/*
+ *  GRUB  --  GRand Unified Bootloader
+ *  Copyright (C) 2017 Free Software Foundation, Inc.
+ *
+ *  GRUB is free software: you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  GRUB is distributed in the hope that it will be 

Bug#891773: Related bug #871229 (but it didn't break my system))

2018-03-01 Thread Diederik de Haas
On donderdag 1 maart 2018 17:02:28 CET John Paul Adrian Glaubitz wrote:
> I have updated the packages with the patch I just came up with:
> > https://people.debian.org/~glaubitz/grub-891773/
> 
> Can you retry?

No more segfaults :-)


signature.asc
Description: This is a digitally signed message part.


Bug#891773: Related bug #871229 (but it didn't break my system))

2018-03-01 Thread John Paul Adrian Glaubitz

On 03/01/2018 03:22 PM, Diederik de Haas wrote:

So it didn't seem to have fixed the issue, but maybe some additional info.
If you need other info or want me to run other (debugging) commands, let me 
know.
Preferably with detailed instructions as I just learned today how to do the 
'bt' command.


I have updated the packages with the patch I just came up with:


https://people.debian.org/~glaubitz/grub-891773/


Can you retry?

Adrian

--
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - glaub...@debian.org
`. `'   Freie Universitaet Berlin - glaub...@physik.fu-berlin.de
  `-GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913



Bug#891773: Related bug #871229 (but it didn't break my system))

2018-03-01 Thread John Paul Adrian Glaubitz

On 03/01/2018 04:06 PM, John Paul Adrian Glaubitz wrote:

Let me test a patch.


The problem is that of_path is empty here and the strcat tries
to append "disk" to an empty buffer which fails.

This fixes it for me:

diff --git a/grub-core/osdep/linux/ofpath.c b/grub-core/osdep/linux/ofpath.c
index 1c30e7233..daf0f 100644
--- a/grub-core/osdep/linux/ofpath.c
+++ b/grub-core/osdep/linux/ofpath.c
@@ -389,8 +389,13 @@ of_path_of_nvme(const char *sys_devname 
__attribute__((unused)),
 }
 
   of_path = find_obppath (sysfs_path);

+
+  if(of_path)
+strcat (of_path, disk);
+  else
+of_path = strdup(disk);
+
   free (sysfs_path);
-  strcat (of_path, disk);
   return of_path;
 }

root@trlin:..glaubitz/grub> ./grub-probe --device /dev/nvme0n1 
--target=hints_string
--hint-ieee1275='ieee1275//disk@1'
root@trlin:..glaubitz/grub>

I'll send a patch upstream.

Adrian

--
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - glaub...@debian.org
`. `'   Freie Universitaet Berlin - glaub...@physik.fu-berlin.de
  `-GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913



Bug#891773: Related bug #871229 (but it didn't break my system))

2018-03-01 Thread John Paul Adrian Glaubitz

Looking at the code in grub-core/osdep/linux/ofpath.c, the issue is
most likely that the buffer that of_path is pointing to of_path_of_nvme()
is not large enough to hold both the contents of *of_path and 
disk[MAX_DISK_CAT].

Let me test a patch.

Adrian

--
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - glaub...@debian.org
`. `'   Freie Universitaet Berlin - glaub...@physik.fu-berlin.de
  `-GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913



Bug#891773: Related bug #871229 (but it didn't break my system))

2018-03-01 Thread John Paul Adrian Glaubitz

On 03/01/2018 03:30 PM, John Paul Adrian Glaubitz wrote:

On 03/01/2018 03:22 PM, Diederik de Haas wrote:

#2  of_path_of_nvme (sys_devname=0x55973f55efd0 "/dev/nvme0n1", devnode=0x55973f55d950 
"/dev/nvme0n", devicenode=0x55973f55df10 "nvme0n", device=)
 at ../../grub-core/osdep/linux/ofpath.c:388


It crashes in of_path_of_nvme() which Eric added in [1]. I need to
find a machine with NVME here so I can debug it myself.


Found a machine with an NVME disk. It's an upstream bug and I can reproduce
it with GRUB compiled from git master:

root@trlin:..glaubitz/grub> ./grub-probe --device /dev/nvme0n1 
--target=hints_string
Segmentation fault
root@trlin:..glaubitz/grub>

It only crashes when passing "--target=hints_string". Trying to debug it now.

Adrian

--
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - glaub...@debian.org
`. `'   Freie Universitaet Berlin - glaub...@physik.fu-berlin.de
  `-GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913



Bug#891773: Related bug #871229 (but it didn't break my system))

2018-03-01 Thread John Paul Adrian Glaubitz

Adding GRUB upstream.

On 03/01/2018 03:22 PM, Diederik de Haas wrote:

#2  of_path_of_nvme (sys_devname=0x55973f55efd0 "/dev/nvme0n1", devnode=0x55973f55d950 
"/dev/nvme0n", devicenode=0x55973f55df10 "nvme0n", device=)
 at ../../grub-core/osdep/linux/ofpath.c:388


It crashes in of_path_of_nvme() which Eric added in [1]. I need to
find a machine with NVME here so I can debug it myself.

Sending GDB commands over mail will be a bit slow ...

Adrian


[1] 
http://git.savannah.gnu.org/cgit/grub.git/commit/?id=2391d579094cfab65a0fd89a3c617cb3a33fb715


--
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - glaub...@debian.org
`. `'   Freie Universitaet Berlin - glaub...@physik.fu-berlin.de
  `-GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913



Bug#891773: Related bug #871229 (but it didn't break my system))

2018-03-01 Thread Diederik de Haas
On donderdag 1 maart 2018 15:14:40 CET John Paul Adrian Glaubitz wrote:
> >> If you have a .deb package, then yes.
> > 
> > I just uploaded a patched version of grub2 to my Debian webspace [1].
> 
> PS: grub-probe is located in the grub-common package, so it should hopefully
> be enough to just install grub-common_2.02+dfsg1-2+nvme1_amd64.deb.

root@bagend:~/grub# ls -l
total 18504
-rw-r--r-- 1 diederik diederik  537316 mrt  1 15:16 
grub2-common_2.02+dfsg1-2+nvme1_amd64.deb
-rw-r--r-- 1 diederik diederik 1213548 mrt  1 15:16 
grub2-common-dbgsym_2.02+dfsg1-2+nvme1_amd64.deb
-rw-r--r-- 1 diederik diederik 2477180 mrt  1 15:14 
grub-common_2.02+dfsg1-2+nvme1_amd64.deb
-rw-r--r-- 1 diederik diederik 9887324 mrt  1 15:14 
grub-common-dbgsym_2.02+dfsg1-2+nvme1_amd64.deb
-rw-r--r-- 1 diederik diederik  144356 mrt  1 15:14 
grub-pc_2.02+dfsg1-2+nvme1_amd64.deb
-rw-r--r-- 1 diederik diederik  904228 mrt  1 15:15 
grub-pc-bin_2.02+dfsg1-2+nvme1_amd64.deb
-rw-r--r-- 1 diederik diederik  899388 mrt  1 15:15 
grub-pc-bin-dbgsym_2.02+dfsg1-2+nvme1_amd64.deb
-rw-r--r-- 1 diederik diederik 2836688 mrt  1 15:15 
grub-pc-dbg_2.02+dfsg1-2+nvme1_amd64.deb
root@bagend:~/grub# dpkg -i *.deb
(Reading database ... 439154 files and directories currently installed.)
Preparing to unpack grub2-common_2.02+dfsg1-2+nvme1_amd64.deb ...
Unpacking grub2-common (2.02+dfsg1-2+nvme1) over (2.02+dfsg1-2) ...
Preparing to unpack grub2-common-dbgsym_2.02+dfsg1-2+nvme1_amd64.deb ...
Unpacking grub2-common-dbgsym (2.02+dfsg1-2+nvme1) over (2.02+dfsg1-2) ...
Preparing to unpack grub-common_2.02+dfsg1-2+nvme1_amd64.deb ...
Unpacking grub-common (2.02+dfsg1-2+nvme1) over (2.02+dfsg1-2) ...
Preparing to unpack grub-common-dbgsym_2.02+dfsg1-2+nvme1_amd64.deb ...
Unpacking grub-common-dbgsym (2.02+dfsg1-2+nvme1) over (2.02+dfsg1-2) ...
Preparing to unpack grub-pc_2.02+dfsg1-2+nvme1_amd64.deb ...
Unpacking grub-pc (2.02+dfsg1-2+nvme1) over (2.02+dfsg1-2) ...
Preparing to unpack grub-pc-bin_2.02+dfsg1-2+nvme1_amd64.deb ...
Unpacking grub-pc-bin (2.02+dfsg1-2+nvme1) over (2.02+dfsg1-2) ...
Selecting previously unselected package grub-pc-bin-dbgsym.
Preparing to unpack grub-pc-bin-dbgsym_2.02+dfsg1-2+nvme1_amd64.deb ...
Unpacking grub-pc-bin-dbgsym (2.02+dfsg1-2+nvme1) ...
Selecting previously unselected package grub-pc-dbg.
Preparing to unpack grub-pc-dbg_2.02+dfsg1-2+nvme1_amd64.deb ...
Unpacking grub-pc-dbg (2.02+dfsg1-2+nvme1) ...
Setting up grub-common (2.02+dfsg1-2+nvme1) ...
Setting up grub-common-dbgsym (2.02+dfsg1-2+nvme1) ...
Setting up grub-pc-bin (2.02+dfsg1-2+nvme1) ...
Setting up grub-pc-bin-dbgsym (2.02+dfsg1-2+nvme1) ...
Setting up grub-pc-dbg (2.02+dfsg1-2+nvme1) ...
Setting up grub2-common (2.02+dfsg1-2+nvme1) ...
Setting up grub2-common-dbgsym (2.02+dfsg1-2+nvme1) ...
Setting up grub-pc (2.02+dfsg1-2+nvme1) ...
Installing for i386-pc platform.
Installation finished. No error reported.
Generating grub configuration file ...
Segmentation fault (core dumped)
Segmentation fault (core dumped)
Found background image: /usr/share/images/desktop-base/desktop-grub.png
Found linux image: /boot/vmlinuz-4.15.0-1-amd64
Found initrd image: /boot/initrd.img-4.15.0-1-amd64
Segmentation fault (core dumped)
Found linux image: /boot/vmlinuz-4.14.0-3-amd64
Found initrd image: /boot/initrd.img-4.14.0-3-amd64
Found linux image: /boot/vmlinuz-4.13.0-1-amd64
Found initrd image: /boot/initrd.img-4.13.0-1-amd64
Found linux image: /boot/vmlinuz-4.9.0-3-amd64
Found initrd image: /boot/initrd.img-4.9.0-3-amd64
Found Microsoft Windows XP Professional on /dev/sdb2
done
Processing triggers for install-info (6.5.0.dfsg.1-2) ...
Processing triggers for man-db (2.8.2-1) ...
root@bagend:~/grub# sh -x /usr/sbin/grub-mkconfig -o /boot/grub/grub.cfg
+ set -e
+ prefix=/usr
+ exec_prefix=/usr
+ datarootdir=/usr/share
+ prefix=/usr
+ exec_prefix=/usr
+ sbindir=/usr/sbin
+ bindir=/usr/bin
+ sysconfdir=/etc
+ PACKAGE_NAME=GRUB
+ PACKAGE_VERSION=2.02+dfsg1-2+nvme1
+ host_os=linux-gnu
+ datadir=/usr/share
+ [ x = x ]
+ pkgdatadir=/usr/share/grub
+ export pkgdatadir
+ grub_cfg=
+ grub_mkconfig_dir=/etc/grub.d
+ basename /usr/sbin/grub-mkconfig
+ self=grub-mkconfig
+ grub_probe=/usr/sbin/grub-probe
+ grub_file=/usr/bin/grub-file
+ grub_editenv=/usr/bin/grub-editenv
+ grub_script_check=/usr/bin/grub-script-check
+ export TEXTDOMAIN=grub
+ export TEXTDOMAINDIR=/usr/share/locale
+ . /usr/share/grub/grub-mkconfig_lib
+ prefix=/usr
+ exec_prefix=/usr
+ datarootdir=/usr/share
+ datadir=/usr/share
+ bindir=/usr/bin
+ sbindir=/usr/sbin
+ [ x/usr/share/grub = x ]
+ test x/usr/sbin/grub-probe = x
+ test x/usr/bin/grub-file = x
+ test x = x
+ grub_mkrelpath=/usr/bin/grub-mkrelpath
+ which gettext
+ :
+ grub_tab=
+ test 2 -gt 0
+ option=-o
+ shift
+ argument -o /boot/grub/grub.cfg
+ opt=-o
+ shift
+ test 1 -eq 0
+ echo /boot/grub/grub.cfg
+ grub_cfg=/boot/grub/grub.cfg
+ shift
+ test 0 -gt 0
+ fgrep -qs ${GRUB_PREFIX}/video.lst /etc/grub.d/00_header
+ [ x = x ]
+ id -u
+ EUID=0
+ [ 0 != 0 ]
+ 

Bug#891773: Related bug #871229 (but it didn't break my system))

2018-03-01 Thread John Paul Adrian Glaubitz

On 03/01/2018 03:10 PM, John Paul Adrian Glaubitz wrote:

If you have a .deb package, then yes.


I just uploaded a patched version of grub2 to my Debian webspace [1].


PS: grub-probe is located in the grub-common package, so it should hopefully
be enough to just install grub-common_2.02+dfsg1-2+nvme1_amd64.deb.

Adrian

--
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - glaub...@debian.org
`. `'   Freie Universitaet Berlin - glaub...@physik.fu-berlin.de
  `-GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913



Bug#891773: Related bug #871229 (but it didn't break my system))

2018-03-01 Thread John Paul Adrian Glaubitz

On 03/01/2018 03:07 PM, Diederik de Haas wrote:

On donderdag 1 maart 2018 14:25:25 CET John Paul Adrian Glaubitz wrote:

It might be that this patch fixes it [1]. I can build a grub package
with the patch and provide it for testing purpose. Anyone who is
affected by the bug would be willing to test my packages?


If you have a .deb package, then yes.


I just uploaded a patched version of grub2 to my Debian webspace [1].

Adrian


[1] https://people.debian.org/~glaubitz/grub-891773/


--
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - glaub...@debian.org
`. `'   Freie Universitaet Berlin - glaub...@physik.fu-berlin.de
  `-GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913



Bug#891773: Related bug #871229 (but it didn't break my system))

2018-03-01 Thread Diederik de Haas
On donderdag 1 maart 2018 14:25:25 CET John Paul Adrian Glaubitz wrote:
> It might be that this patch fixes it [1]. I can build a grub package
> with the patch and provide it for testing purpose. Anyone who is
> affected by the bug would be willing to test my packages?

If you have a .deb package, then yes.

signature.asc
Description: This is a digitally signed message part.


Bug#891773: Related bug #871229 (but it didn't break my system))

2018-03-01 Thread John Paul Adrian Glaubitz

CC'ing Eric Snowberg who authored the patches.

On 03/01/2018 02:18 PM, Colin Watson wrote:

Thanks for the backtrace; that's very helpful.  This is a regression
introduced by the sparc64 support patches introduced in #854568, and the
latest patch there won't help.  Adrian, could you please look into this
urgently?


Yes.


To all those who have followed up to #871229 about this: it is not
possible for the original report of #871229 to have been due to this
same bug, as I only applied the patch in question in 2.02+dfsg1-2.


Indeed. The bug in #871229 is much older and unrelated to the sparc64
patches.


Please send all followups related to NVME devices to #891773 *only*.
I'm adjusting severities etc. accordingly, as it was never possible to
get accurate information about the original report of #871229 (see
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=871229#25).


It might be that this patch fixes it [1]. I can build a grub package
with the patch and provide it for testing purpose. Anyone who is
affected by the bug would be willing to test my packages?

Adrian


[1] 
http://git.savannah.gnu.org/cgit/grub.git/commit/?id=72b425b640f67ad7e6e0056a7a793bddc9997985


--
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - glaub...@debian.org
`. `'   Freie Universitaet Berlin - glaub...@physik.fu-berlin.de
  `-GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913



Processed: Re: Bug#891773: Related bug #871229 (but it didn't break my system))

2018-03-01 Thread Debian Bug Tracking System
Processing control commands:

> severity 871229 important
Bug #871229 [grub2-common] /usr/sbin/update-grub: running update-grub segment 
faults
Severity set to 'important' from 'critical'
> tag 871229 moreinfo
Bug #871229 [grub2-common] /usr/sbin/update-grub: running update-grub segment 
faults
Added tag(s) moreinfo.
> severity 891773 grave
Bug #891773 [grub-pc] grub-pc: segfault when running 
/etc/kernel/postrm.d/zz-update-grub
Severity set to 'grave' from 'normal'

-- 
871229: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=871229
891773: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=891773
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems



Processed: Re: Bug#891773: Related bug #871229 (but it didn't break my system))

2018-03-01 Thread Debian Bug Tracking System
Processing control commands:

> severity 871229 important
Bug #871229 [grub2-common] /usr/sbin/update-grub: running update-grub segment 
faults
Ignoring request to change severity of Bug 871229 to the same value.
> tag 871229 moreinfo
Bug #871229 [grub2-common] /usr/sbin/update-grub: running update-grub segment 
faults
Ignoring request to alter tags of bug #871229 to the same tags previously set
> severity 891773 grave
Bug #891773 [grub-pc] grub-pc: segfault when running 
/etc/kernel/postrm.d/zz-update-grub
Ignoring request to change severity of Bug 891773 to the same value.

-- 
871229: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=871229
891773: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=891773
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems



Bug#871229: Bug#891773: Related bug #871229 (but it didn't break my system))

2018-03-01 Thread Colin Watson
Control: severity 871229 important
Control: tag 871229 moreinfo
Control: severity 891773 grave

On Thu, Mar 01, 2018 at 12:37:33PM +0100, Diederik de Haas wrote:
> Backtrace:
> 
> # gdb /usr/sbin/grub-probe core
> GNU gdb (Debian 7.12-6+b1) 7.12.0.20161007-git
> Copyright (C) 2016 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".
> Type "show configuration" for configuration details.
> For bug reporting instructions, please see:
> <http://www.gnu.org/software/gdb/bugs/>.
> 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...Reading symbols from 
> /usr/lib/debug/.build-id/7d/39e2c1a4f321d06c55ae5f45dae1fd555cee4f.debug...done.
> done.
> [New LWP 12493]
> [Thread debugging using libthread_db enabled]
> Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
> Core was generated by `/usr/sbin/grub-probe --device /dev/nvme0n1p2 
> --target=hints_string'.
> Program terminated with signal SIGSEGV, Segmentation fault.
> #0  __strcat_ssse3 () at ../sysdeps/x86_64/multiarch/strcat-ssse3.S:41
> 41  ../sysdeps/x86_64/multiarch/strcat-ssse3.S: No such file or directory.
> (gdb) bt
> #0  __strcat_ssse3 () at ../sysdeps/x86_64/multiarch/strcat-ssse3.S:41
> #1  0x555e003b1d38 in strcat (__src=0x7ffc9008a270 "/disk@1", __dest=0x0) 
> at /usr/include/x86_64-linux-gnu/bits/string_fortified.h:128
> #2  of_path_of_nvme (sys_devname=0x555e00fccfd0 "/dev/nvme0n1", 
> devnode=0x555e00fcb950 "/dev/nvme0n", devicenode=0x555e00fcbf10 "nvme0n", 
> device=)
> at ../../grub-core/osdep/linux/ofpath.c:388
> #3  grub_util_devname_to_ofpath (sys_devname=) at 
> ../../grub-core/osdep/linux/ofpath.c:727
> #4  0x555e003b0a89 in probe (path=0x0, device_names=0x555e00fcac50, 
> delim=) at ../../util/grub-probe.c:432
> #5  0x555e003afe76 in main (argc=, argv=) 
> at ../../util/grub-probe.c:861
> 
> It's almost the same as zo...@debian.org reported, but with me ssse3 was used

Thanks for the backtrace; that's very helpful.  This is a regression
introduced by the sparc64 support patches introduced in #854568, and the
latest patch there won't help.  Adrian, could you please look into this
urgently?

To all those who have followed up to #871229 about this: it is not
possible for the original report of #871229 to have been due to this
same bug, as I only applied the patch in question in 2.02+dfsg1-2.
Please send all followups related to NVME devices to #891773 *only*.
I'm adjusting severities etc. accordingly, as it was never possible to
get accurate information about the original report of #871229 (see
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=871229#25).

-- 
Colin Watson   [cjwat...@debian.org]



Bug#871229: Bug#891773: Related bug #871229 (but it didn't break my system))

2018-03-01 Thread Diederik de Haas
Backtrace:

# gdb /usr/sbin/grub-probe core
GNU gdb (Debian 7.12-6+b1) 7.12.0.20161007-git
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
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".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
.
Find the GDB manual and other documentation resources online at:
.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /usr/sbin/grub-probe...Reading symbols from 
/usr/lib/debug/.build-id/7d/39e2c1a4f321d06c55ae5f45dae1fd555cee4f.debug...done.
done.
[New LWP 12493]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `/usr/sbin/grub-probe --device /dev/nvme0n1p2 
--target=hints_string'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  __strcat_ssse3 () at ../sysdeps/x86_64/multiarch/strcat-ssse3.S:41
41  ../sysdeps/x86_64/multiarch/strcat-ssse3.S: No such file or directory.
(gdb) bt
#0  __strcat_ssse3 () at ../sysdeps/x86_64/multiarch/strcat-ssse3.S:41
#1  0x555e003b1d38 in strcat (__src=0x7ffc9008a270 "/disk@1", __dest=0x0) 
at /usr/include/x86_64-linux-gnu/bits/string_fortified.h:128
#2  of_path_of_nvme (sys_devname=0x555e00fccfd0 "/dev/nvme0n1", 
devnode=0x555e00fcb950 "/dev/nvme0n", devicenode=0x555e00fcbf10 "nvme0n", 
device=)
at ../../grub-core/osdep/linux/ofpath.c:388
#3  grub_util_devname_to_ofpath (sys_devname=) at 
../../grub-core/osdep/linux/ofpath.c:727
#4  0x555e003b0a89 in probe (path=0x0, device_names=0x555e00fcac50, 
delim=) at ../../util/grub-probe.c:432
#5  0x555e003afe76 in main (argc=, argv=) at 
../../util/grub-probe.c:861

It's almost the same as zo...@debian.org reported, but with me ssse3 was used

signature.asc
Description: This is a digitally signed message part.


Bug#871229: /usr/sbin/update-grub: running update-grub segment faults

2018-02-28 Thread Sven Hartge
On Wed, 28 Feb 2018 22:37:41 +0100 Martin Zobel-Helas 
wrote:

> I get segfaults when running update-grub on my Lenovo Thinkpad x270
> running Debian unstable from today.

I see the same on my Dell Precision 7520.

> Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
> Core was generated by `/usr/sbin/grub-probe --device /dev/nvme0n1p1 
> --target=hints_string'.
> Program terminated with signal SIGSEGV, Segmentation fault.

Interesting thing is: we both use a NVME-SSD on an AMD64 system.

My other systems, one 32bit-on-AMD64 on normal SATA disks and one pure
AMD64 on normal SATA disks works without segfault, only the NVME one
shows problems.

Grüße,
Sven.





signature.asc
Description: OpenPGP digital signature


Bug#871229:

2018-02-28 Thread Beren Minor
Hello,

I have the same issue, with a NVME drive as well.

It looks like the segmentation fault comes from grub-probe, when
called with --target=hints_string. Attached grub-probe.log is the
output of the command that leads to a segfault.

Trying with gdb doesn't give much more information, the call stack is:

Program received signal SIGSEGV, Segmentation fault.
__strcat_sse2_unaligned () at
../sysdeps/x86_64/multiarch/strcat-sse2-unaligned.S:46
46../sysdeps/x86_64/multiarch/strcat-sse2-unaligned.S: No such
file or directory.
(gdb) bt
#0  __strcat_sse2_unaligned () at
../sysdeps/x86_64/multiarch/strcat-sse2-unaligned.S:46
#1  0xdd38 in ?? ()
#2  0xca89 in ?? ()
#3  0xbe76 in ?? ()
#4  0x777d7f2a in __libc_start_main (main=0xbd10,
argc=5, argv=0x7fffdf88, init=, fini=, rtld_fini=, stack_end=0x7fffdf78) at
../csu/libc-start.c:310
#5  0xbfea in ?? ()

I'm not sure how critical it is either but as a workaround, it's
possible to roll back to testing versions of the grub-efi-amd64-bin,
grub-efi-amd64, grub2-common packages.

Cheers,
--
Beren Minor
$ sudo /usr/sbin/grub-probe --device /dev/nvme0n1p2 --target=hints_string --verbose
/usr/sbin/grub-probe: info: cannot open `/boot/grub/device.map': No such file or directory.
/usr/sbin/grub-probe: info: /dev/nvme0n1p2 is not present.
/usr/sbin/grub-probe: info: Looking for /dev/nvme0n1p2.
/usr/sbin/grub-probe: info: /dev/nvme0n1 is a parent of /dev/nvme0n1p2.
/usr/sbin/grub-probe: info: /dev/nvme0n1p2 starts from 1050624.
/usr/sbin/grub-probe: info: opening the device hostdisk//dev/nvme0n1.
/usr/sbin/grub-probe: info: drive = 0.
/usr/sbin/grub-probe: info: the size of hostdisk//dev/nvme0n1 is 2000409264.
/usr/sbin/grub-probe: info: drive = 0.
/usr/sbin/grub-probe: info: the size of hostdisk//dev/nvme0n1 is 2000409264.
/usr/sbin/grub-probe: info: Scanning for DISKFILTER devices on disk hostdisk//dev/nvme0n1.
/usr/sbin/grub-probe: info: Scanning for mdraid1x devices on disk hostdisk//dev/nvme0n1.
/usr/sbin/grub-probe: info: Scanning for mdraid09 devices on disk hostdisk//dev/nvme0n1.
/usr/sbin/grub-probe: info: Scanning for mdraid09_be devices on disk hostdisk//dev/nvme0n1.
/usr/sbin/grub-probe: info: Scanning for dmraid_nv devices on disk hostdisk//dev/nvme0n1.
/usr/sbin/grub-probe: info: Scanning for ldm devices on disk hostdisk//dev/nvme0n1.
/usr/sbin/grub-probe: info: scanning hostdisk//dev/nvme0n1 for LDM.
/usr/sbin/grub-probe: info: no LDM signature found.
/usr/sbin/grub-probe: info: Scanning for lvm devices on disk hostdisk//dev/nvme0n1.
/usr/sbin/grub-probe: info: no LVM signature found.
/usr/sbin/grub-probe: info: Scanning for DISKFILTER devices on disk hostdisk//dev/nvme0n1.
/usr/sbin/grub-probe: info: Scanning for mdraid1x devices on disk hostdisk//dev/nvme0n1.
/usr/sbin/grub-probe: info: Scanning for mdraid09 devices on disk hostdisk//dev/nvme0n1.
/usr/sbin/grub-probe: info: Scanning for mdraid09_be devices on disk hostdisk//dev/nvme0n1.
/usr/sbin/grub-probe: info: Scanning for dmraid_nv devices on disk hostdisk//dev/nvme0n1.
/usr/sbin/grub-probe: info: Scanning for ldm devices on disk hostdisk//dev/nvme0n1.
/usr/sbin/grub-probe: info: scanning hostdisk//dev/nvme0n1 for LDM.
/usr/sbin/grub-probe: info: no LDM signature found.
/usr/sbin/grub-probe: info: Scanning for lvm devices on disk hostdisk//dev/nvme0n1.
/usr/sbin/grub-probe: info: no LVM signature found.
/usr/sbin/grub-probe: info: Scanning for DISKFILTER devices on disk hostdisk//dev/nvme0n1.
/usr/sbin/grub-probe: info: Scanning for mdraid1x devices on disk hostdisk//dev/nvme0n1.
/usr/sbin/grub-probe: info: Scanning for mdraid09 devices on disk hostdisk//dev/nvme0n1.
/usr/sbin/grub-probe: info: Scanning for mdraid09_be devices on disk hostdisk//dev/nvme0n1.
/usr/sbin/grub-probe: info: Scanning for dmraid_nv devices on disk hostdisk//dev/nvme0n1.
/usr/sbin/grub-probe: info: Scanning for ldm devices on disk hostdisk//dev/nvme0n1.
/usr/sbin/grub-probe: info: scanning hostdisk//dev/nvme0n1 for LDM.
/usr/sbin/grub-probe: info: no LDM signature found.
/usr/sbin/grub-probe: info: Scanning for lvm devices on disk hostdisk//dev/nvme0n1.
/usr/sbin/grub-probe: info: no LVM signature found.
/usr/sbin/grub-probe: info: Scanning for DISKFILTER devices on disk hostdisk//dev/nvme0n1.
/usr/sbin/grub-probe: info: Scanning for mdraid1x devices on disk hostdisk//dev/nvme0n1.
/usr/sbin/grub-probe: info: Scanning for mdraid09 devices on disk hostdisk//dev/nvme0n1.
/usr/sbin/grub-probe: info: Scanning for mdraid09_be devices on disk hostdisk//dev/nvme0n1.
/usr/sbin/grub-probe: info: Scanning for dmraid_nv devices on disk hostdisk//dev/nvme0n1.
/usr/sbin/grub-probe: info: Scanning for ldm devices on disk hostdisk//dev/nvme0n1.
/usr/sbin/grub-probe: info: scanning hostdisk//dev/nvme0n1 for LDM.
/usr/sbin/grub-probe: info: no LDM signature found.
/usr/sbin/grub-probe: info: Scanning for lvm devices on disk hostdisk//dev/nvme0n1.
/usr/sbin/grub-probe: 

Bug#871229: /usr/sbin/update-grub: running update-grub segment faults

2018-02-28 Thread IOhannes m zmoelnig
Package: grub-common
Version: 2.02+dfsg1-2
Followup-For: Bug #871229

Dear Maintainer,

today, when running a regular unstable->unstable upgrade i also experienced a
segmentation fault.
i do these updates regularly, e.g. the last update of grub-common (2.02-2 ->
2.02+dfsg1-1) happened on "Sun, Feb 18 2018 22:55:00 +0100".
The last update related to the boot manager would be linux-image-amd64 (4.14+89
-> 4.15+90) on "Mon, Feb 26 2018 14:24:15 +0100".

I didn't notice any problems with prior upgrades.
Note that I haven't rebooted my machine after the linux-image upgrade 3 days
ago.

I'll attach the output of
   # sh -x /usr/sbin/grub-mkconfig -o /boot/grub/grub.cfg 2>&1 | tee 
/tmp/update-grub.log

i'm slightly afraid of having bricked my machine on the next reboot and would be
grateful if you could fix the problem asap.


-- Package-specific info:

*** BEGIN /proc/mounts
/dev/nvme0n1p2 / ext4 rw,relatime,errors=remount-ro,data=ordered 0 0
/dev/nvme0n1p1 /boot/efi vfat 
rw,relatime,fmask=0077,dmask=0077,codepage=437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro
 0 0
*** END /proc/mounts

*** BEGIN /boot/grub/grub.cfg
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
  set have_grubenv=true
  load_env
fi
if [ "${next_entry}" ] ; then
   set default="${next_entry}"
   set next_entry=
   save_env next_entry
   set boot_once=true
else
   set default="0"
fi

if [ x"${feature_menuentry_id}" = xy ]; then
  menuentry_id_option="--id"
else
  menuentry_id_option=""
fi

export menuentry_id_option

if [ "${prev_saved_entry}" ]; then
  set saved_entry="${prev_saved_entry}"
  save_env saved_entry
  set prev_saved_entry=
  save_env prev_saved_entry
  set boot_once=true
fi

function savedefault {
  if [ -z "${boot_once}" ]; then
saved_entry="${chosen}"
save_env saved_entry
  fi
}
function load_video {
  if [ x$feature_all_video_module = xy ]; then
insmod all_video
  else
insmod efi_gop
insmod efi_uga
insmod ieee1275_fb
insmod vbe
insmod vga
insmod video_bochs
insmod video_cirrus
  fi
}

if [ x$feature_default_font_path = xy ] ; then
   font=unicode
else
insmod part_gpt
insmod ext2
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root  6bb42702-8f67-4600-806e-69c9309532af
else
  search --no-floppy --fs-uuid --set=root 6bb42702-8f67-4600-806e-69c9309532af
fi
font="/usr/share/grub/unicode.pf2"
fi

if loadfont $font ; then
  set gfxmode=auto
  load_video
  insmod gfxterm
  set locale_dir=$prefix/locale
  set lang=C
  insmod gettext
fi
terminal_output gfxterm
if [ "${recordfail}" = 1 ] ; then
  set timeout=30
else
  if [ x$feature_timeout_style = xy ] ; then
set timeout_style=menu
set timeout=5
  # Fallback normal timeout code in case the timeout_style feature is
  # unavailable.
  else
set timeout=5
  fi
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/05_debian_theme ###
insmod part_gpt
insmod ext2
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root  6bb42702-8f67-4600-806e-69c9309532af
else
  search --no-floppy --fs-uuid --set=root 6bb42702-8f67-4600-806e-69c9309532af
fi
insmod png
if background_image /usr/share/desktop-base/softwaves-theme/grub/grub-16x9.png; 
then
  set color_normal=white/black
  set color_highlight=black/white
else
  set menu_color_normal=cyan/blue
  set menu_color_highlight=white/blue
fi
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux ###
function gfxmode {
set gfxpayload="${1}"
}
set linux_gfx_mode=
export linux_gfx_mode
menuentry 'Debian GNU/Linux' --class debian --class gnu-linux --class gnu 
--class os $menuentry_id_option 
'gnulinux-simple-6bb42702-8f67-4600-806e-69c9309532af' {
load_video
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_gpt
insmod ext2
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root  
6bb42702-8f67-4600-806e-69c9309532af
else
  search --no-floppy --fs-uuid --set=root 
6bb42702-8f67-4600-806e-69c9309532af
fi
echo'Loading Linux 4.15.0-1-amd64 ...'
linux   /boot/vmlinuz-4.15.0-1-amd64 
root=UUID=6bb42702-8f67-4600-806e-69c9309532af ro  quiet
echo'Loading initial ramdisk ...'
initrd  /boot/initrd.img-4.15.0-1-amd64
}
submenu 'Advanced options for Debian GNU/Linux' $menuentry_id_option 
'gnulinux-advanced-6bb42702-8f67-4600-806e-69c9309532af' {
menuentry 'Debian GNU/Linux, with Linux

Bug#871229: /usr/sbin/update-grub: running update-grub segment faults

2017-08-09 Thread Steven Jones
Sorry unable to capture an output


I have tried to use pastebin but the case isnt being updated with the links.


regards

Steven



From: Colin Watson <cjwat...@debian.org>
Sent: Monday, 7 August 2017 8:28 p.m.
To: steven.jo...@vuw.ac.nz; 871...@bugs.debian.org
Subject: Re: Bug#871229: /usr/sbin/update-grub: running update-grub segment 
faults

On Mon, Aug 07, 2017 at 02:15:46PM +1200, steven.jo...@vuw.ac.nz wrote:
> *** Reporter, please consider answering these questions, where appropriate ***
>
>* What led up to the situation?
>* What exactly did you do (or not do) that was effective (or
>  ineffective)?
>* What was the outcome of this action?
>* What outcome did you expect instead?
>
> *** End of the template - remove these template lines ***

Neither your bug report nor any of your follow-ups includes the actual
output from update-grub.  Please run the following as root and post the
*exact* output (there will be quite a lot of it):

  sh -x /usr/sbin/grub-mkconfig -o /boot/grub/grub.cfg

--
Colin Watson   [cjwat...@debian.org]


Bug#871229: /usr/sbin/update-grub: running update-grub segment faults

2017-08-07 Thread Colin Watson
On Mon, Aug 07, 2017 at 02:15:46PM +1200, steven.jo...@vuw.ac.nz wrote:
> *** Reporter, please consider answering these questions, where appropriate ***
> 
>* What led up to the situation?
>* What exactly did you do (or not do) that was effective (or
>  ineffective)?
>* What was the outcome of this action?
>* What outcome did you expect instead?
> 
> *** End of the template - remove these template lines ***

Neither your bug report nor any of your follow-ups includes the actual
output from update-grub.  Please run the following as root and post the
*exact* output (there will be quite a lot of it):

  sh -x /usr/sbin/grub-mkconfig -o /boot/grub/grub.cfg

-- 
Colin Watson   [cjwat...@debian.org]



Bug#871229: Acknowledgement (/usr/sbin/update-grub: running update-grub segment faults)

2017-08-06 Thread Thing
Same thing happens while attempting to upgarde to debian9

On 7 August 2017 at 14:54, Thing <thing.th...@gmail.com> wrote:

> What led up to the situation?
>
> Attempting to convert machine from 32bit to 64bit 
> (https://wiki.debian.org/CrossGrading).
> I found that attempting to make the amd64 kernel the default boot kernel 
> failed.
>
>
>  * What exactly did you do (or not do) that was effective (or
>  ineffective)?
>
> Goolged the segfault message, no joy.
>
>  * What was the outcome of this action?
>
> The boot order in grub does not get updated.
>
>  * What outcome did you expect instead?
>
> That the boot order gets updated.
>
>
> On 7 August 2017 at 14:30, Debian Bug Tracking System <
> ow...@bugs.debian.org> wrote:
>
>> Thank you for filing a new Bug report with Debian.
>>
>> You can follow progress on this Bug here: 871229:
>> https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=871229.
>>
>> This is an automatically generated reply to let you know your message
>> has been received.
>>
>> Your message is being forwarded to the package maintainers and other
>> interested parties for their attention; they will reply in due course.
>>
>> Your message has been sent to the package maintainer(s):
>>  GRUB Maintainers <pkg-grub-de...@lists.alioth.debian.org>
>>
>> If you wish to submit further information on this problem, please
>> send it to 871...@bugs.debian.org.
>>
>> Please do not send mail to ow...@bugs.debian.org unless you wish
>> to report a problem with the Bug-tracking system.
>>
>> --
>> 871229: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=871229
>> Debian Bug Tracking System
>> Contact ow...@bugs.debian.org with problems
>>
>
>


Bug#871229: Acknowledgement (/usr/sbin/update-grub: running update-grub segment faults)

2017-08-06 Thread Thing
What led up to the situation?

Attempting to convert machine from 32bit to 64bit
(https://wiki.debian.org/CrossGrading).
I found that attempting to make the amd64 kernel the default boot
kernel failed.


 * What exactly did you do (or not do) that was effective (or
 ineffective)?

Goolged the segfault message, no joy.

 * What was the outcome of this action?

The boot order in grub does not get updated.

 * What outcome did you expect instead?

That the boot order gets updated.


On 7 August 2017 at 14:30, Debian Bug Tracking System <ow...@bugs.debian.org
> wrote:

> Thank you for filing a new Bug report with Debian.
>
> You can follow progress on this Bug here: 871229:
> https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=871229.
>
> This is an automatically generated reply to let you know your message
> has been received.
>
> Your message is being forwarded to the package maintainers and other
> interested parties for their attention; they will reply in due course.
>
> Your message has been sent to the package maintainer(s):
>  GRUB Maintainers <pkg-grub-de...@lists.alioth.debian.org>
>
> If you wish to submit further information on this problem, please
> send it to 871...@bugs.debian.org.
>
> Please do not send mail to ow...@bugs.debian.org unless you wish
> to report a problem with the Bug-tracking system.
>
> --
> 871229: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=871229
> Debian Bug Tracking System
> Contact ow...@bugs.debian.org with problems
>


Bug#871229: /usr/sbin/update-grub: running update-grub segment faults

2017-08-06 Thread steven.jo...@vuw.ac.nz
Package: grub2-common
Version: 2.02~beta2-22+deb8u1
Severity: critical
File: /usr/sbin/update-grub
Justification: breaks the whole system

Dear Maintainer,

*** Reporter, please consider answering these questions, where appropriate ***

   * What led up to the situation?
   * What exactly did you do (or not do) that was effective (or
 ineffective)?
   * What was the outcome of this action?
   * What outcome did you expect instead?

*** End of the template - remove these template lines ***


-- Package-specific info:

*** BEGIN /proc/mounts
/dev/sda5 / ext3 rw,relatime,errors=remount-ro,data=ordered 0 0
/dev/sda8 /usr ext3 rw,relatime,data=ordered 0 0
/dev/sda7 /var ext3 rw,relatime,data=ordered 0 0
/dev/sda10 /home ext3 rw,relatime,data=ordered 0 0
/dev/sda1 /boot ext3 rw,relatime,data=ordered 0 0
/dev/sda6 /tmp ext3 rw,relatime,data=ordered 0 0
/dev/sdb1 /var/www ext3 rw,relatime,data=ordered 0 0
*** END /proc/mounts

*** BEGIN /boot/grub/device.map
(hd0)   /dev/sda
(hd1)   /dev/sdb
*** END /boot/grub/device.map

*** BEGIN /boot/grub/grub.cfg
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
  set have_grubenv=true
  load_env
fi
if [ "${next_entry}" ] ; then
   set default="${next_entry}"
   set next_entry=
   save_env next_entry
   set boot_once=true
else
   set default="gnulinux-simple-f8ac0ddf-4a8d-41d1-b4b8-19825679b1e6"
fi

if [ x"${feature_menuentry_id}" = xy ]; then
  menuentry_id_option="--id"
else
  menuentry_id_option=""
fi

export menuentry_id_option

if [ "${prev_saved_entry}" ]; then
  set saved_entry="${prev_saved_entry}"
  save_env saved_entry
  set prev_saved_entry=
  save_env prev_saved_entry
  set boot_once=true
fi

function savedefault {
  if [ -z "${boot_once}" ]; then
saved_entry="${chosen}"
save_env saved_entry
  fi
}
function load_video {
  if [ x$feature_all_video_module = xy ]; then
insmod all_video
  else
insmod efi_gop
insmod efi_uga
insmod ieee1275_fb
insmod vbe
insmod vga
insmod video_bochs
insmod video_cirrus
  fi
}

terminal_input console
terminal_output console
if [ "${recordfail}" = 1 ] ; then
  set timeout=-1
else
  if [ x$feature_timeout_style = xy ] ; then
set timeout_style=menu
set timeout=5
  # Fallback normal timeout code in case the timeout_style feature is
  # unavailable.
  else
set timeout=5
  fi
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=cyan/blue
set menu_color_highlight=white/blue
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux ###
function gfxmode {
set gfxpayload="${1}"
}
set linux_gfx_mode=
export linux_gfx_mode
menuentry 'Debian GNU/Linux' --class debian --class gnu-linux --class gnu 
--class os $menuentry_id_option 
'gnulinux-simple-f8ac0ddf-4a8d-41d1-b4b8-19825679b1e6' {
load_video
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_msdos
insmod ext2
set root='hd0,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 
--hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 --hint='hd0,msdos1'  
d30aa8d1-b00a-41cf-b98f-b4ebc881da28
else
  search --no-floppy --fs-uuid --set=root 
d30aa8d1-b00a-41cf-b98f-b4ebc881da28
fi
echo'Loading Linux 3.16.0-4-686-pae ...'
linux   /vmlinuz-3.16.0-4-686-pae 
root=UUID=f8ac0ddf-4a8d-41d1-b4b8-19825679b1e6 ro text quiet
echo'Loading initial ramdisk ...'
initrd  /initrd.img-3.16.0-4-686-pae
}
submenu 'Advanced options for Debian GNU/Linux' $menuentry_id_option 
'gnulinux-advanced-f8ac0ddf-4a8d-41d1-b4b8-19825679b1e6' {
menuentry 'Debian GNU/Linux, with Linux 3.16.0-4-686-pae' --class 
debian --class gnu-linux --class gnu --class os $menuentry_id_option 
'gnulinux-3.16.0-4-686-pae-advanced-f8ac0ddf-4a8d-41d1-b4b8-19825679b1e6' {
load_video
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; 
fi
insmod part_msdos
insmod ext2
set root='hd0,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root 
--hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 
--hint='hd0,msdos1'  d30aa8d1-b00a-41cf-b98f-b4ebc881da28
else
  search --no-floppy --fs-uuid --set=root 
d30aa8d1-b00a-41cf-b98f-b4ebc881da28
fi
echo'Loading Linux 3.16.0-4-686-pae ...'
linux   /vmlinuz-3.16.0-4-686-pae