# File lib/satyr.rb, line 102
    def stacktrace
      stacktrace = @struct[:stacktrace]
      return nil if stacktrace.null?

      # There's no sr_stacktrace_dup in libsatyr.so.3, we've got to find out
      # the type ourselves.
      dup = case @struct[:type]
      when :core
        Satyr::FFI.sr_core_stacktrace_dup(stacktrace)
      when :python
        Satyr::FFI.sr_python_stacktrace_dup(stacktrace)
      when :kerneloops
        Satyr::FFI.sr_koops_stacktrace_dup(stacktrace)
      when :java
        Satyr::FFI.sr_java_stacktrace_dup(stacktrace)
      when :gdb
        Satyr::FFI.sr_gdb_stacktrace_dup(stacktrace)
      else
        raise SatyrError, "Invalid report type"
      end

      raise SatyrError, "Failed to obtain stacktrace" if dup.null?

      Stacktrace.send(:new, dup)
    end