RFR: 8268361: Fix the infinite loop in next_line [v4]
UncleNine
github.com+1964054+unclenine at openjdk.java.net
Wed Jun 9 14:45:36 UTC 2021
On Wed, 9 Jun 2021 07:29:11 GMT, Severin Gehwolf <sgehwolf at openjdk.org> wrote:
>> I use top -Hp $PID command and the thread show 100% cpu usage
>> 
>> 
>
> @UncleNine We should handle the case in the `get_totalticks()` function - which seems to be the only user of `next_line()` - when `next_line()` returns EOF as David said. One way would be to return the 'c' character read in `next_line` and if it's EOF, return -2 in `get_totalticks()`.
all right, i have updated the code
-------------
PR: https://git.openjdk.java.net/jdk/pull/4378
More information about the serviceability-dev
mailing list