Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alignment error on x86_64 [CORE5865] #6124

Closed
firebird-automations opened this issue Jul 6, 2018 · 7 comments
Closed

Alignment error on x86_64 [CORE5865] #6124

firebird-automations opened this issue Jul 6, 2018 · 7 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: @AlexPeshkoff

An issue was reported by Stephan Bergmann, LibreOffice developer.

Firebird 3.0 we build as part of LibreOffice
defines global operator new replacement functions in
src/common/classes/alloc.h (forwarding to MemoryPool) that do not in
general fulfil the alignment requirements for such functions.

The problem is when optimized code issues MOVAPS command against memory allocated with operator new.
Compiler expects 16-bytes alignment but replaced function new aligns memory only at 8-bytes boundary.

Commits: bec4b1c b17e367 69523f1

@firebird-automations
Copy link
Collaborator Author

Modified by: @AlexPeshkoff

assignee: Alexander Peshkov [ alexpeshkoff ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @AlexPeshkoff

Fix is committed into master but I do not mark an issue as resolved cause we need to decide should 16 byte alignment be used for all or not platforms and should it be backported to FB3.

@firebird-automations
Copy link
Collaborator Author

Commented by: @AlexPeshkoff

Backport to FB3 is required - it fixes release build on Mac. Yes, clang is used on it.

@firebird-automations
Copy link
Collaborator Author

Modified by: @AlexPeshkoff

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

Fix Version: 4.0 Beta 1 [ 10750 ]

Fix Version: 3.0.4 [ 10863 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

status: Resolved [ 5 ] => Resolved [ 5 ]

QA Status: No test => Cannot be tested

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

status: Resolved [ 5 ] => Closed [ 6 ]

@firebird-automations
Copy link
Collaborator Author

Commented by: Gelson Borsoi (gborsoi)

Just an info:
I changed the src/common/classes/alloc.h file in 2.5.9 source like this:

Original code:
Line 94 // Alignment for all memory blocks. Sizes of memory blocks in headers are measured in this units
Line 95 const size_t ALLOC_ALIGNMENT = FB_ALIGNMENT;

Changed code:
Line 94 // Alignment for all memory blocks. Sizes of memory blocks in headers are measured in this units
Line 95 #⁠define ALLOC_ALIGNMENT 16

And now Firebird 2.5.9 on FreeBSD 12.1 and 13 beta4 amd64, compiled with clang 8 and 11, works without core dumps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment