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

signal SIGSEGV: segmentation violation while connecting to Trino on Macbook #2046

Closed
donboschov opened this issue Aug 16, 2023 · 1 comment · Fixed by #2177
Closed

signal SIGSEGV: segmentation violation while connecting to Trino on Macbook #2046

donboschov opened this issue Aug 16, 2023 · 1 comment · Fixed by #2177
Labels
bug waiting for upstream Blocked on changes needed in an upstream dependency

Comments

@donboschov
Copy link

donboschov commented Aug 16, 2023

I am running into following error while using Benthos to write data into Trino on my Macbook. This error comes even when Trino server is stopped.

Benthos Version: 4.18.0
Trino CLI 412
Homebrew 4.1.5
macbook pro 2019 Intel
Macos 12.0.1

INFO Listening for HTTP requests at: http://0.0.0.0:4195/  @service=benthos
INFO Consuming from file 'input_data/my_local_events_limited.json'  @service=benthos label="" path=root.input
INFO Launching a benthos instance, use CTRL+C to close  @service=benthos
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x98 pc=0x1030c6ebe]

goroutine 92 [running]:
github.com/trinodb/trino-go-client/trino.(*driverStmt).CheckNamedValue(0x1036e64c0?, 0xc000490550)
        /Users/brew/Library/Caches/Homebrew/go_mod_cache/pkg/mod/github.com/trinodb/[email protected]/trino/trino.go:632 +0xde
database/sql.driverArgsConnLocked({0x104babc60, 0xc000001380}, 0xc001a0f760, {0xc0001ce100, 0xf, 0xc000814140?})
        /usr/local/Cellar/go/1.20.5/libexec/src/database/sql/convert.go:178 +0x5d4
database/sql.resultFromStatement({0x104bb1110, 0xc000814140}, {0x104babc60, 0xc000001380}, 0xc001a0f760, {0xc0001ce100, 0xf, 0x10})
        /usr/local/Cellar/go/1.20.5/libexec/src/database/sql/sql.go:2630 +0x10b
database/sql.(*DB).execDC(0xc000145801?, {0x104bb1110, 0xc000814140}, 0xc0017230e0, 0x10860ae68?, {0xc0001d30e0, 0x91}, {0xc0001ce100, 0xf, 0x10})
        /usr/local/Cellar/go/1.20.5/libexec/src/database/sql/sql.go:1694 +0x473
database/sql.(*DB).exec(0xc000145930?, {0x104bb1110, 0xc000814140}, {0xc0001d30e0, 0x91}, {0xc0001ce100, 0xf, 0x10}, 0x48?)
        /usr/local/Cellar/go/1.20.5/libexec/src/database/sql/sql.go:1655 +0xe8
database/sql.(*DB).ExecContext.func1(0x78?)
        /usr/local/Cellar/go/1.20.5/libexec/src/database/sql/sql.go:1634 +0x55
database/sql.(*DB).retry(0xc0001d30e0?, 0xc001a0f9d0)
        /usr/local/Cellar/go/1.20.5/libexec/src/database/sql/sql.go:1538 +0x47
database/sql.(*DB).ExecContext(0x0?, {0x104bb1110?, 0xc000814140?}, {0xc0001d30e0?, 0xf?}, {0xc0001ce100?, 0xc000001200?, 0xc0001ce100?})
        /usr/local/Cellar/go/1.20.5/libexec/src/database/sql/sql.go:1633 +0xcc
github.com/Masterminds/squirrel.ExecContextWith({0x104bb1110, 0xc000814140}, {0x1103f9158, 0xc0004938e0}, {0x104b78420?, 0xc000001140?})
        /Users/brew/Library/Caches/Homebrew/go_mod_cache/pkg/mod/github.com/!masterminds/[email protected]/squirrel_ctx.go:77 +0x82
github.com/Masterminds/squirrel.(*insertData).ExecContext(0xc000001140, {0x104bb1110, 0xc000814140})
        /Users/brew/Library/Caches/Homebrew/go_mod_cache/pkg/mod/github.com/!masterminds/[email protected]/insert_ctx.go:20 +0x76
github.com/Masterminds/squirrel.InsertBuilder.ExecContext({{0x104bd0cc0, 0xc001ceca80}}, {0x104bb1110, 0xc000814140})
        /Users/brew/Library/Caches/Homebrew/go_mod_cache/pkg/mod/github.com/!masterminds/[email protected]/insert_ctx.go:51 +0x12b
github.com/benthosdev/benthos/v4/internal/impl/sql.(*sqlInsertOutput).WriteBatch(0xc0006a7100, {0x104bb1110, 0xc000814140}, {0xc0021db0e0, 0x5, 0x5})
        /private/tmp/benthos-20230702-4308-1vq034w/benthos-4.18.0/internal/impl/sql/output_sql_insert.go:264 +0x745
github.com/benthosdev/benthos/v4/public/service.(*airGapBatchWriter).WriteBatch(0xc0021df370, {0x104bb1110, 0xc000814140}, {0xc00075e500, 0x5, 0x8})
        /private/tmp/benthos-20230702-4308-1vq034w/benthos-4.18.0/public/service/output.go:120 +0xdd
github.com/benthosdev/benthos/v4/internal/component/output.(*AsyncWriter).latencyMeasuringWrite(0xc0006a7700, {0x104bb1110, 0xc000814140}, {0xc00075e500, 0x5, 0x8})
        /private/tmp/benthos-20230702-4308-1vq034w/benthos-4.18.0/internal/component/output/async_writer.go:86 +0x90
github.com/benthosdev/benthos/v4/internal/component/output.(*AsyncWriter).loop.func4()
        /private/tmp/benthos-20230702-4308-1vq034w/benthos-4.18.0/internal/component/output/async_writer.go:228 +0x3c6
created by github.com/benthosdev/benthos/v4/internal/component/output.(*AsyncWriter).loop
        /private/tmp/benthos-20230702-4308-1vq034w/benthos-4.18.0/internal/component/output/async_writer.go:266 +0x6c5```
@mihaitodor
Copy link
Collaborator

mihaitodor commented Aug 16, 2023

It can be reproduced with this config:

input:
  generate:
    mapping: root = ""
    interval: 0s
    count: 1

output:
  sql_insert:
    driver: "trino"
    dsn: http://localhost:8080
    table: foo
    columns: ["foo"]
    args_mapping: root = [ null ]

Looks to me like they're not handling nulls correctly in their driver so someone needs to open a bug upstream (if there isn't one already).

LE: I raised an issue here: trinodb/trino-go-client#87

LE2: It's being tracked as part of trinodb/trino-go-client#84

@Jeffail Jeffail added bug waiting for upstream Blocked on changes needed in an upstream dependency labels Aug 17, 2023
mihaitodor added a commit that referenced this issue Oct 20, 2023
Fixes #2046.

Signed-off-by: Mihai Todor <[email protected]>
mihaitodor added a commit that referenced this issue Oct 20, 2023
Fixes #2046.

Signed-off-by: Mihai Todor <[email protected]>
peczenyj pushed a commit to peczenyj/connect that referenced this issue Oct 30, 2023
Fixes redpanda-data#2046.

Signed-off-by: Mihai Todor <[email protected]>
Signed-off-by: Tiago Peczenyj <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug waiting for upstream Blocked on changes needed in an upstream dependency
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants