Closed
Bug 1359841
Opened 9 years ago
Closed 9 years ago
xpcom/base/nsStatusReporterManager.cpp should cast getpid() return value to int
Categories
(Core :: XPCOM, defect)
Tracking
()
RESOLVED
FIXED
mozilla55
| Tracking | Status | |
|---|---|---|
| firefox55 | --- | fixed |
People
(Reporter: petr.sumbera, Assigned: petr.sumbera)
Details
Attachments
(1 file)
|
802 bytes,
patch
|
alchen
:
review+
|
Details | Diff | Splinter Review |
User Agent: Mozilla/5.0 (X11; SunOS i86pc; rv:45.0) Gecko/20100101 Firefox/45.0
Build ID: 20170407182535
Steps to reproduce:
/builds/psumbera/userland-ff-52-jinji/components/desktop/firefox/firefox-52.1.0esr/xpcom/base/nsStatusReporterManager.cpp:149:30: error: call of overloaded 'AppendInt(pid_t ' is ambiguous
filename.AppendInt(getpid());
^
In file included from /builds/psumbera/userland-ff-52-jinji/components/desktop/firefox/build/i86/dist/include/nsAString.h:26:0,
from /builds/psumbera/userland-ff-52-jinji/components/desktop/firefox/build/i86/dist/include/nsSubstring.h:10,
from /builds/psumbera/userland-ff-52-jinji/components/desktop/firefox/build/i86/dist/include/nsString.h:12,
from /builds/psumbera/userland-ff-52-jinji/components/desktop/firefox/build/i86/dist/include/nsStringGlue.h:18,
from /builds/psumbera/userland-ff-52-jinji/components/desktop/firefox/build/i86/dist/include/nsThreadUtils.h:19,
from /builds/psumbera/userland-ff-52-jinji/components/desktop/firefox/firefox-52.1.0esr/ipc/chromium/src/base/message_loop.h:29,
from /builds/psumbera/userland-ff-52-jinji/components/desktop/firefox/firefox-52.1.0esr/xpcom/base/nsDumpUtils.h:11,
from /builds/psumbera/userland-ff-52-jinji/components/desktop/firefox/firefox-52.1.0esr/xpcom/base/nsDumpUtils.cpp:7,
from /builds/psumbera/userland-ff-52-jinji/components/desktop/firefox/build/i86/xpcom/base/Unified_cpp_xpcom_base1.cpp:2:
/builds/psumbera/userland-ff-52-jinji/components/desktop/firefox/build/i86/dist/include/nsTSubstring.h:579:8: note: candidate: void nsACString_internal::AppendInt(int32_t)
void AppendInt(int32_t aInteger)
^
/builds/psumbera/userland-ff-52-jinji/components/desktop/firefox/build/i86/dist/include/nsTSubstring.h:588:8: note: candidate: void nsACString_internal::AppendInt(uint32_t)
void AppendInt(uint32_t aInteger)
^
/builds/psumbera/userland-ff-52-jinji/components/desktop/firefox/build/i86/dist/include/nsTSubstring.h:597:8: note: candidate: void nsACString_internal::AppendInt(int64_t)
void AppendInt(int64_t aInteger)
^
/builds/psumbera/userland-ff-52-jinji/components/desktop/firefox/build/i86/dist/include/nsTSubstring.h:606:8: note: candidate: void nsACString_internal::AppendInt(uint64_t)
void AppendInt(uint64_t aInteger)
^
This is happening on Solaris when building 32bit binary. The reason is because pid_t is in this case defined as long. Linux and Solaris in 64bit mode defines pid_t as int.
There seems to be similar case handled in xpcom/base/nsTraceRefcnt.cpp where is:
name.AppendInt((uint32_t)getpid());
So I think we should follow this example.
| Assignee | ||
Comment 1•9 years ago
|
||
Attachment #8861994 -
Flags: review?(alchen)
Updated•9 years ago
|
Component: Untriaged → XPCOM
Product: Firefox → Core
Comment 2•9 years ago
|
||
Comment on attachment 8861994 [details] [diff] [review]
Bug1359841.patch
Review of attachment 8861994 [details] [diff] [review]:
-----------------------------------------------------------------
LGTM
Attachment #8861994 -
Flags: review?(alchen) → review+
| Assignee | ||
Updated•9 years ago
|
Keywords: checkin-needed
Updated•9 years ago
|
Assignee: nobody → petr.sumbera
Pushed by ryanvm@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/eeac6d080b44
xpcom/base/nsStatusReporterManager.cpp should cast getpid() return value to int. r=alchen
Keywords: checkin-needed
Comment 4•9 years ago
|
||
| bugherder | ||
Status: UNCONFIRMED → RESOLVED
Closed: 9 years ago
status-firefox55:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
You need to log in
before you can comment on or make changes to this bug.
Description
•