Closed Bug 1776219 Opened 4 years ago Closed 4 years ago

mach configure fails on OpenBSD/i386

Categories

(Firefox Build System :: Mach Core, defect)

x86
OpenBSD
defect

Tracking

(firefox-esr91 unaffected, firefox-esr102 fixed, firefox102 wontfix, firefox103 wontfix, firefox104 fixed)

VERIFIED FIXED
104 Branch
Tracking Status
firefox-esr91 --- unaffected
firefox-esr102 --- fixed
firefox102 --- wontfix
firefox103 --- wontfix
firefox104 --- fixed

People

(Reporter: gaston, Assigned: Dexter)

References

(Regression)

Details

(Keywords: regression)

Attachments

(1 external file)

Similar to bug #1774144, but not exactly the same ? This time on i386... i managed to build/install glean-sdk too.

Configure complete!
Be sure to run |mach build| to pick up any changes
Error running mach:

    ['configure']

The error occurred in code that was called by the mach command. This is either
a bug in the called code itself or in the way that mach is calling it.
You can invoke |./mach busted| to check if this issue is already on file. If it
isn't, please use |./mach busted file configure| to report it. If |./mach busted| is
misbehaving, you can also inspect the dependencies of bug 1543241.

If filing a bug, please include the full output of mach, including this error
message.

The details of the failure are as follows:

SystemError: NULL object passed to Py_BuildValue

  File "/build/buildslave-i386/mozilla-central-i386/build/build/mach_initialize.py", line 451, in post_dispatch_handler
    _finalize_telemetry_glean(
  File "/build/buildslave-i386/mozilla-central-i386/build/build/mach_initialize.py", line 537, in _finalize_telemetry_glean
    system_metrics.vscode_running.set(get_vscode_running())
  File "/build/buildslave-i386/mozilla-central-i386/build/python/mozbuild/mozbuild/telemetry.py", line 251, in get_vscode_running
    for proc in psutil.process_iter():
  File "/build/buildslave/.mozbuild/srcdirs/build-f92f516ac5ed/_virtualenvs/mach/lib/python3.9/site-packages/psutil/__init__.py", line 1425, in process_iter
    a = set(pids())
  File "/build/buildslave/.mozbuild/srcdirs/build-f92f516ac5ed/_virtualenvs/mach/lib/python3.9/site-packages/psutil/__init__.py", line 1365, in pids
    ret = sorted(_psplatform.pids())
  File "/build/buildslave/.mozbuild/srcdirs/build-f92f516ac5ed/_virtualenvs/mach/lib/python3.9/site-packages/psutil/_psbsd.py", line 514, in pids
    if OPENBSD and (0 not in ret) and _pid_0_exists():
  File "/build/buildslave/.mozbuild/srcdirs/build-f92f516ac5ed/_virtualenvs/mach/lib/python3.9/site-packages/psutil/_common.py", line 405, in wrapper
    ret = cache[key] = fun(*args, **kwargs)
  File "/build/buildslave/.mozbuild/srcdirs/build-f92f516ac5ed/_virtualenvs/mach/lib/python3.9/site-packages/psutil/_psbsd.py", line 502, in _pid_0_exists
    Process(0).name()
  File "/build/buildslave/.mozbuild/srcdirs/build-f92f516ac5ed/_virtualenvs/mach/lib/python3.9/site-packages/psutil/_psbsd.py", line 550, in wrapper
    return fun(self, *args, **kwargs)
  File "/build/buildslave/.mozbuild/srcdirs/build-f92f516ac5ed/_virtualenvs/mach/lib/python3.9/site-packages/psutil/_psbsd.py", line 617, in name
    name = self.oneshot()[kinfo_proc_map['name']]
  File "/build/buildslave/.mozbuild/srcdirs/build-f92f516ac5ed/_virtualenvs/mach/lib/python3.9/site-packages/psutil/_psbsd.py", line 550, in wrapper
    return fun(self, *args, **kwargs)
  File "/build/buildslave/.mozbuild/srcdirs/build-f92f516ac5ed/_virtualenvs/mach/lib/python3.9/site-packages/psutil/_common.py", line 450, in wrapper
    return fun(self)
  File "/build/buildslave/.mozbuild/srcdirs/build-f92f516ac5ed/_virtualenvs/mach/lib/python3.9/site-packages/psutil/_psbsd.py", line 605, in oneshot
    ret = cext.proc_oneshot_info(self.pid)

Hey Landry!

Thanks for reportin! (once again :-P)

Would you kindly check if returning false here fixes this for you?

Flags: needinfo?(landry)

(In reply to Alessio Placitelli [:Dexter] from comment #1)

Hey Landry!

Thanks for reportin! (once again :-P)

Would you kindly check if returning false here fixes this for you?

tried it and no sadly that doesnt help - psutil can be imported without issues on OpenBSD/i386.. but seems process_iter() somehow fails ?

c32# /build/obj/buildslave/mozilla-central/_virtualenvs/build/bin/python
Python 3.9.13 (main, Jun 17 2022, 12:41:31) 
[Clang 13.0.0 ] on openbsd7
Type "help", "copyright", "credits" or "license" for more information.
>>> import psutil
>>> psutil.process_iter()
  File "<stdin>", line 0
    
SyntaxError: (unicode error) 'utf-8' codec can't decode byte 0xc3 in position 20: invalid continuation byte

running the same code interactively also fails on OpenBSD/amd64 (but configure succeeds there ?) so i guess smth wrong in my testing.

Flags: needinfo?(landry)

ah, it's better with a locale set for python...

c32# LC_ALL=fr_FR.UTF-8 /build/obj/buildslave/mozilla-central/_virtualenvs/build/bin/python
Python 3.9.13 (main, Jun 17 2022, 12:41:31) 
[Clang 13.0.0 ] on openbsd7
Type "help", "copyright", "credits" or "license" for more information.
>>> import psutil
>>> psutil.process_iter()
<generator object process_iter at 0x538a3648>

sadly, the same LC_ALL var trick doesnt allow me to run ./mach configure on OpenBSD/i386... puzzling.

bah, should have tested better.. actually running the generator shows the underlying failure is indeed within psutil:

>>> for f in psutil.process_iter():
...     print(f)
... 
Traceback (most recent call last):
  File "/build/buildslave/.mozbuild/srcdirs/build-f92f516ac5ed/_virtualenvs/mach/lib/python3.9/site-packages/psutil/_common.py", line 403, in wrapper
    return cache[key]
KeyError: ((), frozenset())

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/build/buildslave/.mozbuild/srcdirs/build-f92f516ac5ed/_virtualenvs/mach/lib/python3.9/site-packages/psutil/_common.py", line 447, in wrapper
    ret = self._cache[fun]
AttributeError: _cache

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/build/buildslave/.mozbuild/srcdirs/build-f92f516ac5ed/_virtualenvs/mach/lib/python3.9/site-packages/psutil/__init__.py", line 1425, in process_iter
    a = set(pids())
  File "/build/buildslave/.mozbuild/srcdirs/build-f92f516ac5ed/_virtualenvs/mach/lib/python3.9/site-packages/psutil/__init__.py", line 1365, in pids
    ret = sorted(_psplatform.pids())
  File "/build/buildslave/.mozbuild/srcdirs/build-f92f516ac5ed/_virtualenvs/mach/lib/python3.9/site-packages/psutil/_psbsd.py", line 514, in pids
    if OPENBSD and (0 not in ret) and _pid_0_exists():
  File "/build/buildslave/.mozbuild/srcdirs/build-f92f516ac5ed/_virtualenvs/mach/lib/python3.9/site-packages/psutil/_common.py", line 405, in wrapper
    ret = cache[key] = fun(*args, **kwargs)
  File "/build/buildslave/.mozbuild/srcdirs/build-f92f516ac5ed/_virtualenvs/mach/lib/python3.9/site-packages/psutil/_psbsd.py", line 502, in _pid_0_exists
    Process(0).name()
  File "/build/buildslave/.mozbuild/srcdirs/build-f92f516ac5ed/_virtualenvs/mach/lib/python3.9/site-packages/psutil/_psbsd.py", line 550, in wrapper
    return fun(self, *args, **kwargs)
  File "/build/buildslave/.mozbuild/srcdirs/build-f92f516ac5ed/_virtualenvs/mach/lib/python3.9/site-packages/psutil/_psbsd.py", line 617, in name
    name = self.oneshot()[kinfo_proc_map['name']]
  File "/build/buildslave/.mozbuild/srcdirs/build-f92f516ac5ed/_virtualenvs/mach/lib/python3.9/site-packages/psutil/_psbsd.py", line 550, in wrapper
    return fun(self, *args, **kwargs)
  File "/build/buildslave/.mozbuild/srcdirs/build-f92f516ac5ed/_virtualenvs/mach/lib/python3.9/site-packages/psutil/_common.py", line 450, in wrapper
    return fun(self)
  File "/build/buildslave/.mozbuild/srcdirs/build-f92f516ac5ed/_virtualenvs/mach/lib/python3.9/site-packages/psutil/_psbsd.py", line 605, in oneshot
    ret = cext.proc_oneshot_info(self.pid)
SystemError: NULL object passed to Py_BuildValue

Got it. Does this mean it's still a build system bug or something that has to do with the underlying OS?

Flags: needinfo?(landry)

from my understanding that's a problem within psutil, which badly blows, and the above layers in mach fails to gracefully handle it.

Flags: needinfo?(landry)

On OpenBSD/i386, psutils fails in the generator used to enumerate the
active processes, breaking the build.

Hey :gaston!

Sorry for the noise again. Would you kindly verify if https://phabricator.services.mozilla.com/D150462 fixes it for you?

Thanks!

Flags: needinfo?(landry)

Comment on attachment 9283185 [details]
Bug 1776219 - Gracefully handle psutils failures in mach telemetry.

yes, that allows me to run configure on OpenBSD/i386.

Another option would be to return False straight away in get_vscode_running on platforms we know vscode doesnt exist .. eg at least OpenBSD & NetBSD, since FreeBSD has a port.

Flags: needinfo?(landry)
Attachment #9283185 - Flags: feedback+

i have to admit that detecting if vscode is running by checking if there's a running process named "code" feels a bit fragile :) oh well...

Attachment #9283185 - Attachment description: WIP: Bug 1776219 - Gracefully handle psutils failures in mach telemetry. → Bug 1776219 - Gracefully handle psutils failures in mach telemetry.
Assignee: nobody → alessio.placitelli
Status: NEW → ASSIGNED

(In reply to Landry Breuil (:gaston) from comment #9)

Comment on attachment 9283185 [details]
Bug 1776219 - Gracefully handle psutils failures in mach telemetry.

yes, that allows me to run configure on OpenBSD/i386.

Nice!

Another option would be to return False straight away in get_vscode_running on platforms we know vscode doesnt exist .. eg at least OpenBSD & NetBSD, since FreeBSD has a port.

Yeah, though that would require us to make sure to keep track what platform vscode supports. I'd rather stick to the current approach for now!

Note: this is a regression from bug 1717801

See Also: → 1717801

(In reply to Landry Breuil (:gaston) from comment #10)

i have to admit that detecting if vscode is running by checking if there's a running process named "code" feels a bit fragile :) oh well...

Heh, probably :-) I'm not familiar with this part of the codebase, so let's lean on the reviewers to see if that's the right call :)

Regressed by: 1717801
See Also: 1717801 →

Set release status flags based on info from the regressing bug 1717801

Pushed by aplacitelli@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/5a5959b4e887 Gracefully handle psutils failures in mach telemetry. r=firefox-build-system-reviewers,ahochheiden
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 104 Branch

thanks :dexter, my i386 buildbot failed building later on ( http://buildbot.rhaalovely.net/nine/#/builders/1/builds/1291) and i'll look at the actual failure, but at least now configure was successful !

Status: RESOLVED → VERIFIED

(In reply to Landry Breuil (:gaston) from comment #17)

thanks :dexter, my i386 buildbot failed building later on ( http://buildbot.rhaalovely.net/nine/#/builders/1/builds/1291) and i'll look at the actual failure, but at least now configure was successful !

My pleasure :) please do file another bug if that ends up being a bug in Firefox!

The patch landed in nightly and beta is affected.
:Dexter, is this bug important enough to require an uplift?

  • If yes, please nominate the patch for beta approval.
  • If no, please set status-firefox103 to wontfix.

For more information, please visit auto_nag documentation.

Flags: needinfo?(alessio.placitelli)
Flags: needinfo?(alessio.placitelli)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: