-
Bug
-
Resolution: Fixed
-
P3
-
24
-
b18
-
os_x
The new code use rc (an int) with a %s format string:
rc = pthread_create(&main_thr, NULL, &apple_main, &args);
if (rc != 0) {
JLI_ReportErrorMessageSys("Could not create main thread, return code: %s\n", rc);
exit(1);
}
The compiler should be able to catch this if JLI_ReportErrorMessageSys was declared with something like __attribute__ ((format (printf, 1, 2))).
I didn't compile this code or test it, this bug report is based on visual code inspection only. I assume pthread_detach cannot actually fail on MacOS, so I think this is P5.
rc = pthread_create(&main_thr, NULL, &apple_main, &args);
if (rc != 0) {
JLI_ReportErrorMessageSys("Could not create main thread, return code: %s\n", rc);
exit(1);
}
The compiler should be able to catch this if JLI_ReportErrorMessageSys was declared with something like __attribute__ ((format (printf, 1, 2))).
I didn't compile this code or test it, this bug report is based on visual code inspection only. I assume pthread_detach cannot actually fail on MacOS, so I think this is P5.
- relates to
-
JDK-8339475 Clean up return code handling for pthread calls in library coding
- Resolved
- links to
-
Commit(master) openjdk/jdk/c8c4ff20
-
Review(master) openjdk/jdk23u/184
-
Review(master) openjdk/jdk/21278