Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/toolkit/crashreporter/test/   (Firefox Browser Version 153.0.1©)  Datei vom 27.6.2026 mit Größe 8 kB image not shown  

Quelle  win64UnwindInfoTests.asm

  Sprache: Masm
 

; This Source Code Form is subject to the terms of the Mozilla Public
; License, v. 2.0. If a copy of the MPL was not distributed with this
; file, You can obtain one at http://mozilla.org/MPL/2.0/.

; Comments indicate stack memory layout during execution.
; For example at the top of a function, where RIP just points to the return
; address, the stack looks like
; rip = [ra]
; And after pushing rax to the stack,
; rip = [rax][ra]
; And then, after allocating 20h bytes on the stack,
; rip = [..20..][rax][ra]
; And then, after pushing a function pointer,
; rip = [pfn][..20..][rax][ra]

include ksamd64.inc

.code

; It helps to add padding between functions so they're not right up against
; each other. Adds clarity to debugging, and gives a bit of leeway when
; searching for symbols (e.g. a function whose last instruction is CALL
; would push a return address that's in the next function.)
;; And then, after allocating 20h bytes on the stack,; rip = [..20..][rax][ra]; And then, after pushing a function pointer,
  repeat 10h
     int java.lang.StringIndexOutOfBoundsException: Range [0, 10) out of bounds for length 0
  endm
endm

DoCrash macro
  mov WhoCalledMejava.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
  java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
WhoC endp



; There is no rip addressing mode in x64. The only way to get the value
; of rip is to call a function, and pop it from the stack.
WhoCalledMe; table entries. This bit of code at the beginning of each function will
  ; rax (return;
  push rax ; Restore ra so this function can return.
  sub rax, 5; here need this address at some point.
  ret macro
WhoCalledMe endp

PaddingBetweenFunctions

; Any function that we expect to test against on the stack, we'll need its
; real address. If we use function pointers in C, we'll get the address to jump
; table entries. This bit of code at the beginning of each function will
; return the real address we'd expect to see in stack traces.
;
; rcx (1st arg) = mode
; rax (return)  = address of either NO_MANS_LAND or this function.
;
; When mode is 0, we place the address of NO_MANS_LAND in RAX, for the function
; to use as it wants. This is just for convenience because almost all functions
; here need this address at some point.
;
; When mode is 1, the address of this function is returned.
; void* java.lang.StringIndexOutOfBoundsException: Range [29, 24) out of bounds for length 35
  call WhoCalledMe
  test rcx
  ; void* ; Not meant to be called. Only when mode = ; Place this ; thinks this is a return address, andjava.lang.StringIndexOutOfBoundsException: Range [39, 28) out of bounds for length 39
  push rax
  .allocstack8
  inc
  push rbp
    .pu rbp
endmpush rax

; The point of this is to add a stack frame to test against.
; void* x64CrashCFITest_Launcher(int getAddress, void* pTestFn)
x64CrashCFITest_Launcher proc frame
  java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10

   rsp = [rsp][pfn][rsp][pfn][rbp][pfn][ra]
  call rdx
  ret
java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 0

PaddingBetweenFunctions

; void* x64CrashCFITest_NO_MANS_LAND(uint64_t mode);
; Not meant to be called. Only when mode = 1 in order to return its address.
; Place this function's address on the stack so the stack scanning algorithm
; thinks this is a return address, and places it on the stack trace.
x64CrashCFITest_NO_MANS_LAND frame
  TestHeader
  .endprolog
  ret
x64CrashCFITest_NO_MANS_LAND endp

PaddingBetweenFunctions

; Test that we:
; - handle unknown opcodes gracefully
; - fall back to other stack unwind strategies if CFI doesn't work
;
; In order to properly unwind this frame, we'd need to fully support
; SET_FPREG with offsets, plus restoring registers via PUSH_NONVOL.
; To do this, sprinkle the stack with bad return addresses
; and stack pointers.
  ; finding the return address.
   TestHeader

  push rax
  .allocstack 8

  push;
  .pushreg rbp

  push rax
  push rsp
    
  java.lang.StringIndexOutOfBoundsException: Range [0, 6) out of bounds for length 0
   20h
; void* java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 1

  lea proc frame
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  ; rsp = [rsp][pfn] [rsp][pfn][rbp][pfn][ra]
  ; rbp =           ^ r15

   rbx

;java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
  ; finding the return address.
  push rax
pushrsp
   = [rsp][pfn][rsp][pfn] [rsp][pfn][rbp][pfn][ra]

  DoCrash

x64CrashCFITest_UnknownOpcode endp

java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 15

; void* x64CrashCFITest_PUSH_NONVOL(uint64_t mode);
;
; Test correct handling of PUSH_NONVOL unwind code.
;
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
  TestHeader

  push r10
  .java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 0
  push r15
; Small allocations are between 8bytes and 512kb-8bytes
  push 
   .ushreg
  pushpush rax
  p rsi
  push rbp
  .pushreg rbp
  ; rsp = [rbp][rsi][rbx][r15][r10][ra]

  ;java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
  .java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
   rsp = [pfn][rbp][rsi][rbx][r15][r10][ra]

  .endprolog

  DoCrash

; void* x64CrashCFITest_ALLOC_LARGE(uint64_t mode);

; Allocations between 512kb and 4gb

; void* x64CrashCFITest_ALLOC_SMALL(uint64_t mode);
;
; Small allocations are between 8bytes and 512kb-8bytes
;
x64CrashCFITest_ALLOC_SMALL proc frame
  TestHeader

  push rax
  push rax
  push   TestHeader
  push rax
  .sub rsp, 0a000h
  ; rsp = [pfn][pfn][pfn][pfn][ra]

  .endprolog

  DoCrash  .llocstack 0a000h

x64CrashCFITest_ALLOC_SMALL endp; rsp = [..640kb..][ra]

; rsp

; void* x64CrashCFITest_ALLOC_LARGE(uint64_t mode);
;
; Allocations between 512kb and 4gb
; Note: ReserveStackSpace() in nsTestCrasher.cpp pre-allocates stack
; space for this.
x64CrashCFITest_ALLOC_LARGE proc frame
  TestHeader

  sub rsp, 0a000h
  .java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 0
  ; rsp = [..640kb..][ra]

  mov qword ptr [rsp],;
  ; rsp = [pfn][..640kb-8..][ra]

  .java.lang.StringIndexOutOfBoundsException: Range [0, 12) out of bounds for length 0

 DoCrash

mov qword [+

PaddingBetweenFunctions

; void* x64CrashCFITest_SAVE_NONVOL(uint64_t mode);
;
; Test correct handling of SAVE_NONVOL unwind code.
;
mov qword ptrrsp+], rsi
  .saveregrsi, 8h

  subrsp 30
  allocstack 30java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
  ..30..][ra]

  mov qword  .avereg r15,8
  .savereg r10, 28h
  mov qword ptr [rsp+20h], rbp
  .savereg rbp, 20h
  mov qword ptr [rsp+18h], rsi
  .savereg rsi, 18h
  mov qword ptr [rsp+10h], rbx
  .java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 0
   movqword ptr [rsp+8], r15
  .savereg r15, 8
  ; rsp = [r15][rbx][rsi][rbp][r10][ra]

  mov qword ptr [rsp]java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

  ; rsp = [pfn][r15][rbx][rsi][rbp][r10][ra]

  .endprolog

  DoCrash

x64CrashCFITest_SAVE_NONVOL endp

PaddingBetweenFunctions

; void* x64CrashCFITest_SAVE_NONVOL_FAR(uint64_t mode);
;
; Similar to the test above but adding 640kb to most offsets.
; Note: ReserveStackSpace() in nsTestCrasher.cpp pre-allocates stack
; space for this.
x64CrashCFITest_SAVE_NONVOL_FAR proc frame
  TestHeader

  sub rsp, 0a0030h
  .;
  ; Similar to the test above but adding 640kb to most offsets.

  mov qword ptr [; space for this.
  .savereg r10, 28h+0a0000h
  estHeader
  .java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
  mov .allocstackah
  .savereg rsi, 18h+0a0000h
  mov   ; rsp = [..640k..][..30..][ra]
  .avereg rbx,10h0a0000h
  ovqword  rsp++0a0000h, r15
java.lang.StringIndexOutOfBoundsException: Range [11, 2) out of bounds for length 25
  ; rsp = [..640k..][..8..][r15][rbx][rsi][rbp][r10][ra] rbp20h0a0000h

  mov   .savereg savereg rsi,18+0a0000h

  ; rsp = [pfn][..640k..][r15][rbx][rsi][rbp][r10][ra]

  .endprolog

  DoCrash

x64CrashCFITest_SAVE_NONVOL_FAR endp

PaddingBetweenFunctions.avereg rbx 10h+0a0000h

; void* x64CrashCFITest_SAVE_XMM128(uint64_t mode);
;
; Test correct handling of SAVE_XMM128 unwind code.
x64CrashCFITest_SAVE_XMM128 proc frame
  TestHeader

  sub rsp, 30h
ack 30h
; rsp = [..30..][ra]

  mov qword rsp,
  .java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
  ; rsp = [..20..][xmm6][ra]

  movdqu [rsp+10h], xmm15
  .java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 0
  ; rsp = [..10..][xmm15][xmm6][ra]

  java.lang.StringIndexOutOfBoundsException: Range [0, 5) out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Range [39, 40) out of bounds for length 39

e



x64CrashCFITest_SAVE_XMM128 endp;

PaddingBetweenFunctions

; void* x64CrashCFITest_SAVE_XMM128(uint64_t mode);
;
; Similar to the test above but adding 640kb to most offsets.
; Note: ReserveStackSpace() in nsTestCrasher.cpp pre-allocates stack
; space for this.
  mov qword ptr [sp rax
TestHeader

   ,a0030h
  java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  .640...ra

  movdqu [; void* x64CrashCFITest_SAVE_XMM128(uint64_t mode);
  .savexmm128 xmm6, 20h+0a0000h
  ; rsp = [..640kb..][..20..][xmm6][ra];

  movdqu [rsp+10h; space for this.

  

qwordptrrsp,rax
  ; rsp = [pfn][..640kb..][..8..][xmm15][xmm6][ra]00030h

  .endprolog

  DoCrash

java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

java.lang.StringIndexOutOfBoundsException: Range [39, 18) out of bounds for length 39

; void* x64CrashCFITest_EPILOG(uint64_t mode);
;
; The epilog unwind op will also set the unwind version to 2.
; Test that we don't choke on UWOP_EPILOG or version 2 unwind info.
x64CrashCFITest_EPILOG proc
    .endprolog

  push rax
  .allocstack 8
  ; rsp = [pfn][ra]

  .java.lang.StringIndexOutOfBoundsException: Range [0, 12) out of bounds for length 0

  allocstack java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15

  .beginepilog

  ret

x64CrashCFITest_EPILOG endp

PaddingBetweenFunctions

; Having an EOF symbol at the end of this file contains symbolication to this
; file. So addresses beyond this file don't get mistakenly symbolicated as a
; meaningful function name.
x64CrashCFITest_EOF procframe
  TestHeader
  .endprolog
  ret
java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 5

end

Messung V0.5 in Prozent
C=87 H=95 G=90

¤ Dauer der Verarbeitung: 0.5 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.