From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20050513 Fedora/1.0.4-1.3.1 Firefox/1.0.4
Description of problem:
Simply reading or writing to the h_errno global variable gives out a read/write violation in mudflap.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Compile the program
and the program
h_errno = 0;
with mudflap enabled, i.e.
gcc -fmudflap prog1.c -lmudflap -o prog1
gcc -fmudflap prog2.c -lmudflap -o prog2
2. Run prog1 and prog2.
Actual Results: When prog1 is run, this is what I get:
mudflap violation 1 (check/read): time=1121380261.574621 ptr=0xb7eff6b4 size=4
pc=0xb7f09322 location=`a.cpp:6 (main)'
Nearby object 1: checked region begins 17B after and ends 20B after
mudflap object 0x80cb430: name=`errno area'
bounds=[0xb7eff6a0,0xb7eff6a3] size=4 area=static check=0r/0w liveness=0
alloc time=1121380261.574591 pc=0xb7f09e0a
number of nearby objects: 1
When prog2 is run, the report is similar, but it says "(check/write)", instead of "(check/read)" -- because h_errno is written to.
Expected Results: There should have been no violation messages.
That's a mudflap bug. (*__h_errno_location()) (which is what h_errno expands
to) is a thread local storage variable similarly to errno (*__errno_location()).
libmudflap has special quirks for errno, but not for h_errno (and I guess
not for _res either, and I wonder if any other thread local storage variable).
Jakub, cool, thanks! May I ask why the need for h_errno to expand to a thread
local storage variable if gethostbyname is not reentrant, and it (global
h_errno) isn't used by the reentrant equivalent gethostbyname_r?
h_errno is used in many other functions, some of which are reentrant.
Is there a complete list of such variables someplace? Failing that, I'll add
h_errno support to gcc mainline, and consider backporting.
mudflap is very buggy atm, i get violations just reading from argv :)
(In reply to comment #5)
> mudflap is very buggy atm, i get violations just reading from argv :)
This would be a separate problem. Make sure you pass -fmudflap to the link
stage too. If you do, and you still encounter this, please open a separate
bugzilla with a sample program.
This report targets the FC3 or FC4 products, which have now been EOL'd.
Could you please check that it still applies to a current Fedora release, and
either update the target product or close it ?
this bug is still present in Fedora 8, gcc-4.1.2-33
This message is a reminder that Fedora 8 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 8. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as WONTFIX if it remains open with a Fedora
'version' of '8'.
Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version prior to Fedora 8's end of life.
Bug Reporter: Thank you for reporting this issue and we are sorry that
we may not be able to fix it before Fedora 8 is end of life. If you
would still like to see this bug fixed and are able to reproduce it
against a later version of Fedora please change the 'version' of this
bug to the applicable version. If you are unable to change the version,
please add a comment here and someone will do it for you.
Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.
The process we are following is described here:
Fedora 8 changed to end-of-life (EOL) status on 2009-01-07. Fedora 8 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.
If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version.
Thank you for reporting this bug and we are sorry it could not be fixed.