editorconfig-checker.javascript icon indicating copy to clipboard operation
editorconfig-checker.javascript copied to clipboard

Runtime error under alpine linux

Open NikolayFrantsev opened this issue 4 years ago • 2 comments

Hey, I'm trying to run editorconfig-checker.javascript in my CI under alpine docker image.

Simplified Dockerfile example:

FROM node:16-alpine

RUN yarn add editorconfig-checker
RUN node_modules/.bin/editorconfig-checker

Docker run command:

docker build -t editorconfig-issue .

Unfortunatelly process fails with following error message:

#6 2.474 panic: runtime error: invalid memory address or nil pointer dereference
#6 2.474 [signal SIGSEGV: segmentation violation code=0x1 addr=0x28 pc=0x698912]
#6 2.474 
#6 2.474 goroutine 1 [running]:
#6 2.474 github.com/editorconfig-checker/editorconfig-checker/pkg/files.GetFiles.func2(0xc000411270, 0xd, 0x0, 0x0, 0x7a9700, 0xc000075b60, 0x0, 0x0)
#6 2.474 	/home/maex/projects/own/editorconfig-checker/editorconfig-checker/pkg/files/files.go:103 +0x52
#6 2.474 path/filepath.walk(0xc0004111e0, 0xb, 0x7af8e0, 0xc00007fd40, 0xc0000d9c90, 0x0, 0x0)
#6 2.474 	/home/maex/.asdf/installs/golang/1.13.3/go/src/path/filepath/path.go:378 +0x20c
#6 2.474 path/filepath.walk(0xc000458ae8, 0x8, 0x7af8e0, 0xc000301d40, 0xc0000d9c90, 0x0, 
#6 2.474 0x0)
#6 2.474 	/home/maex/.asdf/installs/golang/1.13.3/go/src/path/filepath/path.go:382 +0x2ff
#6 2.474 path/filepath.walk(0xc000370a30, 0x5, 0x7af8e0, 0xc000375ee0, 0xc0000d9c90, 0x0, 0x0)
#6 2.474 	/home/maex/.asdf/installs/golang/1.13.3/go/src/path/filepath/path.go:382 +0x2ff
#6 2.474 path/filepath.walk(0xc00001600b, 0x1, 0x7af8e0, 0xc00007fc70, 0xc0000d9c90, 0x0, 0x0)
#6 2.474 	/home/maex/.asdf/installs/golang/1.13.3/go/src/path/filepath/path.go:382 +0x2ff
#6 2.474 path/filepath.Walk(0xc00001600b, 0x1, 0xc000061c90, 0x0, 0x7a9740)
#6 2.474 	/home/maex/.asdf/installs/golang/1.13.3/go/src/path/filepath/path.go:404 +0xff
#6 2.474 github.com/editorconfig-checker/editorconfig-checker/pkg/files.GetFiles(0x0, 0x7405e9, 0x5, 0x0, 0x0, 0x0, 0x9bb348, 0x0, 0x0, 0x9930a0, ...)
#6 2.474 	/home/maex/projects/own/editorconfig-checker/editorconfig-checker/pkg/files/files.go:102 +0x55a
#6 2.474 main.main()
#6 2.474 	/home/maex/projects/own/editorconfig-checker/editorconfig-checker/cmd/editorconfig-checker/main.go:107 +0x2e7
#6 2.474 

Any ideas to deal with that?

NikolayFrantsev avatar Aug 31 '21 11:08 NikolayFrantsev

The error happens on the core not the javascript wrapper. You could try to use a release directly and see if the error still happens.

https://github.com/editorconfig-checker/editorconfig-checker/releases

Here is also a Dockerfile https://github.com/editorconfig-checker/editorconfig-checker/blob/master/Dockerfile

mstruebing avatar Aug 31 '21 11:08 mstruebing

I can confirm same problem with following Dockerfile:

FROM node:16-alpine

RUN apk add curl tar

RUN curl -L https://github.com/editorconfig-checker/editorconfig-checker/releases/download/2.3.5/ec-linux-amd64.tar.gz > ec.tar.gz
RUN tar -xf ec.tar.gz

RUN bin/ec-linux-amd64

NikolayFrantsev avatar Aug 31 '21 12:08 NikolayFrantsev