Closed Bug 1745908 Opened 4 years ago Closed 4 years ago

`_Py_HashRandomization_Init` Python error at the end of every mach invocation

Categories

(Firefox Build System :: General, defect, P1)

defect

Tracking

(firefox-esr91 unaffected, firefox95 unaffected, firefox96 unaffected, firefox97 fixed)

RESOLVED FIXED
97 Branch
Tracking Status
firefox-esr91 --- unaffected
firefox95 --- unaffected
firefox96 --- unaffected
firefox97 --- fixed

People

(Reporter: mossop, Assigned: janerik)

References

(Blocks 1 open bug, Regression)

Details

(Keywords: regression)

Attachments

(2 files)

On Windows every time I do a build or package or something the command appears to work but the last line logged is this:

Fatal Python error: _Py_HashRandomization_Init: failed to get random numbers to initialize Python

Also hitting this. I didn't realize it was non fatal until finding this bug. Seeing Fatal Python error after mach commands had me assuming stuff was busted.

On top of looking scary, it can also make prompts confusing when running commands that require interaction:

Paste API Token from that page: Fatal Python error: _Py_HashRandomization_Init: failed to get random numbers to initialize Python

though this also seems to have worked okay with if I ignore the error and just respond to the prompt.

I'm going to tentatively mark this as "regressed by" the glean update, because one-off error messages at the end of Mach processes (even those as simple as, say, ./mach python -c pass) are generally associated with Glean behaviour in a background thread.

If that indeed wasn't the cause, I'll be able to investigate more closely tomorrow.

Regressed by: 1744674
Has Regression Range: --- → yes

After a quick web search I think I know what's going on:
We recently landed a Glean patch to set PYTHONPATH in the launched subprocess, but they way we're doing it overrides all other environment variables.
It seems for the RNG to work it needs SYSTEMROOT to be set. That's something I can fix in Glean.

Verified a fix, gonna send that soon.

Assignee: nobody → jrediger
Priority: -- → P1
Pushed by jrediger@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/5aadefcc52b5 Update Glean in mach to prevent RNG bug. r=Dexter

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

Blocks: mach-busted
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 97 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: