|Title||MMQA test function/214.c failure|
|Assigned user||Gareth Rees|
|Description||The test case passes on OS X, but on Ubuntu (platform lii6ll) the call to mps_pool_create returns ResMEMORY.|
|Analysis||Looking at it in the debugger shows that MVTInit is getting a ridiculously large value for the reserveDepth argument, and so the call to ABQInit is failing becaue it can't allocate the array of elements.|
The problem is that the call looks like this:
mps_pool_create(&pool, arena, mps_class_mvt(),
OBJSIZE, OBJSIZE, OBJSIZE, DEPTH, FRAGLIMIT),
where OBJSIZE and so on are preprocessor constants that expand to integer literals (and are small enough that they have type int), and then the default argument promotions are applied since mps_pool_create has a variable argument list, so they are passed as 32-bit integers. But MVTVarargs decodes these arguments as Size, Size, Size, Count, Count, respectively, which are all 64-bit types on this platform, and so read off the end of the argument list into nearby memory.
How did this test case pass on OS X? Maybe we just got lucky wrt the contents of the nearby memory.
|Created by||Gareth Rees|
|Created on||2014-10-10 19:58:24|
|Last modified by||Gareth Rees|
|Last modified on||2014-10-20 17:18:15|
|History||2014-10-10 GDR Created.|
|187190||closed||2014-10-10 17:14:09||Gareth Rees||Cast arguments to the correct type to avoid them being decoded incorrectly by the varargs interface.|