RESOLVED FIXED 12841
Crash on ARM due to mis-alignment
https://bugs.webkit.org/show_bug.cgi?id=12841
Summary Crash on ARM due to mis-alignment
Oscar Cwajbaum
Reported 2007-02-21 04:29:36 PST
ARM has stricter alignment rules than many other architectures. In this case, pageheap_memory is being declared as a char array, so it is not aligned by the compiler. It is later used as TCMalloc_PageHeap*, which does require alignment. When building under ARM, this patch tells the compiler to stricly align pageheap_memory so that pageheap_memory can be used as TCMalloc_PageHeap*. It does not affect other platforms.
Attachments
Fix ARM crash due to mis-alignment (1.47 KB, patch)
2007-02-21 04:30 PST, Oscar Cwajbaum
no flags
Fix ARM crash due to mis-alignment - rev2 (1.17 KB, patch)
2007-02-22 00:48 PST, Oscar Cwajbaum
mjs: review+
Oscar Cwajbaum
Comment 1 2007-02-21 04:30:54 PST
Created attachment 13292 [details] Fix ARM crash due to mis-alignment
Darin Adler
Comment 2 2007-02-21 17:21:09 PST
Comment on attachment 13292 [details] Fix ARM crash due to mis-alignment I think there's a more-portable way to solve this problem. We could make pageheap_memory be an array of pointers instead of an array of char. That would ive us the alignment we need to store pointers in it. static void* pageheap_memory[(sizeof(TCMalloc_PageHeap) + sizeof(void*) - 1) / sizeof(void*)]; What do you think?
Maciej Stachowiak
Comment 3 2007-02-22 00:15:30 PST
I agree with Darin. I think it is better to enforce the alignment in a portable way, by making the array be a pointer array or the like.
Oscar Cwajbaum
Comment 4 2007-02-22 00:48:00 PST
Created attachment 13312 [details] Fix ARM crash due to mis-alignment - rev2
Oscar Cwajbaum
Comment 5 2007-02-22 00:50:34 PST
Sounds good to me. I've attached a modified patch with Darin's suggestion.
Maciej Stachowiak
Comment 6 2007-02-22 02:26:04 PST
Comment on attachment 13312 [details] Fix ARM crash due to mis-alignment - rev2 r=me
Sam Weinig
Comment 7 2007-02-22 08:11:01 PST
Landed in r19791.
Note You need to log in before you can comment on or make changes to this bug.