Closed Bug 989042 Opened 6 years ago Closed 6 years ago

Build broken on most *BSDs: dom/ipc/ContentParent.cpp:978:16: error: 'P_PID' was not declared in this scope

Categories

(Core :: IPC, defect)

x86_64
FreeBSD
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla31

People

(Reporter: jbeich, Assigned: jld)

References

Details

Attachments

(1 file, 1 obsolete file)

Attached patch hack (obsolete) — Splinter Review
waitid(), P_PID and WEXITED are available on FreeBSD 9.2 but not before, cf. http://freshbsd.org/commit/freebsd/r244172 Other BSDs don't support them plus DragonFly and OpenBSD have neither WNOWAIT.

clang stops parsing a line after the first undeclared identifier:

dom/ipc/Unified_cpp_dom_ipc0.cpp:28:
dom/ipc/ContentParent.cpp:978:16: error:
      use of undeclared identifier 'P_PID'
    if (waitid(P_PID, Pid(), &info, WNOWAIT | WNOHANG | WEXITED) == 0
               ^
1 error generated.

while gcc warns about each one:

In file included from dom/ipc/Unified_cpp_dom_ipc0.cpp:28:0:
dom/ipc/ContentParent.cpp: In member function 'bool mozilla::dom::ContentParent::SetPriorityAndCheckIsAlive(mozilla::dom::PContentParent::ProcessPriority)':
dom/ipc/ContentParent.cpp:978:16: error: 'P_PID' was not declared in this scope
     if (waitid(P_PID, Pid(), &info, WNOWAIT | WNOHANG | WEXITED) == 0
                ^
dom/ipc/ContentParent.cpp:978:57: error: 'WEXITED' was not declared in this scope
     if (waitid(P_PID, Pid(), &info, WNOWAIT | WNOHANG | WEXITED) == 0
                                                         ^
dom/ipc/ContentParent.cpp:978:64: error: 'waitid' was not declared in this scope
     if (waitid(P_PID, Pid(), &info, WNOWAIT | WNOHANG | WEXITED) == 0
                                                                ^
http://buildbot.rhaalovely.net/builders/mozilla-central-amd64/builds/1069/steps/build/logs/stdio

Here's a short hack based on availability. r- if you prefer to check waitid/etc in configure.in. I'd like to avoid listing platforms explicitly (Linux, Solaris, FreeBSD).
Attachment #8398070 - Flags: review?(jld)
(In reply to Jan Beich from comment #0)
> http://freshbsd.org/commit/freebsd/0

s/0/r244172/ to unmunge the link or try different one:
http://svnweb.freebsd.org/base?view=revision&revision=244172
Sorry about that — I saw that waitid() had been standardized since XPG4v2 and didn't think to check actual compatibility.

It might be justifiable to explicitly limit this to Linux.  As I understand it, that code is in there to deal with the preallocated process being asynchronously killed by the Android low memory killer on B2G, and it implicitly assumes that adjusting the "priority" will be related to this.  I suspect that this wouldn't do what we want on *BSD in any case.
Summary: dom/ipc/ContentParent.cpp:978:16: error: 'P_PID' was not declared in this scope → Build broken on most *BSDs: dom/ipc/ContentParent.cpp:978:16: error: 'P_PID' was not declared in this scope
(In reply to Jed Davis [:jld] from comment #2)
> It might be justifiable to explicitly limit this to Linux.

Why to Linux and not to Gonk? hal::SetProcessPriority isn't implemented on Linux (Desktop), Android and B2G (Desktop).
(In reply to Jan Beich from comment #3)
> (In reply to Jed Davis [:jld] from comment #2)
> > It might be justifiable to explicitly limit this to Linux.
> 
> Why to Linux and not to Gonk? hal::SetProcessPriority isn't implemented on
> Linux (Desktop), Android and B2G (Desktop).

Thanks for pointing that out; I'll try that.
Assignee: nobody → jld
Attachment #8398070 - Attachment is obsolete: true
Attachment #8398070 - Flags: review?(jld)
Attachment #8398766 - Flags: review?(benjamin)
Attachment #8398766 - Flags: feedback?(jbeich)
Attachment #8398766 - Flags: feedback?(jbeich) → feedback+
Comment on attachment 8398766 [details] [diff] [review]
bug989042-fix-bsd-hg0.diff

Fixes my builds
Attachment #8398766 - Flags: feedback+
Benjamin ? Failures start piling on on bsds... id like to resolve the ones which have a confirmed fix :)
Attachment #8398766 - Flags: review?(benjamin) → review+
https://hg.mozilla.org/mozilla-central/rev/07eb968c0c5a
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla31
You need to log in before you can comment on or make changes to this bug.