mozilla/rr — pull request #1390 by cgjones (2014-12-13 02:47:35+00:00)
Title: Account for a program break that may not be contiguous with the other ex...

...ecutable image mappings.

Resolves #1384.

The problem is that just after an exec we see an address space laid out like
```
00400000-004dd000 r-xp 00000000 fd:01 1314442 /usr/bin/bash
006dc000-006dd000 r--p 000dc000 fd:01 1314442 /usr/bin/bash
006dd000-006e6000 rw-p 000dd000 fd:01 1314442 /usr/bin/bash
006e6000-006ec000 rw-p 00000000 00:00 0
008e5000-008ee000 rw-p 000e5000 fd:01 1314442 /usr/bin/bash
```
The logic before this patch infers the program break as being at 0x006ec000, however the break is actually at 0x008ee000 as the immediately-following `brk` call shows:
```
008ee000-0090f000 rw-p 00000000 00:00 0 [heap]
```
So this patch updates the logic to look for the contiguous end-of-mappings as before, *or* the last mapped page from the executable image. This all still feels pretty fragile, but I still don't have a better solution :/.

Would be a good idea for someone to look this over so that the bus factor on this delicate code is >1.