Memmove causing program crashes, giving SIGTRAP in GDB(?)

Glenn Strauss gs-cygwin.com@gluelogic.com
Thu Feb 26 10:49:50 GMT 2026


On Thu, Feb 26, 2026 at 02:06:18AM -0800, KENNON J CONRAD wrote:
> Yes, movsq requires addess alignment.  Memmove however is not supposed to require alignment as it should work for chars, ints, etc.  It should handle alignment requirements before calling movsq.  That is something I want to verify.

Yes, this should be handled by memmove(), but I encourage verification
of assumptions.  If the code is supposed to be aligned due to default
natural alignment, inlining of memmove() might optimize on that
information (although it shouldn't if you compile -O0)

If sanitizer is available, you can try compiling with
  -fsanitize=alignment

Cheers, Glenn


More information about the Cygwin mailing list