Skip to content
Snippets Groups Projects
  • Pekka Enberg's avatar
    eff44bc7
    callstack: Fix list iteration in callstack_collector::merge() · eff44bc7
    Pekka Enberg authored
    Call to erase() invalidates iterators so switch from range-based for
    loop to using iterators manually.
    
    This fixes a bug that resulted in JVM crashing on SMP when "perf
    callstack" was run:
    
      #
      # A fatal error has been detected by the Java Runtime Environment:
      #
      #  SIGSEGV (0xb) at pc=0x0000000000328a44, pid=0, tid=18446673706080178176
      #
      # JRE version: 7.0_19
      # Java VM: OpenJDK 64-Bit Server VM (23.7-b01 mixed mode linux-amd64 compressed oops)
      # Problematic frame:
      # C  0x0000000000328a44
      #
      # Core dump written. Default location: //core or core.0
      #
      # An error report file with more information is saved as:
      # /tmp/jvm-0/hs_error.log
      #
      # If you would like to submit a bug report, please include
      # instructions on how to reproduce the bug and visit:
      #   http://icedtea.classpath.org/bugzilla
      #
      Aborted
    eff44bc7
    History
    callstack: Fix list iteration in callstack_collector::merge()
    Pekka Enberg authored
    Call to erase() invalidates iterators so switch from range-based for
    loop to using iterators manually.
    
    This fixes a bug that resulted in JVM crashing on SMP when "perf
    callstack" was run:
    
      #
      # A fatal error has been detected by the Java Runtime Environment:
      #
      #  SIGSEGV (0xb) at pc=0x0000000000328a44, pid=0, tid=18446673706080178176
      #
      # JRE version: 7.0_19
      # Java VM: OpenJDK 64-Bit Server VM (23.7-b01 mixed mode linux-amd64 compressed oops)
      # Problematic frame:
      # C  0x0000000000328a44
      #
      # Core dump written. Default location: //core or core.0
      #
      # An error report file with more information is saved as:
      # /tmp/jvm-0/hs_error.log
      #
      # If you would like to submit a bug report, please include
      # instructions on how to reproduce the bug and visit:
      #   http://icedtea.classpath.org/bugzilla
      #
      Aborted