This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: obvious race condition in darwin/netbsd __enable_execute_stack due to caching pagesize/mask


Andrew Thomas Pinski wrote:
On Aug 27, 2008, at 0:27, Jay <jay.krell@cornell.edu> wrote:

        size = getpagesize();                          \
        mask = ~((long) size - 1);

Or even better store size after the store to mask. That is: int tmp = getpagesize(); *(volatile*)&mask = ~((long)tmp - 1); *(volatile*)&size = tmp;

Does this work on machines that support out-of-order execution? For example, shouldn't there be the equivalent of a powerpc eieio to ensure that the stores *happen* in order?

I'm assuming, of course, that Darwin runs on different
processor architectures.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]