Open egrimley-arm opened 8 months ago
Probably should s/ASSERT/ASSERT_CURIOSITY/
as the dr_prepopulate_cache() case (see the comment) is an expected occurrence; otherwise it is the app doing sthg very weird, but DR should support it so should not assert fatally. Maybe downgrade to a SYSLOG_INTERNAL_WARNING.
The following test program for AArch64 puts a return instruction into a writable and executable page and then calls it from an assembler helper function with SP containing the value 1. If I run it under DynamoRIO with DEBUG I get:
I haven't tested whether something similar happens on any other architecture.
Running code in writable memory with a bad stack pointer is not perhaps something that everyone wants to do every day, and perhaps this is a difficult-to-avoid limitation of DynamoRIO, but the following observations make me suspect it's a bug rather than a deliberate limitation:
So should the
ASSERT(!dynamo_started)
be removed or replaced withASSERT(!dynamo_started || ...)
?EDIT: Something similar is reported here (https://groups.google.com/g/DynamoRIO-Users/c/9vmKyMSOK8M) but with no mention of a bad SP so there may be less obscure ways of reproducing this defect.