bids-validator icon indicating copy to clipboard operation
bids-validator copied to clipboard

ENOBUFS when calling bin/bids-validator outside of project.

Open rwblair opened this issue 3 years ago • 2 comments

Not sure if its an issue with my setup or something else. Happened while testing microscopy PR #1359. If I called bin/bids-validator with an absolute path while outside of the bids-validator package directory it would fail with an ENOBUFS error number. Default esbuild buffer is 16mb. I doubled it to 32 and the call succeeded. Environment variable I set: export ESBUILD_MAX_BUFFER=33554432

rwblair avatar Jan 04 '22 18:01 rwblair

Looking at #1359, it reads the TIFF into memory and creates a duplicate copy to validate the TIFF header. In the browser this is probably okay (ArrayBuffer works with shallow copies) but it could run into heap limits or buffer issues like this on Node. Looks like it could instead read the first part of the file and still do all the later validation, that might be a good fix.

nellh avatar Jan 04 '22 19:01 nellh

Thanks @nellh I'll add that to my review.

I did a fresh clone and install and couldn't recreate, figure its good to leave a trace of this fix somewhere since I didn't find too much online.

rwblair avatar Jan 04 '22 19:01 rwblair