Git Product home page Git Product logo

tigerbeetle-go's Introduction

tigerbeetle-go's People

Contributors

barnarddt avatar batiati avatar cb22 avatar donchangfoot avatar eatonphil avatar jorangreef avatar kprotty avatar matdehaast avatar sentientwaffle avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tigerbeetle-go's Issues

Bad pointer in Go heap

After a bunch of inserts, I receive the following:

runtime: pointer 0x14000864000 to unused region of span span.base()=0x140003b2000 span.limit=0x140003b3fe0 span.state=1
fatal error: found bad pointer in Go heap (incorrect use of unsafe or cgo?)

runtime stack:
runtime.throw({0x100f702e2?, 0x100bb6184?})
	/opt/homebrew/Cellar/go/1.18.2/libexec/src/runtime/panic.go:992 +0x50 fp=0x16f39ad30 sp=0x16f39ad00 pc=0x100bae950
runtime.badPointer(0x12862fb90, 0x100b9a590?, 0x0, 0x1?)
	/opt/homebrew/Cellar/go/1.18.2/libexec/src/runtime/mbitmap.go:368 +0x120 fp=0x16f39ad80 sp=0x16f39ad30 pc=0x100b8f770
runtime.findObject(0x16f39ae58?, 0x100b99d88?, 0x1400064c7e0?)
	/opt/homebrew/Cellar/go/1.18.2/libexec/src/runtime/mbitmap.go:410 +0xb4 fp=0x16f39adc0 sp=0x16f39ad80 pc=0x100b8f8d4
runtime.wbBufFlush1(0x14000042a00)
	/opt/homebrew/Cellar/go/1.18.2/libexec/src/runtime/mwbbuf.go:260 +0xec fp=0x16f39ae20 sp=0x16f39adc0 pc=0x100baa1ec
runtime.wbBufFlush.func1()
	/opt/homebrew/Cellar/go/1.18.2/libexec/src/runtime/mwbbuf.go:201 +0x28 fp=0x16f39ae40 sp=0x16f39ae20 pc=0x100baa038
runtime.wbBufFlush(0x14000043c38?, 0x14000043c38?)
	/opt/homebrew/Cellar/go/1.18.2/libexec/src/runtime/mwbbuf.go:200 +0x78 fp=0x16f39ae60 sp=0x16f39ae40 pc=0x100baa0c8
runtime.gcDrain(0x14000043c38, 0x3)
	/opt/homebrew/Cellar/go/1.18.2/libexec/src/runtime/mgcmark.go:1073 +0x194 fp=0x16f39aec0 sp=0x16f39ae60 pc=0x100b99d54
runtime.gcBgMarkWorker.func2()
	/opt/homebrew/Cellar/go/1.18.2/libexec/src/runtime/mgc.go:1276 +0x98 fp=0x16f39af10 sp=0x16f39aec0 pc=0x100b96c68
runtime.systemstack()
	/opt/homebrew/Cellar/go/1.18.2/libexec/src/runtime/asm_arm64.s:241 +0x6c fp=0x16f39af20 sp=0x16f39af10 pc=0x100bdb89c

goroutine 23 [GC worker (idle)]:
runtime.systemstack_switch()
	/opt/homebrew/Cellar/go/1.18.2/libexec/src/runtime/asm_arm64.s:198 +0x8 fp=0x1400005b740 sp=0x1400005b730 pc=0x100bdb818
runtime.gcBgMarkWorker()
	/opt/homebrew/Cellar/go/1.18.2/libexec/src/runtime/mgc.go:1263 +0x1dc fp=0x1400005b7d0 sp=0x1400005b740 pc=0x100b9691c
runtime.goexit()
	/opt/homebrew/Cellar/go/1.18.2/libexec/src/runtime/asm_arm64.s:1263 +0x4 fp=0x1400005b7d0 sp=0x1400005b7d0 pc=0x100bddf84
created by runtime.gcBgMarkStartWorkers
	/opt/homebrew/Cellar/go/1.18.2/libexec/src/runtime/mgc.go:1131 +0x2c

goroutine 1 [chan receive]:
runtime.gopark(0x14000775608?, 0x100ed1138?, 0xd0?, 0x44?, 0x14000775648?)
	/opt/homebrew/Cellar/go/1.18.2/libexec/src/runtime/proc.go:361 +0xe8 fp=0x140007755c0 sp=0x140007755a0 pc=0x100bb1268
runtime.chanrecv(0x14000032c60, 0x0, 0x1)
	/opt/homebrew/Cellar/go/1.18.2/libexec/src/runtime/chan.go:577 +0x580 fp=0x14000775650 sp=0x140007755c0 pc=0x100b82560
runtime.chanrecv1(0x140007756b8?, 0x100ed1fb0?)
	/opt/homebrew/Cellar/go/1.18.2/libexec/src/runtime/chan.go:440 +0x14 fp=0x14000775680 sp=0x14000775650 pc=0x100b81fa4
github.com/tigerbeetledb/tigerbeetle-go.(*c_client).doRequest(0x1400000e300, 0x4, 0x1388, 0x14000b1c000, 0x14000818000)
	/Users/nii236/go/pkg/mod/github.com/tigerbeetledb/[email protected]/tb_client.go:204 +0x1c0 fp=0x140007756c0 sp=0x14000775680 pc=0x100ed1b10
github.com/tigerbeetledb/tigerbeetle-go.(*c_client).doCreate(0x6d6254bbede5cca5?, 0x86000?, 0xae000?, 0x1388)
	/Users/nii236/go/pkg/mod/github.com/tigerbeetledb/[email protected]/tb_client.go:277 +0x68 fp=0x14000775720 sp=0x140007756c0 pc=0x100ed1fd8
github.com/tigerbeetledb/tigerbeetle-go.(*c_client).CreateTransfers(0x140001aad80?, {0x14000b1c000?, 0x16?, 0x1010b5838?})
	/Users/nii236/go/pkg/mod/github.com/tigerbeetledb/[email protected]/tb_client.go:305 +0x38 fp=0x14000775760 sp=0x14000775720 pc=0x100ed21c8
xsyn-transactions/storage.(*TigerBeetle).InsertTransactions(...)
	/Users/nii236/git/passport-server/transactions/storage/tigerbeetle.go:124
xsyn-transactions/storage.(*TigerBeetle).MigrateTransactions(0x1400000e618, 0x1388)
	/Users/nii236/git/passport-server/transactions/storage/tigerbeetle.go:201 +0x3c0 fp=0x140007758e0 sp=0x14000775760 pc=0x100ed32e0
main.RunMigrate(0x140001ea180?)
	/Users/nii236/git/passport-server/transactions/cmd/migrate/main.go:88 +0x288 fp=0x14000775a00 sp=0x140007758e0 pc=0x100f24228
github.com/urfave/cli/v2.(*App).RunContext(0x14000250000, {0x1010b8ef8?, 0x140001ac010}, {0x140001921e0, 0x1, 0x1})
	/Users/nii236/go/pkg/mod/github.com/urfave/cli/[email protected]/app.go:391 +0xb60 fp=0x14000775cc0 sp=0x14000775a00 pc=0x100f11b90
github.com/urfave/cli/v2.(*App).Run(...)
	/Users/nii236/go/pkg/mod/github.com/urfave/cli/[email protected]/app.go:252
main.main()
	/Users/nii236/git/passport-server/transactions/cmd/migrate/main.go:40 +0x874 fp=0x14000775f70 sp=0x14000775cc0 pc=0x100f23ba4
runtime.main()
	/opt/homebrew/Cellar/go/1.18.2/libexec/src/runtime/proc.go:250 +0x250 fp=0x14000775fd0 sp=0x14000775f70 pc=0x100bb0e90
runtime.goexit()
	/opt/homebrew/Cellar/go/1.18.2/libexec/src/runtime/asm_arm64.s:1263 +0x4 fp=0x14000775fd0 sp=0x14000775fd0 pc=0x100bddf84

goroutine 2 [force gc (idle)]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
	/opt/homebrew/Cellar/go/1.18.2/libexec/src/runtime/proc.go:361 +0xe8 fp=0x1400005efa0 sp=0x1400005ef80 pc=0x100bb1268
runtime.goparkunlock(...)
	/opt/homebrew/Cellar/go/1.18.2/libexec/src/runtime/proc.go:367
runtime.forcegchelper()
	/opt/homebrew/Cellar/go/1.18.2/libexec/src/runtime/proc.go:301 +0xb0 fp=0x1400005efd0 sp=0x1400005efa0 pc=0x100bb1100
runtime.goexit()
	/opt/homebrew/Cellar/go/1.18.2/libexec/src/runtime/asm_arm64.s:1263 +0x4 fp=0x1400005efd0 sp=0x1400005efd0 pc=0x100bddf84
created by runtime.init.6
	/opt/homebrew/Cellar/go/1.18.2/libexec/src/runtime/proc.go:289 +0x28

goroutine 3 [GC sweep wait]:
runtime.gopark(0x1?, 0x0?, 0x0?, 0x0?, 0x0?)
	/opt/homebrew/Cellar/go/1.18.2/libexec/src/runtime/proc.go:361 +0xe8 fp=0x1400005f770 sp=0x1400005f750 pc=0x100bb1268
runtime.goparkunlock(...)
	/opt/homebrew/Cellar/go/1.18.2/libexec/src/runtime/proc.go:367
runtime.bgsweep(0x0?)
	/opt/homebrew/Cellar/go/1.18.2/libexec/src/runtime/mgcsweep.go:297 +0x110 fp=0x1400005f7b0 sp=0x1400005f770 pc=0x100b9ebd0
runtime.gcenable.func1()
	/opt/homebrew/Cellar/go/1.18.2/libexec/src/runtime/mgc.go:177 +0x2c fp=0x1400005f7d0 sp=0x1400005f7b0 pc=0x100b943cc
runtime.goexit()
	/opt/homebrew/Cellar/go/1.18.2/libexec/src/runtime/asm_arm64.s:1263 +0x4 fp=0x1400005f7d0 sp=0x1400005f7d0 pc=0x100bddf84
created by runtime.gcenable
	/opt/homebrew/Cellar/go/1.18.2/libexec/src/runtime/mgc.go:177 +0x78

goroutine 4 [GC scavenge wait]:
runtime.gopark(0xa1a874e7676?, 0x10000?, 0xd?, 0x14?, 0x1?)
	/opt/homebrew/Cellar/go/1.18.2/libexec/src/runtime/proc.go:361 +0xe8 fp=0x1400005ff00 sp=0x1400005fee0 pc=0x100bb1268
runtime.goparkunlock(...)
	/opt/homebrew/Cellar/go/1.18.2/libexec/src/runtime/proc.go:367
runtime.bgscavenge(0x0?)
	/opt/homebrew/Cellar/go/1.18.2/libexec/src/runtime/mgcscavenge.go:364 +0x2d0 fp=0x1400005ffb0 sp=0x1400005ff00 pc=0x100b9cb30
runtime.gcenable.func2()
	/opt/homebrew/Cellar/go/1.18.2/libexec/src/runtime/mgc.go:178 +0x2c fp=0x1400005ffd0 sp=0x1400005ffb0 pc=0x100b9436c
runtime.goexit()
	/opt/homebrew/Cellar/go/1.18.2/libexec/src/runtime/asm_arm64.s:1263 +0x4 fp=0x1400005ffd0 sp=0x1400005ffd0 pc=0x100bddf84
created by runtime.gcenable
	/opt/homebrew/Cellar/go/1.18.2/libexec/src/runtime/mgc.go:178 +0xbc

goroutine 18 [finalizer wait]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
	/opt/homebrew/Cellar/go/1.18.2/libexec/src/runtime/proc.go:361 +0xe8 fp=0x1400005a590 sp=0x1400005a570 pc=0x100bb1268
runtime.goparkunlock(...)
	/opt/homebrew/Cellar/go/1.18.2/libexec/src/runtime/proc.go:367
runtime.runfinq()
	/opt/homebrew/Cellar/go/1.18.2/libexec/src/runtime/mfinal.go:177 +0xcc fp=0x1400005a7d0 sp=0x1400005a590 pc=0x100b9358c
runtime.goexit()
	/opt/homebrew/Cellar/go/1.18.2/libexec/src/runtime/asm_arm64.s:1263 +0x4 fp=0x1400005a7d0 sp=0x1400005a7d0 pc=0x100bddf84
created by runtime.createfing
	/opt/homebrew/Cellar/go/1.18.2/libexec/src/runtime/mfinal.go:157 +0x8c

goroutine 7 [select]:
runtime.gopark(0x14000060770?, 0x3?, 0x1?, 0x0?, 0x14000060752?)
	/opt/homebrew/Cellar/go/1.18.2/libexec/src/runtime/proc.go:361 +0xe8 fp=0x140000605f0 sp=0x140000605d0 pc=0x100bb1268
runtime.selectgo(0x14000060770, 0x1400006074c, 0x0?, 0x0, 0x0?, 0x1)
	/opt/homebrew/Cellar/go/1.18.2/libexec/src/runtime/select.go:328 +0x690 fp=0x14000060710 sp=0x140000605f0 pc=0x100bc0f70
github.com/jackc/pgx/v4/pgxpool.(*Pool).backgroundHealthCheck(0x140001bc1b0)
	/Users/nii236/go/pkg/mod/github.com/jackc/pgx/[email protected]/pgxpool/pool.go:428 +0xa8 fp=0x140000607b0 sp=0x14000060710 pc=0x100eb4848
github.com/jackc/pgx/v4/pgxpool.ConnectConfig.func3()
	/Users/nii236/go/pkg/mod/github.com/jackc/pgx/[email protected]/pgxpool/pool.go:283 +0x2c fp=0x140000607d0 sp=0x140000607b0 pc=0x100eb3abc
runtime.goexit()
	/opt/homebrew/Cellar/go/1.18.2/libexec/src/runtime/asm_arm64.s:1263 +0x4 fp=0x140000607d0 sp=0x140000607d0 pc=0x100bddf84
created by github.com/jackc/pgx/v4/pgxpool.ConnectConfig
	/Users/nii236/go/pkg/mod/github.com/jackc/pgx/[email protected]/pgxpool/pool.go:283 +0x3a0

goroutine 35 [GC worker (idle)]:
runtime.gopark(0xa1ab5bf98f3?, 0x3?, 0x30?, 0x76?, 0x0?)
	/opt/homebrew/Cellar/go/1.18.2/libexec/src/runtime/proc.go:361 +0xe8 fp=0x1400005af40 sp=0x1400005af20 pc=0x100bb1268
runtime.gcBgMarkWorker()
	/opt/homebrew/Cellar/go/1.18.2/libexec/src/runtime/mgc.go:1207 +0xec fp=0x1400005afd0 sp=0x1400005af40 pc=0x100b9682c
runtime.goexit()
	/opt/homebrew/Cellar/go/1.18.2/libexec/src/runtime/asm_arm64.s:1263 +0x4 fp=0x1400005afd0 sp=0x1400005afd0 pc=0x100bddf84
created by runtime.gcBgMarkStartWorkers
	/opt/homebrew/Cellar/go/1.18.2/libexec/src/runtime/mgc.go:1131 +0x2c

goroutine 34 [GC worker (idle)]:
runtime.gopark(0xa1ab5329dce?, 0x3?, 0xf0?, 0x66?, 0x100bddf84?)
	/opt/homebrew/Cellar/go/1.18.2/libexec/src/runtime/proc.go:361 +0xe8 fp=0x1400005e740 sp=0x1400005e720 pc=0x100bb1268
runtime.gcBgMarkWorker()
	/opt/homebrew/Cellar/go/1.18.2/libexec/src/runtime/mgc.go:1207 +0xec fp=0x1400005e7d0 sp=0x1400005e740 pc=0x100b9682c
runtime.goexit()
	/opt/homebrew/Cellar/go/1.18.2/libexec/src/runtime/asm_arm64.s:1263 +0x4 fp=0x1400005e7d0 sp=0x1400005e7d0 pc=0x100bddf84
created by runtime.gcBgMarkStartWorkers
	/opt/homebrew/Cellar/go/1.18.2/libexec/src/runtime/mgc.go:1131 +0x2c

goroutine 8 [GC worker (idle)]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
	/opt/homebrew/Cellar/go/1.18.2/libexec/src/runtime/proc.go:361 +0xe8 fp=0x14000060f40 sp=0x14000060f20 pc=0x100bb1268
runtime.gcBgMarkWorker()
	/opt/homebrew/Cellar/go/1.18.2/libexec/src/runtime/mgc.go:1207 +0xec fp=0x14000060fd0 sp=0x14000060f40 pc=0x100b9682c
runtime.goexit()
	/opt/homebrew/Cellar/go/1.18.2/libexec/src/runtime/asm_arm64.s:1263 +0x4 fp=0x14000060fd0 sp=0x14000060fd0 pc=0x100bddf84
created by runtime.gcBgMarkStartWorkers
	/opt/homebrew/Cellar/go/1.18.2/libexec/src/runtime/mgc.go:1131 +0x2c

goroutine 9 [GC worker (idle)]:
runtime.gopark(0xa1ab5329f1b?, 0x3?, 0xc0?, 0x64?, 0x0?)
	/opt/homebrew/Cellar/go/1.18.2/libexec/src/runtime/proc.go:361 +0xe8 fp=0x14000061740 sp=0x14000061720 pc=0x100bb1268
runtime.gcBgMarkWorker()
	/opt/homebrew/Cellar/go/1.18.2/libexec/src/runtime/mgc.go:1207 +0xec fp=0x140000617d0 sp=0x14000061740 pc=0x100b9682c
runtime.goexit()
	/opt/homebrew/Cellar/go/1.18.2/libexec/src/runtime/asm_arm64.s:1263 +0x4 fp=0x140000617d0 sp=0x140000617d0 pc=0x100bddf84
created by runtime.gcBgMarkStartWorkers
	/opt/homebrew/Cellar/go/1.18.2/libexec/src/runtime/mgc.go:1131 +0x2c

goroutine 10 [GC worker (idle)]:
runtime.gopark(0x1013791e0?, 0x1?, 0x77?, 0x47?, 0x0?)
	/opt/homebrew/Cellar/go/1.18.2/libexec/src/runtime/proc.go:361 +0xe8 fp=0x14000061f40 sp=0x14000061f20 pc=0x100bb1268
runtime.gcBgMarkWorker()
	/opt/homebrew/Cellar/go/1.18.2/libexec/src/runtime/mgc.go:1207 +0xec fp=0x14000061fd0 sp=0x14000061f40 pc=0x100b9682c
runtime.goexit()
	/opt/homebrew/Cellar/go/1.18.2/libexec/src/runtime/asm_arm64.s:1263 +0x4 fp=0x14000061fd0 sp=0x14000061fd0 pc=0x100bddf84
created by runtime.gcBgMarkStartWorkers
	/opt/homebrew/Cellar/go/1.18.2/libexec/src/runtime/mgc.go:1131 +0x2c

goroutine 36 [GC worker (idle)]:
runtime.gopark(0xa1ab5ba2f88?, 0x3?, 0x43?, 0x85?, 0x0?)
	/opt/homebrew/Cellar/go/1.18.2/libexec/src/runtime/proc.go:361 +0xe8 fp=0x1400006ef40 sp=0x1400006ef20 pc=0x100bb1268
runtime.gcBgMarkWorker()
	/opt/homebrew/Cellar/go/1.18.2/libexec/src/runtime/mgc.go:1207 +0xec fp=0x1400006efd0 sp=0x1400006ef40 pc=0x100b9682c
runtime.goexit()
	/opt/homebrew/Cellar/go/1.18.2/libexec/src/runtime/asm_arm64.s:1263 +0x4 fp=0x1400006efd0 sp=0x1400006efd0 pc=0x100bddf84
created by runtime.gcBgMarkStartWorkers
	/opt/homebrew/Cellar/go/1.18.2/libexec/src/runtime/mgc.go:1131 +0x2c

goroutine 37 [GC worker (idle)]:
runtime.gopark(0xa1a45a7244e?, 0x3?, 0xd0?, 0x0?, 0x0?)
	/opt/homebrew/Cellar/go/1.18.2/libexec/src/runtime/proc.go:361 +0xe8 fp=0x1400009cf40 sp=0x1400009cf20 pc=0x100bb1268
runtime.gcBgMarkWorker()
	/opt/homebrew/Cellar/go/1.18.2/libexec/src/runtime/mgc.go:1207 +0xec fp=0x1400009cfd0 sp=0x1400009cf40 pc=0x100b9682c
runtime.goexit()
	/opt/homebrew/Cellar/go/1.18.2/libexec/src/runtime/asm_arm64.s:1263 +0x4 fp=0x1400009cfd0 sp=0x1400009cfd0 pc=0x100bddf84
created by runtime.gcBgMarkStartWorkers
	/opt/homebrew/Cellar/go/1.18.2/libexec/src/runtime/mgc.go:1131 +0x2c
exit status 2

Go client panics after several inserts

Server output

info(io): opening "tigerbeetle"...
info(main): 0: cluster=0: listening on 127.0.0.1:3001
info(message_bus): connection from client 249371287003830220979360229150198523950
info(message_bus): peer performed an orderly shutdown: message_bus.union:375:19{ .client = 249371287003830220979360229150198523950 }

Client output

thread 172045 panic: attempt to use null value
signal: abort trap

tb_client_deinit() crashes go test on windows

Client.Close() which calls C.tb_client_deinit() generates an exit status 0xc0000374 on Windows when running .\zgo.bat test. The test successfully runs to completion up until the Close(). This causes the rest of test (cleanup callbacks) to end abruptly, leaving tigerbeetle.exe still running in the background and the cluster.tigerbeetle file still on disk.

Unable to cross compile

error(tb_client_context): 106121599110627799851073801557079129771: failed to initialize IO: SystemOutdated
thread 7 panic: attempt to unwrap error
Unwind error at address `exe:0xaa3578` (error.InvalidDebugInfo), trace may be incomplete

SIGABRT: abort
PC=0xacac33 m=0 sigcode=18446744073709551610
signal arrived during cgo execution

compile:

CC="zig cc -target x86_64-linux" CXX="zig c++ -target x86_64-linux" CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -o build/tigerbeetle_api_linux_amd64 main.go

run:

docker run --rm --platform=linux/amd64 -v .:/app --network host ubuntu sh -c 'cd /app; ./build/tigerbeetle_api_linux_amd64

expected:

The successfully compiled binary to execute on a docker ubuntu amd64 container

bug:

Error is thrown running binary

notes:

With the CC flag using zig to cross compile, I managed to compile the go program
I'm running on a M1 mac

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.