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 
> 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

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.