Stack smashing detected

Since a couple of weeks ago, all (my) snap builds produce a package that SIGSEV. Even a --shell run fails. I can’t see how my binary can cause this. In fact, the binary works if I run it unconfined.
I tried to build using no-patchelf but the misbehavior was not fixed.

Funny facts

  • if I run the binary unconfined (e.g., /snap/john-the-ripper/current/run/john) it works.
  • even a trial run like snap run --shell john-the-ripper crashes (SIGSEV).

GDB ( snap run --shell --gdb snap-name)

Thread 1 "snap-gdb-shim" received signal SIGSEGV, Segmentation fault.
0x00007f0f55b4ec37 in __libc_start_main () from target:/snap/john-the-ripper/385/lib/x86_64-linux-gnu/
Catchpoint 1 (exec)

Is the source recipe available for reproducing the problem?

You can find it here:

Latest build:

It is a bug in snap itself. I reverted to Xenial and it works ( snapcraft.yaml base: core16 building on Launchpad Series: Ubuntu Xenial).

How I tested:

  • Today I tested the unpatched recipe, it failed with the same error.
  • Then, I reverted to Xenial (see above), and it works fine (I released in channel edge and tested locally).