Skip to content

SEGSEGV during goroutine switch while utils.int32MaxMinAVX2 is running #279

@GeneTinderholm

Description

@GeneTinderholm

Describe the bug, including details regarding any error messages, version, and platform.

I'm using this library to parse individual columns out of parquet files that have a dynamic schema into a struct of arrays.

This library works really nicely for that, and the examples + some debugging were enough for me to use the parquet package.

I ran into an issue, however. I had several runtime exits that seem to happen when goroutine switches happened while utils.int32MaxMinAVX2 is running. I gave the underlying assembly function (convenience link) a once over and it seemed fine. Thought it might be the lack of NOSPLIT, but it seems like you're not actually using anything on the stack save for the function arguments.

I'm only seeing this on linux/amd64, but without a way to consistently trigger switches while the function is running, I wouldn't bet my life that it's the only place this is happening.

I managed to get around it with a runtime.LockOSThread call, and that seems to have solved the issue for now. There's not a lot of documentation in that package that I could find. I was wondering if this implied I was doing something wrong.

I've included a cleaned stack trace of what I'm getting whenever this happens, it always seems to be during an IsValid call.

SIGSEGV: segmentation violation
PC=0x4794ec m=23 sigcode=128 addr=0x0

goroutine 0 gp=0xc0034c5880 m=23 mp=0xc000680e08 [idle]:
runtime.fpTracebackPCs(...)
	/usr/local/go/src/runtime/tracestack.go:258
runtime.traceStack(0xc000680e08?, 0x2?, 0x210)
	/usr/local/go/src/runtime/tracestack.go:116 +0x2ac fp=0x7f2a0ee9bcb8 sp=0x7f2a0ee9b850 pc=0x4794ec
runtime.traceLocker.stack(...)
	/usr/local/go/src/runtime/traceevent.go:176
runtime.traceLocker.GoStop({0xc000680e08?, 0x7f2a0ee9bdb8?}, 0x2)
	/usr/local/go/src/runtime/traceruntime.go:478 +0x85 fp=0x7f2a0ee9bd40 sp=0x7f2a0ee9bcb8 pc=0x4786c5
runtime.traceLocker.GoPreempt(...)
	/usr/local/go/src/runtime/traceruntime.go:473
runtime.goschedImpl(0xc000606a80, 0x1?)
	/usr/local/go/src/runtime/proc.go:4117 +0x7a fp=0x7f2a0ee9bda8 sp=0x7f2a0ee9bd40 pc=0x4555fa
runtime.gopreempt_m(0xc000606a80?)
	/usr/local/go/src/runtime/proc.go:4153 +0x18 fp=0x7f2a0ee9bdc8 sp=0x7f2a0ee9bda8 pc=0x455b98
runtime.mcall()
	/usr/local/go/src/runtime/asm_amd64.s:459 +0x4e fp=0x7f2a0ee9bde0 sp=0x7f2a0ee9bdc8 pc=0x49014e

goroutine 2995994 gp=0xc000606a80 m=23 mp=0xc000680e08 [running]:
runtime.asyncPreempt2()
	/usr/local/go/src/runtime/preempt.go:308 +0x39 fp=0xc00248d478 sp=0xc00248d458 pc=0x44b499
runtime.asyncPreempt()
	/usr/local/go/src/runtime/preempt_amd64.s:53 +0xdb fp=0xc00248d600 sp=0xc00248d478 pc=0x4936fb
github.com/apache/arrow-go/v18/internal/utils.int32MaxMinAVX2({0xc011aee45c?, 0x4?, 0x1b1fe00?})
	/github/home/go/pkg/mod/github.com/apache/arrow-go/v18@v18.1.0/internal/utils/min_max_avx2_amd64.go:64 +0x4a fp=0xc00248d638 sp=0xc00248d600 pc=0x168f10a
github.com/apache/arrow-go/v18/internal/utils.GetMinMaxInt32(...)
	/github/home/go/pkg/mod/github.com/apache/arrow-go/v18@v18.1.0/internal/utils/min_max.go:190
github.com/apache/arrow-go/v18/parquet/internal/encoding.(*Float64DictConverter).IsValid(0xc001980ab0, {0xc011aee45c, 0x1, 0x1})
	/github/home/go/pkg/mod/github.com/apache/arrow-go/v18@v18.1.0/parquet/internal/encoding/typed_encoder.gen.go:1176 +0x38 fp=0xc00248d668 sp=0xc00248d638 pc=0x182f0d8
github.com/apache/arrow-go/v18/parquet/internal/utils.(*RleDecoder).GetBatchWithDictFloat64(0xc015c04240, {0x227e748, 0xc001980ab0}, {0xc004692000, 0xa60, 0x1000})
	/github/home/go/pkg/mod/github.com/apache/arrow-go/v18@v18.1.0/parquet/internal/utils/typed_rle_dict.gen.go:957 +0x266 fp=0xc00248d6f0 sp=0xc00248d668 pc=0x174d3e6
github.com/apache/arrow-go/v18/parquet/internal/utils.(*RleDecoder).GetBatchWithDict(0x260?, {0x227e748?, 0xc001980ab0?}, {0x1ac41e0?, 0xc00248d798?})
	/github/home/go/pkg/mod/github.com/apache/arrow-go/v18@v18.1.0/parquet/internal/utils/rle.go:421 +0x90 fp=0xc00248d748 sp=0xc00248d6f0 pc=0x1746a70
github.com/apache/arrow-go/v18/parquet/internal/encoding.(*dictDecoder).decode(...)
	/github/home/go/pkg/mod/github.com/apache/arrow-go/v18@v18.1.0/parquet/internal/encoding/decoder.go:146
github.com/apache/arrow-go/v18/parquet/internal/encoding.(*DictFloat64Decoder).Decode(0xc001524300, {0xc004692000?, 0xf3b?, 0x1?})
	/github/home/go/pkg/mod/github.com/apache/arrow-go/v18@v18.1.0/parquet/internal/encoding/typed_encoder.gen.go:1117 +0x67 fp=0xc00248d7c0 sp=0xc00248d748 pc=0x182ec27
github.com/apache/arrow-go/v18/parquet/file.(*Float64ColumnChunkReader).ReadBatch.func1(0xc002090480?, 0x1000?)
	/github/home/go/pkg/mod/github.com/apache/arrow-go/v18@v18.1.0/parquet/file/column_reader_types.gen.go:195 +0xe7 fp=0xc00248d808 sp=0xc00248d7c0 pc=0x1869827
github.com/apache/arrow-go/v18/parquet/file.(*columnChunkReader).readBatch(0xc002090480, 0x1000, {0xc00248f988, 0x1000, 0x1000}, {0xc00248d988, 0x1000, 0x1000}, 0xc00248d8f8)
	/github/home/go/pkg/mod/github.com/apache/arrow-go/v18@v18.1.0/parquet/file/column_reader.go:513 +0xc2 fp=0xc00248d8b0 sp=0xc00248d808 pc=0x1867f22
github.com/apache/arrow-go/v18/parquet/file.(*Float64ColumnChunkReader).ReadBatch(0x0?, 0x0?, {0xc004692000?, 0x0?, 0x0?}, {0xc00248f988?, 0x0?, 0x0?}, {0xc00248d988, 0x1000, ...})
	/github/home/go/pkg/mod/github.com/apache/arrow-go/v18@v18.1.0/parquet/file/column_reader_types.gen.go:194 +0x7d fp=0xc00248d930 sp=0xc00248d8b0 pc=0x18696dd

Component(s)

Parquet

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type: bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions