Open egrimley-arm opened 7 months ago
The function is here: https://github.com/DynamoRIO/dynamorio/blob/95fd0237a5b9c9ca1add88574f9bddca002a82e9/core/unix/os.c#L2507-L2538
If you ask for num_slots > 1 then the implementation wants every slot to be aligned, which fails if the alignment is greater than the size of a slot and succeeds trivially otherwise, so the parameter is useless, I think.
num_slots > 1
alignment
You can fix this, I think, by adding start != -1 || to the start of the condition on the line https://github.com/DynamoRIO/dynamorio/blob/95fd0237a5b9c9ca1add88574f9bddca002a82e9/core/unix/os.c#L2519 so the condition reads: (!client_tls_allocated[i] && (start != -1 || alignment == 0 || ALIGNED(...)))
start != -1 ||
(!client_tls_allocated[i] && (start != -1 || alignment == 0 || ALIGNED(...)))
The function is here: https://github.com/DynamoRIO/dynamorio/blob/95fd0237a5b9c9ca1add88574f9bddca002a82e9/core/unix/os.c#L2507-L2538
If you ask for
num_slots > 1
then the implementation wants every slot to be aligned, which fails if thealignment
is greater than the size of a slot and succeeds trivially otherwise, so the parameter is useless, I think.You can fix this, I think, by adding
start != -1 ||
to the start of the condition on the line https://github.com/DynamoRIO/dynamorio/blob/95fd0237a5b9c9ca1add88574f9bddca002a82e9/core/unix/os.c#L2519 so the condition reads:(!client_tls_allocated[i] && (start != -1 || alignment == 0 || ALIGNED(...)))