On Wed, 21 Oct 2026 04:14:19 GMT, Dingli Zhang <[email protected]> wrote:

>> Yasumasa Suenaga has updated the pull request incrementally with one 
>> additional commit since the last revision:
>> 
>>   Update src/jdk.hotspot.agent/linux/native/libsaproc/dwarf.cpp
>>   
>>   Co-authored-by: Chris Plummer <[email protected]>
>
> src/jdk.hotspot.agent/linux/native/libsaproc/libproc_impl.c line 139:
> 
>> 137:         destroy_symtab(lib->symtab);
>> 138:      }
>> 139:      close(lib->fd);
> 
> `core_release()` already closes these fds through `close_files()`, before 
> `Prelease()` calls `destroy_lib_info()`. This closes them twice in core mode 
> and could close an unrelated fd reused by another thread.
> 
> Could we move this close to `process_cleanup()` instead? I checked the 
> core-file case with strace and confirmed the duplicate close() calls. Moving 
> the close to process_cleanup() fixed this.

I updated that `fd` in `lib_info` would be closed only in `destroy_lib_info()`. 
I think it is better to keep the close in a single place for maintainability.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/33375#discussion_r4333551591

Reply via email to