Performance optimization in av::fixup - use buffered IO, not mapped file

Daniel Colascione dancol@dancol.org
Tue Dec 11 16:45:00 GMT 2012


>> The key to generating a binary that repros the problem is to unexec
>> emacs, then
>> try to repro with that generated binary, not a copy of it. Maybe the
>> process of
>> modifying the binary during unexec borks the system's ASLR cache; I
>> can't
>> reproduce the problem with a simple testcase that copies and
>> modifies the
>> binary, but my test doesn't actually change the binary --- it just
>> writes back
>> to the destination binary exactly what we read from it.
> That doesn't explain why gcc stage1/2 compilers (in ./xgcc) would have
> the problem. At least, I don't think gcc self-modifies when invoked
> from ./configure...
> 
> But you're right. Once the compiler has been officially installed
> somewhere (not necessarily /usr/bin) it runs normally. Very weird.

I don't have an explanation, but one workaround would be to patch the
gcc and Emacs configuration scripts to copy their bootstrap binaries
before using them. (I'd rather just have av::fixup use buffered IO,
though, since that workaround would apply generally.)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 235 bytes
Desc: OpenPGP digital signature
URL: <http://cygwin.com/pipermail/cygwin-developers/attachments/20121211/79326ba0/attachment.sig>


More information about the Cygwin-developers mailing list