RFR(M): 8183227: read/write APIs in class os shall return ssize_t

Langer, Christoph christoph.langer at sap.com
Thu Jun 29 12:30:12 UTC 2017


I updated the webrev in place - Matthias Baesken pointed out 2 further spots where the return code of pread() is not checked in ps_core.c of jdk.hotspot.agent.

From: Langer, Christoph
Sent: Donnerstag, 29. Juni 2017 12:50
To: hotspot-runtime-dev at openjdk.java.net
Subject: RFR(M): 8183227: read/write APIs in class os shall return ssize_t

Hi folks,

please review the following change:

Bug: https://bugs.openjdk.java.net/browse/JDK-8183227
Webrev: http://cr.openjdk.java.net/~clanger/webrevs/8183227.0/

When looking at the read() and write() APIs and its siblings on the platforms, you find the return value mostly being of signed type ssize_t vs. the current unsigned return type size_t of the methods in class os. With my proposed patch I try to address that and change the signatures of these methods to ssize_t.

At the places where the methods were called so far, I could find 2 places where usage of the wrong type could be critical:
src/share/vm/compiler/compileLog.cpp (where actually ::read is used) and
src/share/vm/compiler/directivesParser.cpp where a wrong array access could happen

As for the class os, I'm wondering if the methods "read_at" and "restartable_read" are still required? My source code scan tells me that there are no users of them. Shall I maybe remove them completely from the code?

Thanks & Best regards
Christoph




More information about the hotspot-runtime-dev mailing list