Skip to content
This repository has been archived by the owner on Aug 22, 2022. It is now read-only.

Segmentation violation at parse.go:22 on some specific system configurations #54

Closed
moqmar opened this issue Dec 16, 2019 · 2 comments
Closed

Comments

@moqmar
Copy link
Contributor

moqmar commented Dec 16, 2019

It almost seems like a resurrection of this Go issue from 2017, but I have a problem where parse.go:22 panics with unexpected fault address 0x... - fatal error: fault - [signal SIGSEGV: segmentation violation ...]. But, I could only reproduce this on an embedded ARM device running a custom Yocto Project linux distribution. Running the program multiple times leads to multiple different error messages (one time it even worked flawlessly ¯\_(ツ)_/¯).

For debugging purposes, I added fmt.Printf("RegExp: %+v\n", pathrx) just above that line, yielding in most cases the weird message RegExp: %!v(PANIC=String method: runtime error: growslice: cap out of range), and in other cases just RegExp: :
image

The bad news: I have no idea how to even start with debugging something like this, or even how to test with different Go versions in Yocto without breaking stuff. So, this could very well already be fixed upstream, but still is a huge problem in my case.
The good news: there seems to be a simple workaround for which I'll be opening a PR if you don't mind - just shifting the initialization of the regular expression inside the function is enough to stop this bug from happening.

@moqmar
Copy link
Contributor Author

moqmar commented Dec 16, 2019

Just saw #50, I'll try if it fixes this issue.
Edit: nope, doesn't fix it. Should I take the issue to gobuffalo/here then?

markbates added a commit that referenced this issue Dec 17, 2019
Provide workaround for segmentation fault (fixes #54)
@markbates
Copy link
Owner

@moqmar thanks. if you could fix it at gobuffalo/here, that would be great. I need to get back to making #50 pass the tests. thanks for the reminder.

moqmar added a commit to moqmar/here that referenced this issue Jan 20, 2020
This fixes a weird platform-specific issue. See markbates/pkger#54 for more details.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants