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

Bump go.mod to 1.21 #417

Merged
merged 3 commits into from
Apr 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/Snowflake-Labs/sansshell

go 1.19
go 1.21

require (
github.com/coreos/go-systemd/v22 v22.5.0
Expand Down
29 changes: 29 additions & 0 deletions go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 0 additions & 4 deletions proxy/server/target.go
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,3 @@ func (u *unconnectedClientStream) SendMsg(interface{}) error {
func (u *unconnectedClientStream) RecvMsg(interface{}) error {
return fmt.Errorf("%w: RecvMsg", errUnconnectedClient)
}

func init() {
rand.Seed(time.Now().UnixNano())
}
22 changes: 15 additions & 7 deletions services/process/server/process.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ func (s *server) GetStacks(ctx context.Context, req *pb.GetStacksRequest) (*pb.G
// New thread so append last entry and start over.
if fields[0] == "Thread" {
// Depending on wrapper/gdb this may have additional fields but we don't need them.
if len(fields) < 6 {
if len(fields) < 4 {
recorder.CounterOrLog(ctx, processGetStacksFailureCounter, 1, attribute.String("reason", "parse_err"))
return nil, status.Errorf(codes.Internal, "unparsable pstack output for new thread: %s", text)
}
Expand All @@ -244,13 +244,21 @@ func (s *server) GetStacks(ctx context.Context, req *pb.GetStacksRequest) (*pb.G
recorder.CounterOrLog(ctx, processGetStacksFailureCounter, 1, attribute.String("reason", "parse_err"))
return nil, status.Errorf(codes.Internal, "can't parse thread number: %s : %v", text, err)
}
if n, err := fmt.Sscanf(fields[3], "0x%x", &stack.ThreadId); n != 1 || err != nil {
recorder.CounterOrLog(ctx, processGetStacksFailureCounter, 1, attribute.String("reason", "parse_err"))
return nil, status.Errorf(codes.Internal, "can't parse thread id: %s : %v", text, err)
if fields[2] == "(Thread" && len(fields) >= 6 {
if n, err := fmt.Sscanf(fields[3], "0x%x", &stack.ThreadId); n != 1 || err != nil {
recorder.CounterOrLog(ctx, processGetStacksFailureCounter, 1, attribute.String("reason", "parse_err"))
return nil, status.Errorf(codes.Internal, "can't parse thread id: %s : %v", text, err)
}
if n, err := fmt.Sscanf(fields[5], "%d", &stack.Lwp); n != 1 || err != nil {
recorder.CounterOrLog(ctx, processGetStacksFailureCounter, 1, attribute.String("reason", "parse_err"))
return nil, status.Errorf(codes.Internal, "can't parse lwp: %s : %v", text, err)
}
}
if n, err := fmt.Sscanf(fields[5], "%d", &stack.Lwp); n != 1 || err != nil {
recorder.CounterOrLog(ctx, processGetStacksFailureCounter, 1, attribute.String("reason", "parse_err"))
return nil, status.Errorf(codes.Internal, "can't parse lwp: %s : %v", text, err)
if fields[2] == "(LWP" {
if n, err := fmt.Sscanf(fields[3], "%d", &stack.Lwp); n != 1 || err != nil {
recorder.CounterOrLog(ctx, processGetStacksFailureCounter, 1, attribute.String("reason", "parse_err"))
return nil, status.Errorf(codes.Internal, "can't parse lwp: %s : %v", text, err)
}
}
numEntries++
continue
Expand Down
Loading
Loading