Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8299635

Hotspot update for deprecated sprintf in Xcode 14

XMLWordPrintable

    • b07

        The sprintf is deprecated in Xcode 14 because of security concerns. The issue was addressed in JDK-8296812 and JDK-8299378, but the test was not fully covered. The failure was reported (See https://github.com/openjdk/jdk/pull/11793#issuecomment-1371151565):
        ---------------
        Ventura 13.1 (22C65)
        SDK: MacOSX13.1.sdk (XCode 14.2)
        macosx-aarch64-server-release

        $ make clean; make; make run-test tier1

        === Output from failing command(s) repeated here ===
        * For target support_test_hotspot_jtreg_native_support_libthreadend01_libthreadend01.o:
        /Users/christophs/workspace/jdk/test/hotspot/jtreg/serviceability/jvmti/events/ThreadEnd/threadend01/libthreadend01.cpp:59:5: error: 'sprintf' is deprecated: This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Werror,-Wdeprecated-declarations]
            sprintf(name, "%s%d", prefix, eventsCount);
            ^
        /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include/stdio.h:188:1: note: 'sprintf' has been explicitly marked deprecated here
        __deprecated_msg("This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.")
        ^
        /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include/sys/cdefs.h:215:48: note: expanded from macro '__deprecated_msg'
                #define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg)))
                                                              ^
        1 error generated.
        * For target support_test_hotspot_jtreg_native_support_libthreadstart01_libthreadstart01.o:
        /Users/christophs/workspace/jdk/test/hotspot/jtreg/serviceability/jvmti/events/ThreadStart/threadstart01/libthreadstart01.cpp:58:5: error: 'sprintf' is deprecated: This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Werror,-Wdeprecated-declarations]
            sprintf(name, "%s%d", prefix, eventsCount);
            ^
        /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include/stdio.h:188:1: note: 'sprintf' has been explicitly marked deprecated here
        __deprecated_msg("This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.")
        ^
        /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include/sys/cdefs.h:215:48: note: expanded from macro '__deprecated_msg'
                #define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg)))
                                                              ^
        1 error generated.

              xuelei Xuelei Fan
              xuelei Xuelei Fan
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: