grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Non-static variables and nested function pointers [bug #28392]


From: Seth Goldberg
Subject: Re: Non-static variables and nested function pointers [bug #28392]
Date: Wed, 23 Dec 2009 14:17:06 -0800 (PST)
User-agent: Alpine 2.00 (GSO 1167 2008-08-23)

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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]