Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parse stack traces to avoid string contains checks #41

Closed
prashantv opened this issue Jan 7, 2020 · 0 comments · Fixed by #112
Closed

Parse stack traces to avoid string contains checks #41

prashantv opened this issue Jan 7, 2020 · 0 comments · Fixed by #112

Comments

@prashantv
Copy link
Collaborator

We have a couple of strings.Contains checks , e.g.,

return strings.Contains(s.Full(), "runtime.ensureSigM")

We should parse the stack trace and filter on specific parts of the trace (E.g., only function name) rather than doing a string comparison against the entire stack trace which contains filesystem paths etc.

abhinav added a commit that referenced this issue Oct 21, 2023
Instead of matching for built-in functions with strings.Contains,
use the parsed stack information to match function names exactly.

Following this change, the only remaining strings.Contains are
to match on the goroutine state:

```
% rg strings.Contains
utils_test.go
84:             if strings.Contains(s.State(), "run") {

internal/stack/stacks_test.go
249:            if strings.Contains(s.State(), "run") {
```

Resolves #41
abhinav added a commit that referenced this issue Oct 21, 2023
Instead of matching for built-in functions with strings.Contains,
use the parsed stack information to match function names exactly.

Following this change, the only remaining strings.Contains are
to match on the goroutine state:

```
% rg strings.Contains
utils_test.go
84:             if strings.Contains(s.State(), "run") {

internal/stack/stacks_test.go
249:            if strings.Contains(s.State(), "run") {
```

Resolves #41
abhinav added a commit that referenced this issue Oct 21, 2023
Instead of matching for built-in functions with strings.Contains,
use the parsed stack information to match function names exactly.

Following this change, the only remaining strings.Contains are
to match on the goroutine state:

```
% rg strings.Contains
utils_test.go
84:             if strings.Contains(s.State(), "run") {

internal/stack/stacks_test.go
249:            if strings.Contains(s.State(), "run") {
```

Resolves #41
abhinav added a commit that referenced this issue Oct 22, 2023
Instead of matching for built-in functions with strings.Contains,
use the parsed stack information to match function names exactly.

Following this change, the only remaining strings.Contains are
to match on the goroutine state:

```
% rg strings.Contains
utils_test.go
84:             if strings.Contains(s.State(), "run") {

internal/stack/stacks_test.go
249:            if strings.Contains(s.State(), "run") {
```

Resolves #41
abhinav added a commit that referenced this issue Oct 23, 2023
Adds support to the stack parser for reading the full list of functions
for a stack trace.

NOTE:
The function that created the goroutine
is NOT considered part of the stack.

We don't maintain the order of the functions
since that's not something we need at this time.
The functions are all placed in a set.

This unblocks #41 and allows implementing an
IgnoreAnyFunction option (similar to the stalled #80 PR).

Depends on #110
abhinav added a commit that referenced this issue Oct 23, 2023
Instead of matching for built-in functions with strings.Contains,
use the parsed stack information to match function names exactly.

Following this change, the only remaining strings.Contains are
to match on the goroutine state:

```
% rg strings.Contains
utils_test.go
84:             if strings.Contains(s.State(), "run") {

internal/stack/stacks_test.go
249:            if strings.Contains(s.State(), "run") {
```

Resolves #41
abhinav added a commit that referenced this issue Oct 23, 2023
Instead of matching for built-in functions with strings.Contains,
use the parsed stack information to match function names exactly.

Following this change, the only remaining strings.Contains are
to match on the goroutine state:

```
% rg strings.Contains
utils_test.go
84:             if strings.Contains(s.State(), "run") {

internal/stack/stacks_test.go
249:            if strings.Contains(s.State(), "run") {
```

Resolves #41
Depends on #111
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant