Skip to contentSkip to conversation

Faulty grub-mkdevicemap file

DISCUSSION BandiPat 3 participants 5 messages Apr 25, 2009 – Apr 26, 2009

lore
Share & tools
lore

BandiPat

author
#0 lore raw
Quoted 1 line · BandiPat

Oh, has anyone experienced any problems with grub-mkdevicemap when installing Grub2 or updating? I had one user complain about it segfaulting on his machine, but I've not seen any problems. This is with svn2137.

---------------
Andreas wrote:
I'm experiencing also problems using it, but it's not segfaulting. Using a svn2130 build grub-mkdevicemap --no-floppy create a device.map with proper content like this:
(hd0) /dev/sda
But a svn2137 build (exactly the same BandiPat uses) creates this content, which might not be wrong, but at least the most important part my HDD is missing:
(fd0) (null)

Probably this problem was introduced by revision 2133 and obviously wasn't fixed in rev 2134 - 2137 and in 2138 - 2140 I can see nothing which might fix this.

It would be great if somebody could have a look what could cause this problem. Maybe davem as the author of that revision. If you need any additional information give me a yell and I'll try my best to provide it.
==============

Decided to start a new topic more fitting to this problem. Sorry for what looks like a double posting.

I just tested on one machine, running grub-mkdevicemap -v from the shell, which resulted in a segfault and blank device.map file in /boot/grub!

Looks like some bug was introduced after svn2130 in the file.

Thanks devs for your attention to this one.

Pat

author
#1 lore raw
Quoted 6 lines · BandiPat

Probably this problem was introduced by revision 2133 and obviously wasn't fixed in rev 2134 - 2137 and in 2138 - 2140 I can see nothing which might fix this.

It would be great if somebody could have a look what could cause this problem. Maybe davem as the author of that revision. If you need any additional information give me a yell and I'll try my best to provide it.
==============

Quoted 7 lines

Decided to start a new topic more fitting to this problem. Sorry for what looks like a double posting.

I just tested on one machine, running grub-mkdevicemap -v from the shell, which resulted in a segfault and blank device.map file in /boot/grub!

Looks like some bug was introduced after svn2130 in the file.

Thanks devs for your attention to this one.

______________________________________________

Here is the error when running grub-install:

grub-install /dev/sda
/usr/sbin/grub-install: line 203: 1362 Segmentation fault $grub_mkdevicemap --device-map=$device_map $no_floppy

This is using svn2140 release.

#2 lore raw

From: BandiPat <[email protected]>
Date: Sat, 25 Apr 2009 15:29:11 -0400

Quoted 7 lines

Here is the error when running grub-install:

grub-install /dev/sda
/usr/sbin/grub-install: line 203: 1362 Segmentation fault $grub_mkdevicemap --device-map=$device_map $no_floppy

This is using svn2140 release.

Can you please run grub-mkdevicemap with the proper arguments under gdb and get a backtrace?

With that, I can fix this bug.

Thanks!

#3 lore raw
In reply to BandiPat

From: BandiPat <[email protected]>
Date: Sat, 25 Apr 2009 15:29:11 -0400

Quoted 1 line

Here is the error when running grub-install:

I just checked in the following patch which will fix this bug.

2009-04-26 David S. Miller <[email protected]>

* util/grub-mkdevicemap.c (make_device_map): Add missing NESTED_FUNC_ATTR to process_device().

util/grub-mkdevicemap.c +2 -2
index 4f544f8..ac8a390 100644
@@ -42,9 +42,9 @@ make_device_map (const char *device_map, int floppy_disks)
   int num_fd = 0;
   FILE *fp;
 
-  auto int process_device (const char *name, int is_floppy);
+  auto int NESTED_FUNC_ATTR process_device (const char *name, int is_floppy);
 
-  int process_device (const char *name, int is_floppy)
+  int NESTED_FUNC_ATTR process_device (const char *name, int is_floppy)
   {
     grub_util_emit_devicemap_entry (fp, (char *) name,
 				    is_floppy, &num_fd, &num_hd);
#4 lore raw

Thanks a lot, this fixed it.

Quoted 38 lines · David Miller

From: BandiPat <[email protected]>
Date: Sat, 25 Apr 2009 15:29:11 -0400

Quoted 2 lines

Here is the error when running grub-install:

I just checked in the following patch which will fix this bug.

2009-04-26 David S. Miller <[email protected]>

* util/grub-mkdevicemap.c (make_device_map): Add missing NESTED_FUNC_ATTR to process_device().

util/grub-mkdevicemap.c +2 -2
index 4f544f8..ac8a390 100644
@@ -42,9 +42,9 @@ make_device_map (const char *device_map, int floppy_disks)
   int num_fd = 0;
   FILE *fp;
 
-  auto int process_device (const char *name, int is_floppy);
+  auto int NESTED_FUNC_ATTR process_device (const char *name, int is_floppy);
 
-  int process_device (const char *name, int is_floppy)
+  int NESTED_FUNC_ATTR process_device (const char *name, int is_floppy)
   {
     grub_util_emit_devicemap_entry (fp, (char *) name,
 				    is_floppy, &num_fd, &num_hd);

_______________________________________________
Grub-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/grub-devel