Hi,

Your problem is probably lack of executable stack support, or at least you haven't linked your application with a linker mapfile that specifies an executable stack -- the callbacks require the use of trampolines to access local variables, which require an executable stack.

 --S

Quoting Grégoire Sutre, who wrote the following on Wed, 23 Dec 2009:

Hi,

I am trying to add NetBSD specific code to util/hostdisk.c in order to make grub-probe work. This part is almost finished. However, I had a hard time dealing with segfaults in callbacks (hook function pointers) in a number of places of the vanilla code. Actually, I get segfaults in grub-probe with the vanilla trunk code (see bug report #28392). This is on NetBSD 5.0 i386.

In the end, these segfaults were fixed by making sure that all variables accessed by pointers to nested functions are declared static. I attach a patch that fixes these segfaults on my NetBSD box (this patch is also included in the bug report).

However, I am not a C expert, and I must be missing something as the code (obviously) works well on other systems.

Thanks for your help,

Grégoire

_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to