What steps will reproduce the problem?
1. compile embedded binary
2. start platform
What is the expected output? What do you see instead?
Expected: no output, waiting for ipm to connect
Observed: "Address range crosses over cache line boundary" in
heap_linkToFreelist as reported by the platform debugger.
What version of the product are you using? On what operating system?
latest "default" tip from repository, compiled to a new target for an
experimental chip (not public)
Please provide any additional information below.
This chip has 64-bit words but does not support unaligned accesses. The problem
can be fixed with the following patch:
diff -r f78fd6e58def src/vm/heap.c
--- a/src/vm/heap.c Wed Jun 29 22:15:35 2011 -0500
+++ b/src/vm/heap.c Mon Aug 29 12:06:36 2011 +0200
@@ -39,7 +39,7 @@
* descriptor. That field is nine bits with two assumed lsbs (zeros):
* (0x1FF << 2) == 2044
*/
-#define HEAP_MAX_LIVE_CHUNK_SIZE 2044
+#define HEAP_MAX_LIVE_CHUNK_SIZE 2040 // ensure that all chunks have a size
multiple of 8
/**
* The maximum size a free chunk can be (a free chunk is one that is not in use).
@@ -47,10 +47,10 @@
* That field is fourteen bits with two assumed least significant bits (zeros):
* (0x3FFF << 2) == 65532
*/
-#define HEAP_MAX_FREE_CHUNK_SIZE 65532
+#define HEAP_MAX_FREE_CHUNK_SIZE 65528 // ensure that the initial chunks have
a size multiple of 8
/** The minimum size a chunk can be (rounded up to a multiple of 4) */
-#define HEAP_MIN_CHUNK_SIZE ((sizeof(PmHeapDesc_t) + 3) & ~3)
+#define HEAP_MIN_CHUNK_SIZE ((sizeof(PmHeapDesc_t) + 7) & ~7) // ensure
multiple of 8
Maybe these values should be conditionalized on the newly added
PM_PLAT_POINTER_SIZE? However I am not sure.
Original issue reported on code.google.com by k...@vodka-pomme.net on 29 Aug 2011 at 10:09
Original issue reported on code.google.com by
k...@vodka-pomme.net
on 29 Aug 2011 at 10:09