I know the topic is pretty old, but since it's the only Google search query that I found when I encountered this issue.
It appears that "stack smashing" error can also be caused when GLFW window requested to be created with a bigger than the size of the screen. In my case, I was testing my LWJGL (3.3.1) app on an Ubuntu (22.04.1) VM and it was crashing at 800x600 (while the default window size in my app is 1280x720). I accidentally fixed this when I had to change the size of the screen (1600x1050) in system settings to fit IntelliJ's window. I launched the app via IntelliJ and it worked. I launched again without IntelliJ and it worked as well. I changed back the size to 800x600, it crashed again with *** stack smashing ... ***. I hope it helps someone else who would be trying out their LWJGL app in a Ubuntu VM.