Hi Daniel,
[Sorry for not responding earlier –
I’ve been on holiday for the last few weeks]
Thanks for providing your patch and for
all your work getting mpatrol to work with libunwind. Hopefully this will
help more people use libunwind and mpatrol together.
I had originally hoped to do a new update
release for mpatrol last year, but the birth of our son last September meant that
any free time I hoped to have had will now get postponed for another 10 years
;-) So, I’ve revised what I originally wanted to do for the release
into simply getting my latest sources put into CVS on SourceForge so that people
can access the latest version with some patches added and also add their own
patches. That way, even if a new release doesn’t come for another
few years, it’ll still be possible to get the latest sources with people’s
updates. I’ll try and get that done in the next few weeks and post
a message here when it’s done.
Thanks again,
Graeme.
From:
Sent: 23 June 2008 22:08
To:
Subject: [mpatrol] Stop mpatrol
recursing in checkalloca
Here's a
patch which stops a couple of crashes we encountered in
alloca checking. The failures were brought on by using libunwind with
the included test16 test case, but are not specific to libunwind.
The test causes infinite recursion on ARM. One of several places was
in __mp_getaddrs, which highlighted the fact that this routine
unnecessarily copies the stackinfo; the copy has been moved to where
it is necessary. Libunwind's stackinfo is unfortunately quite large
because we need to save the unwind cursor; it's big enough that the
compiler generates a call to memcpy.
Also discovered during debugging, checkalloca can crash if unwinding
failed for one of the mentioned frames. This happened in my case
because libunwind refuses to invoke recursively while in mid-unwind.
The final fix for the bug is the memhead.recur check in checkalloca.
The check can always wait until we return to user code. This is the
bit that makes calls to memcpy inside mpatrol, including
compiler-generated ones like for stackinfo above, not lead to an
infinitely deep stack.
Again, hope this is useful!
(Just curious: do you expect there will be another release of mpatrol
in the foreseeable future?)
--
Daniel Jacobowitz
CodeSourcery