discuss-gnustep
[Top][All Lists]
Advanced

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

Trampoline jumping problems


From: Mathias Bauer
Subject: Trampoline jumping problems
Date: Mon, 10 Mar 2014 11:10:23 +0100
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.3.0

Hi dear list,

the code in libobjc2 that implements imp_ImplementationWithBlock does not work on at least some ARM platforms.

At least on boards using an Exynos CPU I see random crashes when using imp_ImplementationWithBlock for dynamically provided implementations for property getters and setters.

The crash always happens at an address that is a page boundary - it's the boundary of the current page for trampolines. So it seems that at the memory of the IMP there is no trampoline code, instead of that this memory area behaves like a playgound slide that finally lets the IP move to the page boundary.

The trampoline and its two addresses are written to this memory through a pointer memory-mapped to a file handle with PROT_WRITE, while another pointer memory-mapped to the same file handle with PROT_READ|PROT_EXEC is used to read and execute the data later.

It seems that on the architecture that experiences the crashes there is a time lag between writing the data and the availability of the bytes as executable code, because the crash goes away if I add some delay after writing the data.

It seems that we somehow need to make sure that what was written can be executed immediately after that.

Regards,
Mathias



reply via email to

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