#At bzr+ssh://bk-internal.mysql.com/bzrroot/server/mysql-6.0-falcon/
2692 Olav Sandstaa 2008-06-06
Fix to one of the memory alignment issues in Bug#36745 falcon crash on solaris
The problem was a memory alignment issue in SymbolManager.cpp that caused
a crash when running in 64 bit mode on Solaris on SPARC. Fixed this
by ensuring the symbol objects are allocated at 8 byte boundaries
when compiling for 64 bit systems.
modified:
storage/falcon/SymbolManager.cpp
per-file comments:
storage/falcon/SymbolManager.cpp
Allocate symbol object with 4 or 8 byte allignement depending on the build being for
32 bit or 64 bit architectures.
=== modified file 'storage/falcon/SymbolManager.cpp'
--- a/storage/falcon/SymbolManager.cpp 2007-09-20 15:44:25 +0000
+++ b/storage/falcon/SymbolManager.cpp 2008-06-06 12:34:19 +0000
@@ -124,7 +124,9 @@
sync.unlock();
sync.lock (Exclusive);
- symbol = (Symbol*) ((IPTR)(next + 3) & ~3);
+
+ // Allocate space for the new symbol with necessary address alignment
+ symbol = (Symbol*) (ROUNDUP(((IPTR)(next)), sizeof(void*)));
IPTR length = p - string;
if (symbol->symbol + length > sections->space + sizeof (sections->space))
@@ -180,7 +182,9 @@
sync.unlock();
sync.lock (Exclusive);
- symbol = (Symbol*) ((IPTR)(next + 3) & ~3);
+
+ // Allocate space for the new symbol with necessary address alignment
+ symbol = (Symbol*) (ROUNDUP(((IPTR)(next)), sizeof(void*)));
IPTR length = p - string;
if (symbol->symbol + length > sections->space + sizeof (sections->space))
| Thread |
|---|
| • commit into mysql-6.0-falcon:mysql-6.0-falcon branch (olav:2692) Bug#36745 | Olav Sandstaa | 6 Jun |