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

stack overflow in native method results in segfault, not a StackOverflowError

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Duplicate
    • Affects Version/s: 5.0
    • Fix Version/s: None
    • Component/s: hotspot
    • Labels:
    • Subcomponent:
    • CPU:
      x86
    • OS:
      linux

      Description

      FULL PRODUCT VERSION :
      java version "1.5.0_05"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05)
      Java HotSpot(TM) Server VM (build 1.5.0_05-b05, mixed mode)


      ADDITIONAL OS VERSION INFORMATION :
      Linux p3 2.6.9-22.ELsmp #1 SMP Mon Sep 19 18:32:14 EDT 2005 i686 i686 i386 GNU/Linux

      A DESCRIPTION OF THE PROBLEM :
      When looking up web64.miraclehosting.com, which has 123 ip addresses, I was getting segfaults. It took me a while to realize that my small stack size was causing a problem in glibc code. I was getting core dumps, which weren't caught by the jre handler that usually catches them, and it took me a long time to figure out what was going on. Now that I know the workaround is obvious, but without the StackOverflowError (or an OutOfMemoryError) It took me over a week to figure out.

      Thanks to Jakub Jelinek at Redhat for helping me figure this out.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      java -Xss60k InetOverflow web64.miraclehosting.com


      ACTUAL -
      (gdb) bt
      #0 *__GI_getaddrinfo (name=0x81e0a50 "web64.miraclehosting.com",
      service=0x7d77ac8a "domain", hints=0x7c6646f4, pai=0x7c6646f0)
          at ../sysdeps/posix/getaddrinfo.c:1593
      #1 0x7d76ef08 in Java_java_net_Inet6AddressImpl_lookupAllHostAddr () from
      /usr/local/jdk1.5.0_05/jre/lib/i386/libnet.so
      #2 0xb22b6838 in ?? ()
      #3 0x7b6ea55c in ?? ()
      #4 0x7c664780 in ?? ()
      #5 0x7c66477c in ?? ()
      #6 0x7c664750 in ?? ()
      #7 0x00000000 in ?? ()

      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      Segmentation fault (core dumped)


      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      public final class InetOverflow {
          public static void main(final String[] args)throws Exception {
              for(int i = 0; i < args.length; i++){
                  java.net.InetAddress.getAllByName(args[i]);
              }
          }
      }

      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      Make sure to use large stack sizes.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                coleenp Coleen Phillimore
                Reporter:
                ndcosta Nelson Dcosta (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: