I had the same problem when creating a map file .ber with Vim. My code ran very well when I created the map with VS Code, but one of my colleagues, he tried to test my code and created a map by Vim. Boom! I got the segment fault. After many tests, I realized that Vim always unexpectedly adds a '\n' like an EOF. But VS Code doesn't. So I was so confused! Finally, I have the confirmation here in this question. Thank you so much for the question and the answers below!