DynamoRIO / DynamoRIO/dynamorio
privlib __try is thwarted by DR's TRY on privload entry routine
- Dominant language
- C
- Stars
- 3.2k
- Forks
- 629
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 30
Description
_From [bruen...@google.com](https://code.google.com/u/109494838902877177630/) on June 13, 2014 18:05:43_
The system loader's fault handler is outermost, but for DR ours is
innermost and we ruin the try/finally and other behaviors in private
libraries.
I hit this in issue #1457 :
tidtable.c:
_mlock(_SETLOCALE_LOCK);
```
__try {
if ( (ptloci = ptd->ptlocinfo) != NULL )
{
__removelocaleref(ptloci);
if ( (ptloci != __ptlocinfo) &&
(ptloci != &__initiallocinfo) &&
(ptloci->refcount == 0) )
__freetlocinfo(ptloci);
}
}
__finally {
_munlock(_SETLOCALE_LOCK);
}
```
The crash there turns out to be our fault and it doesn't happen now in test
apps, but clearly they're worried about it happening in the real world,
and if it does we'll fail to run the __finally and will end up w/ a deadlock.
_Original issue: http://code.google.com/p/dynamorio/issues/detail?id=1458_
Contributor guide
Assessment
This issue has not been assessed yet.