RFR(S): 8022071 Some vm/jvmti tests fail because cannot attach to the Java virtual machine

Staffan Larsen staffan.larsen at oracle.com
Mon Aug 19 01:16:02 PDT 2013


On 19 aug 2013, at 06:12, David Holmes <David.Holmes at oracle.com> wrote:

> On 17/08/2013 2:51 AM, Staffan Larsen wrote:
>> This failure happens when compiling with the VS 2012 compiler. The attach code relies on the order of two methods in the compiled binary and VS 2012 changed that order. The solution used is the linker flag /ORDER [1] which allows us to specify the order in which methods are laid out in the binary image. Since the flag only operates on non-static methods, the methods have been made non-static and also changed name so that they will not clash with other methods.
>> 
>> webrev: http://cr.openjdk.java.net/~sla/8022071/webrev.01/
>> 
>> The change has been tested with both VS 2010 and VS 2012.
> 
> I wonder if simply changing from static to non-static would have been sufficient? Of course still no guarantee that future versions of the compiler would preserve the same order in that case; but then what guarantees do we have that the weird @4 name mangling will remain the same?

The name decoration used by the windows compiler is stable and well-defined [1] [2] . I'm not sure it is official, but enough tools depend on it that it will not be changed. In short the number after the @ sign is the number of bytes passed on the stack for the calling convention of the specific platform. 

/Staffan

[1] http://en.wikipedia.org/wiki/Name_mangling#C_name_decoration_in_Microsoft_Windows
[2] http://en.wikibooks.org/wiki/X86_Disassembly/Calling_Conventions#STDCALL


> 
> Thanks,
> David
> 
>> Thanks,
>> /Staffan
>> 
>> 
>> [1] http://msdn.microsoft.com/en-us/library/vstudio/00kh39zz.aspx
>> 



More information about the serviceability-dev mailing list