code review for attach on demand (AOD) fix for Windows (7028668)
Kelly O'Hair
kelly.ohair at oracle.com
Thu Mar 17 17:38:36 PDT 2011
On Mar 17, 2011, at 1:34 PM, Daniel D. Daugherty wrote:
> On 3/17/2011 2:29 PM, Kelly O'Hair wrote:
>>
>> Dan,
>>
>> It looks ok, but you are using sprintf, and it really should be snprintf.
>> On Windows you may need to:
>> #define snprintf _snprintf
>>
>
> Yup. I know we have to do that someday soon...
>
>
>> ---
>> We (myself included) all need to start being more careful about use of strcpy, strcat, sprintf, etc.
>> The static analysis tools are all starting to just flag the use of them as an error, so we need to start
>> getting rid of these calls from all our code eventually. Which may take some major time. :^(
>>
>
> I copied the code from elsewhere in src/windows/native/...
> just so I could do it like "everyone else"...
>
>
>> Don't shoot the messenger. :^(
>>
>
> No plans to shoot you. Would it be OK if I pushed this fix as is?
> When I continue with 7020052 (the related bug), I'll come back to
> this file and switch to snprintf()... along with the rest of the
> fix...
>
Ok.
-kto
> Dan
>
>
>> -kto
>>
>> On Mar 17, 2011, at 11:42 AM, Daniel D. Daugherty wrote:
>>
>>
>>> Greetings,
>>>
>>> I have minor fixes to the Attach On Demand (AOD) Windows
>>> specific code that I'd like to get into T&L snapshot for
>>> OpenJDK7-B136 (next week):
>>>
>>> http://cr.openjdk.java.net/~dcubed/7028668-webrev/0/
>>>
>>> I'm adding more info to the default detail message for an
>>> OpenProcess() failure. I'm also getting a process handle
>>> in a different way when a Java process tries to attach to
>>> itself. If the new technique fails, then we fall back to
>>> the original OpenProcess() code.
>>>
>>> Thanks, in advance, for any comments.
>>>
>>> Dan
>>>
>>>
>>>
>>>
>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/serviceability-dev/attachments/20110317/0ada3723/attachment.html
More information about the serviceability-dev
mailing list