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

More libraries with .gnu_debuglink sections added unconditionally

    Details

      Description

      This is a JDK 8-only bug. Very similar to JDK-8206425 but for different libraries. In JDK 10+ this is solved with configure option --with-native-debug-symbols=internal which seems to behave correctly.

      On JDK 8u, however, the build adds .gnu_debuglink sections to various libraries even in cases where *nothing* is being stripped from files. In such a case adding .gnu_debuglink sections with pointers to files that will never exist is wrong. The debug info is (still) in the file itself!

      One needs to build JDK 8 with no native debug info stripping like this:

      $ make [...] POST_STRIP_CMD="" STRIP_POLICY=no_strip

      The "no_strip" policy is supposed to instruct the hotspot build to not do any stripping[1].

      Then in a resulting build .gnu_debuginfo sections are there in the following libraries:

      $ JDK=./build/linux-x86_64-normal-server-release/images/j2sdk-image; count=0; for i in $(find $JDK -name \*.so); do eu-readelf -S $i | grep '] .gnu_debuglink' | grep PROGBITS && echo "library with .gnu_debuglink section: $i" && eu-readelf -x .gnu_debuglink $i && echo -e '\n' && count=$(($count + 1)); done; if [ $count -ne 0 ]; then echo "FAIL!"; else echo PASS; fi
      [33] .gnu_debuglink PROGBITS 0000000000000000 000261a8 00000018 0 0 0 4
      library with .gnu_debuglink section: ./build/linux-x86_64-normal-server-release/images/j2sdk-image/jre/lib/amd64/libj2gss.so

      Hex dump of section [33] '.gnu_debuglink', 24 bytes at offset 0x261a8:
        0x00000000 6c69626a 32677373 2e646562 7567696e libj2gss.debugin
        0x00000010 666f0000 86b6344a fo....4J


      [33] .gnu_debuglink PROGBITS 0000000000000000 0007d8ac 0000001c 0 0 0 4
      library with .gnu_debuglink section: ./build/linux-x86_64-normal-server-release/images/j2sdk-image/jre/lib/amd64/libj2pkcs11.so

      Hex dump of section [33] '.gnu_debuglink', 28 bytes at offset 0x7d8ac:
        0x00000000 6c69626a 32706b63 7331312e 64656275 libj2pkcs11.debu
        0x00000010 67696e66 6f000000 b8aaf50d ginfo.......


      [33] .gnu_debuglink PROGBITS 0000000000000000 0000e4c4 00000018 0 0 0 4
      library with .gnu_debuglink section: ./build/linux-x86_64-normal-server-release/images/j2sdk-image/jre/lib/amd64/libjsdt.so

      Hex dump of section [33] '.gnu_debuglink', 24 bytes at offset 0xe4c4:
        0x00000000 6c69626a 7364742e 64656275 67696e66 libjsdt.debuginf
        0x00000010 6f000000 c744ebac o....D..


      [33] .gnu_debuglink PROGBITS 0000000000000000 0003aa24 00000018 0 0 0 4
      library with .gnu_debuglink section: ./build/linux-x86_64-normal-server-release/images/j2sdk-image/jre/lib/amd64/libverify.so

      Hex dump of section [33] '.gnu_debuglink', 24 bytes at offset 0x3aa24:
        0x00000000 6c696276 65726966 792e6465 62756769 libverify.debugi
        0x00000010 6e666f00 01200926 nfo.. .&


      [33] .gnu_debuglink PROGBITS 0000000000000000 000419d0 00000018 0 0 0 4
      library with .gnu_debuglink section: ./build/linux-x86_64-normal-server-release/images/j2sdk-image/jre/lib/amd64/jli/libjli.so

      Hex dump of section [33] '.gnu_debuglink', 24 bytes at offset 0x419d0:
        0x00000000 6c69626a 6c692e64 65627567 696e666f libjli.debuginfo
        0x00000010 00000000 c22de0dc .....-..


      [34] .gnu_debuglink PROGBITS 0000000000000000 0001de28 00000018 0 0 0 4
      library with .gnu_debuglink section: ./build/linux-x86_64-normal-server-release/images/j2sdk-image/jre/lib/amd64/libsctp.so

      Hex dump of section [34] '.gnu_debuglink', 24 bytes at offset 0x1de28:
        0x00000000 6c696273 6374702e 64656275 67696e66 libsctp.debuginf
        0x00000010 6f000000 fd64c0d4 o....d..


      [34] .gnu_debuglink PROGBITS 0000000000000000 0009f054 00000018 0 0 0 4
      library with .gnu_debuglink section: ./build/linux-x86_64-normal-server-release/images/j2sdk-image/jre/lib/amd64/libnet.so

      Hex dump of section [34] '.gnu_debuglink', 24 bytes at offset 0x9f054:
        0x00000000 6c69626e 65742e64 65627567 696e666f libnet.debuginfo
        0x00000010 00000000 73040098 ....s...


      [34] .gnu_debuglink PROGBITS 0000000000000000 0015cb80 00000018 0 0 0 4
      library with .gnu_debuglink section: ./build/linux-x86_64-normal-server-release/images/j2sdk-image/jre/lib/amd64/libhprof.so

      Hex dump of section [34] '.gnu_debuglink', 24 bytes at offset 0x15cb80:
        0x00000000 6c696268 70726f66 2e646562 7567696e libhprof.debugin
        0x00000010 666f0000 d24d62ce fo...Mb.


      [34] .gnu_debuglink PROGBITS 0000000000000000 000ac968 00000018 0 0 0 4
      library with .gnu_debuglink section: ./build/linux-x86_64-normal-server-release/images/j2sdk-image/jre/lib/amd64/libsunec.so

      Hex dump of section [34] '.gnu_debuglink', 24 bytes at offset 0xac968:
        0x00000000 6c696273 756e6563 2e646562 7567696e libsunec.debugin
        0x00000010 666f0000 368a5ac7 fo..6.Z.


      [34] .gnu_debuglink PROGBITS 0000000000000000 0009b880 00000018 0 0 0 4
      library with .gnu_debuglink section: ./build/linux-x86_64-normal-server-release/images/j2sdk-image/jre/lib/amd64/libnio.so

      Hex dump of section [34] '.gnu_debuglink', 24 bytes at offset 0x9b880:
        0x00000000 6c69626e 696f2e64 65627567 696e666f libnio.debuginfo
        0x00000010 00000000 804f6d1a .....Om.


      [34] .gnu_debuglink PROGBITS 0000000000000000 000a7e98 00000018 0 0 0 4
      library with .gnu_debuglink section: ./build/linux-x86_64-normal-server-release/images/j2sdk-image/jre/lib/amd64/libunpack.so

      Hex dump of section [34] '.gnu_debuglink', 24 bytes at offset 0xa7e98:
        0x00000000 6c696275 6e706163 6b2e6465 62756769 libunpack.debugi
        0x00000010 6e666f00 d49999ee nfo.....


      [34] .gnu_debuglink PROGBITS 0000000000000000 00262614 0000001c 0 0 0 4
      library with .gnu_debuglink section: ./build/linux-x86_64-normal-server-release/images/j2sdk-image/jre/lib/amd64/libawt_xawt.so

      Hex dump of section [34] '.gnu_debuglink', 28 bytes at offset 0x262614:
        0x00000000 6c696261 77745f78 6177742e 64656275 libawt_xawt.debu
        0x00000010 67696e66 6f000000 8cfa6714 ginfo.....g.


      [34] .gnu_debuglink PROGBITS 0000000000000000 00049bac 00000020 0 0 0 4
      library with .gnu_debuglink section: ./build/linux-x86_64-normal-server-release/images/j2sdk-image/jre/lib/amd64/libawt_headless.so

      Hex dump of section [34] '.gnu_debuglink', 32 bytes at offset 0x49bac:
        0x00000000 6c696261 77745f68 6561646c 6573732e libawt_headless.
        0x00000010 64656275 67696e66 6f000000 a7a9f187 debuginfo.......


      [32] .gnu_debuglink PROGBITS 0000000000000000 00009834 00000018 0 0 0 4
      library with .gnu_debuglink section: ./build/linux-x86_64-normal-server-release/images/j2sdk-image/jre/lib/amd64/libjsound.so

      Hex dump of section [32] '.gnu_debuglink', 24 bytes at offset 0x9834:
        0x00000000 6c69626a 736f756e 642e6465 62756769 libjsound.debugi
        0x00000010 6e666f00 fd22bd16 nfo.."..


      [33] .gnu_debuglink PROGBITS 0000000000000000 001a0794 00000020 0 0 0 4
      library with .gnu_debuglink section: ./build/linux-x86_64-normal-server-release/images/j2sdk-image/jre/lib/amd64/libsplashscreen.so

      Hex dump of section [33] '.gnu_debuglink', 32 bytes at offset 0x1a0794:
        0x00000000 6c696273 706c6173 68736372 65656e2e libsplashscreen.
        0x00000010 64656275 67696e66 6f000000 cd5e0ded debuginfo....^..


      [33] .gnu_debuglink PROGBITS 0000000000000000 003fd424 0000001c 0 0 0 4
      library with .gnu_debuglink section: ./build/linux-x86_64-normal-server-release/images/j2sdk-image/jre/lib/amd64/libmlib_image.so

      Hex dump of section [33] '.gnu_debuglink', 28 bytes at offset 0x3fd424:
        0x00000000 6c69626d 6c69625f 696d6167 652e6465 libmlib_image.de
        0x00000010 62756769 6e666f00 b87fa30a buginfo.....


      [34] .gnu_debuglink PROGBITS 0000000000000000 0005373c 0000001c 0 0 0 4
      library with .gnu_debuglink section: ./build/linux-x86_64-normal-server-release/images/j2sdk-image/jre/lib/amd64/libinstrument.so

      Hex dump of section [34] '.gnu_debuglink', 28 bytes at offset 0x5373c:
        0x00000000 6c696269 6e737472 756d656e 742e6465 libinstrument.de
        0x00000010 62756769 6e666f00 764a76fa buginfo.vJv.


      [31] .gnu_debuglink PROGBITS 0000000000000000 000068ec 0000001c 0 0 0 4
      library with .gnu_debuglink section: ./build/linux-x86_64-normal-server-release/images/j2sdk-image/jre/lib/amd64/libjaas_unix.so

      Hex dump of section [31] '.gnu_debuglink', 28 bytes at offset 0x68ec:
        0x00000000 6c69626a 6161735f 756e6978 2e646562 libjaas_unix.deb
        0x00000010 7567696e 666f0000 08e96ad3 uginfo....j.


      [34] .gnu_debuglink PROGBITS 0000000000000000 0005d48c 0000001c 0 0 0 4
      library with .gnu_debuglink section: ./build/linux-x86_64-normal-server-release/images/j2sdk-image/jre/lib/amd64/libmanagement.so

      Hex dump of section [34] '.gnu_debuglink', 28 bytes at offset 0x5d48c:
        0x00000000 6c69626d 616e6167 656d656e 742e6465 libmanagement.de
        0x00000010 62756769 6e666f00 cf8ba11f buginfo.....


      [33] .gnu_debuglink PROGBITS 0000000000000000 00023cac 00000020 0 0 0 4
      library with .gnu_debuglink section: ./build/linux-x86_64-normal-server-release/images/j2sdk-image/jre/lib/amd64/libjava_crw_demo.so

      Hex dump of section [33] '.gnu_debuglink', 32 bytes at offset 0x23cac:
        0x00000000 6c69626a 6176615f 6372775f 64656d6f libjava_crw_demo
        0x00000010 2e646562 7567696e 666f0000 3fdc6ef9 .debuginfo..?.n.


      [35] .gnu_debuglink PROGBITS 0000000000000000 002f505c 00000020 0 0 0 4
      library with .gnu_debuglink section: ./build/linux-x86_64-normal-server-release/images/j2sdk-image/jre/lib/amd64/libfontmanager.so

      Hex dump of section [35] '.gnu_debuglink', 32 bytes at offset 0x2f505c:
        0x00000000 6c696266 6f6e746d 616e6167 65722e64 libfontmanager.d
        0x00000010 65627567 696e666f 00000000 9f80996e ebuginfo.......n


      [33] .gnu_debuglink PROGBITS 0000000000000000 0005fd28 0000001c 0 0 0 4
      library with .gnu_debuglink section: ./build/linux-x86_64-normal-server-release/images/j2sdk-image/jre/lib/amd64/libjsoundalsa.so

      Hex dump of section [33] '.gnu_debuglink', 28 bytes at offset 0x5fd28:
        0x00000000 6c69626a 736f756e 64616c73 612e6465 libjsoundalsa.de
        0x00000010 62756769 6e666f00 31d66482 buginfo.1.d.


      [34] .gnu_debuglink PROGBITS 0000000000000000 0020caf8 00000018 0 0 0 4
      library with .gnu_debuglink section: ./build/linux-x86_64-normal-server-release/images/j2sdk-image/jre/lib/amd64/liblcms.so

      Hex dump of section [34] '.gnu_debuglink', 24 bytes at offset 0x20caf8:
        0x00000000 6c69626c 636d732e 64656275 67696e66 liblcms.debuginf
        0x00000010 6f000000 6b807e90 o...k.~.


      [34] .gnu_debuglink PROGBITS 0000000000000000 0000f358 0000001c 0 0 0 4
      library with .gnu_debuglink section: ./build/linux-x86_64-normal-server-release/images/j2sdk-image/jre/lib/amd64/libdt_socket.so

      Hex dump of section [34] '.gnu_debuglink', 28 bytes at offset 0xf358:
        0x00000000 6c696264 745f736f 636b6574 2e646562 libdt_socket.deb
        0x00000010 7567696e 666f0000 08c69e7d uginfo.....}


      [34] .gnu_debuglink PROGBITS 0000000000000000 001f9dbc 00000018 0 0 0 4
      library with .gnu_debuglink section: ./build/linux-x86_64-normal-server-release/images/j2sdk-image/jre/lib/amd64/libjdwp.so

      Hex dump of section [34] '.gnu_debuglink', 24 bytes at offset 0x1f9dbc:
        0x00000000 6c69626a 6477702e 64656275 67696e66 libjdwp.debuginf
        0x00000010 6f000000 480f733a o...H.s:


      [33] .gnu_debuglink PROGBITS 0000000000000000 0002fc34 00000018 0 0 0 4
      library with .gnu_debuglink section: ./build/linux-x86_64-normal-server-release/images/j2sdk-image/jre/lib/amd64/libzip.so

      Hex dump of section [33] '.gnu_debuglink', 24 bytes at offset 0x2fc34:
        0x00000000 6c69627a 69702e64 65627567 696e666f libzip.debuginfo
        0x00000010 00000000 6952d9c9 ....iR..


      [33] .gnu_debuglink PROGBITS 0000000000000000 003dcd10 00000018 0 0 0 4
      library with .gnu_debuglink section: ./build/linux-x86_64-normal-server-release/images/j2sdk-image/jre/lib/amd64/libawt.so

      Hex dump of section [33] '.gnu_debuglink', 24 bytes at offset 0x3dcd10:
        0x00000000 6c696261 77742e64 65627567 696e666f libawt.debuginfo
        0x00000010 00000000 f9050405 ........


      [33] .gnu_debuglink PROGBITS 0000000000000000 000112a4 00000018 0 0 0 4
      library with .gnu_debuglink section: ./build/linux-x86_64-normal-server-release/images/j2sdk-image/jre/lib/amd64/libj2pcsc.so

      Hex dump of section [33] '.gnu_debuglink', 24 bytes at offset 0x112a4:
        0x00000000 6c69626a 32706373 632e6465 62756769 libj2pcsc.debugi
        0x00000010 6e666f00 ae18f125 nfo....%


      [33] .gnu_debuglink PROGBITS 0000000000000000 0000b084 00000018 0 0 0 4
      library with .gnu_debuglink section: ./build/linux-x86_64-normal-server-release/images/j2sdk-image/jre/lib/amd64/libnpt.so

      Hex dump of section [33] '.gnu_debuglink', 24 bytes at offset 0xb084:
        0x00000000 6c69626e 70742e64 65627567 696e666f libnpt.debuginfo
        0x00000010 00000000 1e91febd ........


      [34] .gnu_debuglink PROGBITS 0000000000000000 00155bb8 00000018 0 0 0 4
      library with .gnu_debuglink section: ./build/linux-x86_64-normal-server-release/images/j2sdk-image/jre/lib/amd64/libjava.so

      Hex dump of section [34] '.gnu_debuglink', 24 bytes at offset 0x155bb8:
        0x00000000 6c69626a 6176612e 64656275 67696e66 libjava.debuginf
        0x00000010 6f000000 98acb8ed o.......


      [30] .gnu_debuglink PROGBITS 0000000000000000 00006018 00000018 0 0 0 4
      library with .gnu_debuglink section: ./build/linux-x86_64-normal-server-release/images/j2sdk-image/jre/lib/amd64/libjawt.so

      Hex dump of section [30] '.gnu_debuglink', 24 bytes at offset 0x6018:
        0x00000000 6c69626a 6177742e 64656275 67696e66 libjawt.debuginf
        0x00000010 6f000000 59962975 o...Y.)u


      [33] .gnu_debuglink PROGBITS 0000000000000000 00124f34 00000018 0 0 0 4
      library with .gnu_debuglink section: ./build/linux-x86_64-normal-server-release/images/j2sdk-image/jre/lib/amd64/libjpeg.so

      Hex dump of section [33] '.gnu_debuglink', 24 bytes at offset 0x124f34:
        0x00000000 6c69626a 7065672e 64656275 67696e66 libjpeg.debuginf
        0x00000010 6f000000 28b649e7 o...(.I.


      [33] .gnu_debuglink PROGBITS 0000000000000000 0000cbf0 00000018 0 0 0 4
      library with .gnu_debuglink section: ./build/linux-x86_64-normal-server-release/images/j2sdk-image/jre/lib/amd64/libattach.so

      Hex dump of section [33] '.gnu_debuglink', 24 bytes at offset 0xcbf0:
        0x00000000 6c696261 74746163 682e6465 62756769 libattach.debugi
        0x00000010 6e666f00 398787b1 nfo.9...


      [33] .gnu_debuglink PROGBITS 0000000000000000 000419d0 00000018 0 0 0 4
      library with .gnu_debuglink section: ./build/linux-x86_64-normal-server-release/images/j2sdk-image/lib/amd64/jli/libjli.so

      Hex dump of section [33] '.gnu_debuglink', 24 bytes at offset 0x419d0:
        0x00000000 6c69626a 6c692e64 65627567 696e666f libjli.debuginfo
        0x00000010 00000000 c22de0dc .....-..


      [30] .gnu_debuglink PROGBITS 0000000000000000 00006018 00000018 0 0 0 4
      library with .gnu_debuglink section: ./build/linux-x86_64-normal-server-release/images/j2sdk-image/lib/amd64/libjawt.so

      Hex dump of section [30] '.gnu_debuglink', 24 bytes at offset 0x6018:
        0x00000000 6c69626a 6177742e 64656275 67696e66 libjawt.debuginf
        0x00000010 6f000000 59962975 o...Y.)u


      FAIL!

      It's expected that libraries don't contain any .gnu_debuglink sections since no stripping is being done and the bash snippet above prints "PASS". Please note that JDK-8206425 fixed this for libjvm.so, libsaproc.so and libjsig.so

      [1] http://hg.openjdk.java.net/jdk8u/jdk8u-dev/hotspot/file/ad057f2e3211/make/linux/makefiles/defs.make#l211

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                sgehwolf Severin Gehwolf
                Reporter:
                sgehwolf Severin Gehwolf
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: