DynamoRIO / DynamoRIO/dynamorio

privlib __try is thwarted by DR's TRY on privload entry routine

Open
#1,458 0 comments 0 reactions 0 assignees View on GitHub
Migrated OpSys-Windows Priority-Medium
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.