Skip to content

Commit

Permalink
Use only one thread when reading trailer as a workaround to avoid lea…
Browse files Browse the repository at this point in the history
…king goroutines during fuzzing.
  • Loading branch information
jamii committed Oct 30, 2023
1 parent 0667645 commit 98a24a8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion vng/object.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ func (o *Object) newSectionReader(level int, sectionOff int64) *zngio.Reader {
off += sectionOff
len -= sectionOff
reader := io.NewSectionReader(o.readerAt, off, len)
return zngio.NewReader(o.zctx, reader)
return zngio.NewReaderWithOpts(o.zctx, reader, zngio.ReaderOpts{Threads: 1})
}

func (o *Object) NewReassemblyReader() *zngio.Reader {
Expand Down
2 changes: 1 addition & 1 deletion zio/zngio/trailer.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ func findCandidate(b []byte, off int) int {
}
}
func readTrailer(b []byte) *zed.Value {
val, _ := NewReader(zed.NewContext(), bytes.NewReader(b)).Read()
val, _ := NewReaderWithOpts(zed.NewContext(), bytes.NewReader(b), ReaderOpts{Threads: 1}).Read()
return val
}

Expand Down

0 comments on commit 98a24a8

Please sign in to comment.