From b1e07476d74bb730e1ada638bc5b1be931c22f1f Mon Sep 17 00:00:00 2001 From: Francesco Vigliaturo Date: Fri, 17 Nov 2023 12:22:43 +0100 Subject: [PATCH 1/4] Fix empty parameters list issue --- Cargo.lock | 42 ++++++++++++++++---------------- py/symbolic/proguard.py | 3 ++- symbolic-cabi/include/symbolic.h | 3 ++- symbolic-cabi/src/proguard.rs | 3 ++- 4 files changed, 27 insertions(+), 24 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8e1192d1..84613ce5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -23,7 +23,7 @@ dependencies = [ [[package]] name = "addr2line" -version = "12.5.0" +version = "12.6.0" dependencies = [ "anyhow", "clap", @@ -519,7 +519,7 @@ dependencies = [ [[package]] name = "debuginfo_debug" -version = "12.5.0" +version = "12.6.0" dependencies = [ "anyhow", "clap", @@ -543,7 +543,7 @@ checksum = "f0bc8fbe9441c17c9f46f75dfe27fa1ddb6c68a461ccaed0481419219d4f10d3" [[package]] name = "dump_cfi" -version = "12.5.0" +version = "12.6.0" dependencies = [ "anyhow", "clap", @@ -552,7 +552,7 @@ dependencies = [ [[package]] name = "dump_sources" -version = "12.5.0" +version = "12.6.0" dependencies = [ "clap", "symbolic", @@ -1080,7 +1080,7 @@ dependencies = [ [[package]] name = "minidump_stackwalk" -version = "12.5.0" +version = "12.6.0" dependencies = [ "async-trait", "clap", @@ -1242,7 +1242,7 @@ dependencies = [ [[package]] name = "object_debug" -version = "12.5.0" +version = "12.6.0" dependencies = [ "clap", "symbolic", @@ -1857,7 +1857,7 @@ dependencies = [ [[package]] name = "sourcemapcache_debug" -version = "12.5.0" +version = "12.6.0" dependencies = [ "anyhow", "clap", @@ -2076,7 +2076,7 @@ dependencies = [ [[package]] name = "symbolic" -version = "12.5.0" +version = "12.6.0" dependencies = [ "symbolic-cfi", "symbolic-common", @@ -2091,7 +2091,7 @@ dependencies = [ [[package]] name = "symbolic-cabi" -version = "12.5.0" +version = "12.6.0" dependencies = [ "proguard", "sourcemap", @@ -2101,7 +2101,7 @@ dependencies = [ [[package]] name = "symbolic-cfi" -version = "12.5.0" +version = "12.6.0" dependencies = [ "insta", "similar-asserts", @@ -2113,7 +2113,7 @@ dependencies = [ [[package]] name = "symbolic-common" -version = "12.5.0" +version = "12.6.0" dependencies = [ "debugid", "memmap2 0.8.0", @@ -2127,7 +2127,7 @@ dependencies = [ [[package]] name = "symbolic-debuginfo" -version = "12.5.0" +version = "12.6.0" dependencies = [ "criterion", "debugid", @@ -2162,7 +2162,7 @@ dependencies = [ [[package]] name = "symbolic-demangle" -version = "12.5.0" +version = "12.6.0" dependencies = [ "cc", "cpp_demangle", @@ -2174,7 +2174,7 @@ dependencies = [ [[package]] name = "symbolic-il2cpp" -version = "12.5.0" +version = "12.6.0" dependencies = [ "indexmap", "serde_json", @@ -2184,7 +2184,7 @@ dependencies = [ [[package]] name = "symbolic-ppdb" -version = "12.5.0" +version = "12.6.0" dependencies = [ "flate2", "indexmap", @@ -2200,7 +2200,7 @@ dependencies = [ [[package]] name = "symbolic-sourcemapcache" -version = "12.5.0" +version = "12.6.0" dependencies = [ "itertools 0.11.0", "js-source-scopes", @@ -2214,7 +2214,7 @@ dependencies = [ [[package]] name = "symbolic-symcache" -version = "12.5.0" +version = "12.6.0" dependencies = [ "criterion", "indexmap", @@ -2231,11 +2231,11 @@ dependencies = [ [[package]] name = "symbolic-testutils" -version = "12.5.0" +version = "12.6.0" [[package]] name = "symbolic-unreal" -version = "12.5.0" +version = "12.6.0" dependencies = [ "anylog", "bytes", @@ -2255,7 +2255,7 @@ dependencies = [ [[package]] name = "symcache_debug" -version = "12.5.0" +version = "12.6.0" dependencies = [ "anyhow", "clap", @@ -2511,7 +2511,7 @@ checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" [[package]] name = "unreal_engine_crash" -version = "12.5.0" +version = "12.6.0" dependencies = [ "clap", "symbolic", diff --git a/py/symbolic/proguard.py b/py/symbolic/proguard.py index 0ab5d1ed..a1204ea6 100644 --- a/py/symbolic/proguard.py +++ b/py/symbolic/proguard.py @@ -81,7 +81,7 @@ def remap_method(self, klass: str, method: str) -> Tuple[str, str] | None: return output if len(output[0]) > 0 and len(output[1]) > 0 else None def remap_frame( - self, klass: str, method: str, line: int, parameters: str = "" + self, klass: str, method: str, line: int, parameters: str = "", use_parameters: bool = False ) -> list[JavaStackFrame]: """Remaps the stackframe, given its class, method and line.""" result = self._methodcall( @@ -90,6 +90,7 @@ def remap_frame( encode_str(method), line, encode_str(parameters), + use_parameters, ) frames = [] diff --git a/symbolic-cabi/include/symbolic.h b/symbolic-cabi/include/symbolic.h index 87506e8a..d723a84b 100644 --- a/symbolic-cabi/include/symbolic.h +++ b/symbolic-cabi/include/symbolic.h @@ -514,7 +514,8 @@ struct SymbolicProguardRemapResult symbolic_proguardmapper_remap_frame(const str const struct SymbolicStr *class_, const struct SymbolicStr *method, uintptr_t line, - const struct SymbolicStr *parameters); + const struct SymbolicStr *parameters, + bool use_parameters); /** * Remaps a class name. diff --git a/symbolic-cabi/src/proguard.rs b/symbolic-cabi/src/proguard.rs index bc46db07..b4d3fc28 100644 --- a/symbolic-cabi/src/proguard.rs +++ b/symbolic-cabi/src/proguard.rs @@ -82,9 +82,10 @@ ffi_fn! { method: *const SymbolicStr, line: usize, parameters: *const SymbolicStr, + use_parameters: bool, ) -> Result { let mapper = &SymbolicProguardMapper::as_rust(mapper).inner.get().mapper; - let frame = if (*parameters).len > 0 { + let frame = if use_parameters { StackFrame::with_parameters((*class).as_str(), (*method).as_str(), (*parameters).as_str()) } else { StackFrame::new((*class).as_str(), (*method).as_str(), line) From 7c25ca51b99a89e48ab47c42f817b80eb21bff2c Mon Sep 17 00:00:00 2001 From: Francesco Vigliaturo Date: Fri, 17 Nov 2023 12:27:59 +0100 Subject: [PATCH 2/4] Apply linting and formatting --- py/symbolic/proguard.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/py/symbolic/proguard.py b/py/symbolic/proguard.py index a1204ea6..9050c617 100644 --- a/py/symbolic/proguard.py +++ b/py/symbolic/proguard.py @@ -81,7 +81,12 @@ def remap_method(self, klass: str, method: str) -> Tuple[str, str] | None: return output if len(output[0]) > 0 and len(output[1]) > 0 else None def remap_frame( - self, klass: str, method: str, line: int, parameters: str = "", use_parameters: bool = False + self, + klass: str, + method: str, + line: int, + parameters: str = "", + use_parameters: bool = False, ) -> list[JavaStackFrame]: """Remaps the stackframe, given its class, method and line.""" result = self._methodcall( From 1e14beb6e4583e65af3360260a67864fe44b4cfd Mon Sep 17 00:00:00 2001 From: Francesco Vigliaturo Date: Fri, 17 Nov 2023 12:36:28 +0100 Subject: [PATCH 3/4] Update Changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 56d034b5..95ac09da 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,8 @@ **Fixes** +- Fix empty parameters list issue ([#821](https://github.com/getsentry/symbolic/pull/821)) + ## 12.6.0 ### Various fixes & improvements From d0f82f0fbefdb6b5803b7633d63cb32059bff2fe Mon Sep 17 00:00:00 2001 From: Francesco Vigliaturo Date: Fri, 17 Nov 2023 13:27:52 +0100 Subject: [PATCH 4/4] Check optional parameters to set appropriate use_parameters param for the symbolic_proguardmapper_remap_frame function --- py/symbolic/proguard.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/py/symbolic/proguard.py b/py/symbolic/proguard.py index 9050c617..ac5b9fbe 100644 --- a/py/symbolic/proguard.py +++ b/py/symbolic/proguard.py @@ -1,5 +1,5 @@ from __future__ import annotations -from typing import Tuple +from typing import Optional, Tuple import uuid as uuid_mod @@ -85,8 +85,7 @@ def remap_frame( klass: str, method: str, line: int, - parameters: str = "", - use_parameters: bool = False, + parameters: Optional[str] = None, ) -> list[JavaStackFrame]: """Remaps the stackframe, given its class, method and line.""" result = self._methodcall( @@ -94,8 +93,8 @@ def remap_frame( encode_str(klass), encode_str(method), line, - encode_str(parameters), - use_parameters, + encode_str("" if parameters is None else parameters), + parameters is not None, ) frames = []