Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2015-06

Printing to PDF on Mac crashes due to unaligned MOVDQA

2 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Martin Grajcar

My trivial Lazarus 1.4 application crashes whenever it prints a TBitMap on MAC. In _platform_memmove$VARIANT$sse4 it tries to execute MOVDQA (Move Aligned Double Quadword) with an unaligned address.

I'd call it a bug as fpc uses unaligned addresses while the system(?) library does not. I need to fix it somehow... and know just a little about OSX. For more details see http://stackoverflow.com/q/30923914/581205

It's similar to http://bugs.freepascal.org/view.php?id=25920, but here I don't even know what library is the culprit.

Regards, Martin.

Reply by email

Jonas Maebe
to Martin Grajcar
Martin Grajcar wrote 6 lines
My trivial Lazarus 1.4 application crashes whenever it prints a TBitMap on MAC. In _platform_memmove$VARIANT$sse4 it tries to execute MOVDQA (Move Aligned Double Quadword) with an unaligned address. I'd call it a bug as fpc uses unaligned addresses while the system(?) library does not.

memmove is a system library function, and is responsible for aligning memory addresses if it uses movdqa on them. The problem is most likely not that it is loading from an unaligned address, but from an invalid address (which will presumably be aligned, as the logic in that routine will align addresses before trying to access them with movdqa).

I need to fix it somehow... and know just a little

about OSX.

The problem is unrelated to OS X. It's a bug either in your program or in the LCL, that just coincidentally happens to manifest itself inside that system routine.

Jonas

Reply by email