mudflap - does anyone else get many exceptions?

Eyal Lebedinsky eyal@eyal.emu.id.au
Sat May 19 08:15:00 GMT 2007


Eyal Lebedinsky wrote:
> This is probably an issue only with multithreaded programs.
> 
> For a long time now I found a need to apply a private patch to mf-runtime.c
> so that it does not report access to envp[] as a violation. I now built
> gcc-4.2.0 and gcc-current and found that I still need this patch for both.
> 
> The small patch simply moves the registration of standard items (environ,
> stdin, etc.) from wrap_main() to __mf_init(). I also needed to add a
> wrapper for strerror_r().
> 
> Do other people encounter this problem? How do you solve this?
> 
> patch is here:
> http://members.iinet.net.au/~eyaleb/gcc-current-libmudflap-20070518.patch.bz2

An important bit: the problem only shows up when code is executed from
a shared-object constructor.

The attached script demonstrates the problem, note the violation for stderr
when used inside dll_init().

-- 
Eyal Lebedinsky (eyal@eyal.emu.id.au) <http://samba.org/eyal/>
	attach .zip as .dat
-------------- next part --------------
A non-text attachment was scrubbed...
Name: zz40.sh
Type: application/x-shellscript
Size: 1367 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc/attachments/20070519/cdf634b2/attachment.bin>


More information about the Gcc mailing list