rogchap / wombat

Cross platform gRPC client
MIT License
1.39k stars 52 forks source link

crash with stack overflow right after UI loads #67

Open rkrmr33 opened 3 years ago

rkrmr33 commented 3 years ago

Hey, for some reason after I made some changes to my protos Wombat started to crash right after the UI comes up.

The error I'm seeing in the console:

fatal error: stack overflow

runtime stack:
runtime.throw(0x4a17f2e, 0xe)
    /Users/runner/hostedtoolcache/go/1.16.3/x64/src/runtime/panic.go:1117 +0x72
runtime.newstack()
    /Users/runner/hostedtoolcache/go/1.16.3/x64/src/runtime/stack.go:1069 +0x7ed
runtime.morestack()
    /Users/runner/hostedtoolcache/go/1.16.3/x64/src/runtime/asm_amd64.s:458 +0x8f

goroutine 102 [running]:
runtime.heapBitsSetType(0xc050f0c300, 0x80, 0x80, 0x49c5ca0)
    /Users/runner/hostedtoolcache/go/1.16.3/x64/src/runtime/mbitmap.go:815 +0xc05 fp=0xc02ca003c0 sp=0xc02ca003b8 pc=0x401ab05
runtime.mallocgc(0x80, 0x49c5ca0, 0x1, 0x80015a4150)
    /Users/runner/hostedtoolcache/go/1.16.3/x64/src/runtime/malloc.go:1096 +0x5c5 fp=0xc02ca00448 sp=0xc02ca003c0 pc=0x4011265
runtime.growslice(0x49c5ca0, 0x0, 0x0, 0x0, 0x1, 0xc02ca00520, 0x90015a4430, 0x0)
    /Users/runner/hostedtoolcache/go/1.16.3/x64/src/runtime/slice.go:230 +0x1e9 fp=0xc02ca004b0 sp=0xc02ca00448 pc=0x4052069
wombat/internal/app.fieldViewsFromDesc(0x4da7c28, 0xc000431b08, 0xc000431b00, 0xc04c9ff630, 0x0, 0xc02ca00700, 0x422a5a5, 0xc000446ea0, 0x4dad200)
    /Users/runner/work/wombat/wombat/internal/app/api.go:707 +0x43f fp=0xc02ca006b0 sp=0xc02ca004b0 pc=0x4763aff
wombat/internal/app.messageViewFromDesc(0x4dad278, 0xc000446ea0, 0xc04c9ff630, 0xc00022cff0, 0x1, 0xc050f0c280)
    /Users/runner/work/wombat/wombat/internal/app/api.go:627 +0x125 fp=0xc02ca00710 sp=0xc02ca006b0 pc=0x4763305
wombat/internal/app.fieldViewsFromDesc(0x4da7c28, 0xc00029cc08, 0xc00029cc00, 0xc04c9ff630, 0x0, 0xc02ca00960, 0x422a5a5, 0xc00023a1a0, 0x4dad200)
    /Users/runner/work/wombat/wombat/internal/app/api.go:699 +0x4e5 fp=0xc02ca00910 sp=0xc02ca00710 pc=0x4763ba5
wombat/internal/app.messageViewFromDesc(0x4dad278, 0xc00023a1a0, 0xc04c9ff630, 0xc00022d0e0, 0x2, 0xc050f0a700)
.
.
.
wombat/internal/app.fieldViewsFromDesc(0x4da7c28, 0xc00029cc08, 0xc00029cc00, 0xc04c9ff630, 0x0, 0xc02ca07900, 0x422a5a5, 0xc00023a1a0, 0x4dad200)
    /Users/runner/work/wombat/wombat/internal/app/api.go:699 +0x4e5 fp=0xc02ca078b0 sp=0xc02ca076b0 pc=0x4763ba5
...additional frames elided...

My protos:

syntax = "proto3";
package spinci;
option go_package = "github.com/spin-ci/spind/pkg/proto";

import "pkg/proto/task.proto";
import "pkg/proto/runtime.proto";

import "google/protobuf/empty.proto";
import "google/protobuf/timestamp.proto";

service DaemonService {
    rpc Version(google.protobuf.Empty) returns (VersionResponse);

    rpc ExecTask(ExecTaskRequest) returns (ExecTaskResponse);

    rpc GetLogs(GetLogsRequest) returns (stream GetLogsResponse);
}

message VersionResponse {
    string daemon_version = 1;
    string runtime_type = 2;
    oneof runtime {
        DockerMachineInfo docker_machine = 3;
        DockerNativeInfo docker_native = 4;
    }
}

message ExecTaskRequest {
    Task task = 1;
}

message ExecTaskResponse {
    string id = 1;
}

message GetLogsRequest {
    string id = 1;
    bool follow = 2;
    bool timestamps = 3;
    bool stderr = 4;
}

message GetLogsResponse {
    bytes data = 1;
    Stream stream = 2;
    google.protobuf.Timestamp timestamp = 3;
}

enum Stream {
    OUT = 0;
    ERR = 1;
    IN = 2;
}

message Metadata {
    string id = 1;
    google.protobuf.Timestamp created_at = 2;
}

message DockerMachineInfo {
    string driver = 1;
    int64 mem = 2;
    int32 cpu = 3;
    string kernel_version = 4;
    string engine_version = 5;
    string engine_os_arch = 6;
    string client_version = 7;
    string client_os_arch = 8;
}

message DockerNativeInfo {
    string kernel_version = 1;
    string engine_version = 2;
    string engine_os_arch = 3;
    string client_version = 4;
    string client_os_arch = 5;
}

enum TaskState {
    UNKNOWN = 0;
    CREATED = 1;
    RUNNING = 2;
    SUCCESS = 3;
    ERROR = 4;
}

message Task {
    Metadata metadata = 1;
    TaskSpec spec = 2;
    TaskStatus status = 3;
}

message TaskSpec {
    string image = 1;
    string command = 2;
    repeated string args = 3;
    repeated string env = 4;
}

message TaskStatus {
    TaskState state = 1;
    google.protobuf.Timestamp from = 2;
}