This is an archive of the discontinued Mercurial Phabricator instance.

osutil: allow disabling setprocname via a define passed to the compiler
ClosedPublic

Authored by spectral on Sep 17 2019, 6:58 PM.

Details

Summary

In some situations, we run a custom python launcher that appears to not set up
Py_GetArgcArgv correctly. We then proceed to promptly crash when we attempt to
dereference NULL. Being able to completely disable setprocname is beneficial in
these situations, since we won't even attempt to use it, even if the case that
causes the crash is fixed.

Right now, if I compile osutil.so with -DSETPROCNAME_USE_NONE, the compilation
fails on python3 due to SETPROCNAME_USE_NONE redefinition. I could possibly
work around that, but it's likely helpful to have a way of disabling this
completely without it being brittle (i.e. if python3 ever gains the ability to
perform this operation).

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

spectral created this revision.Sep 17 2019, 6:58 PM
This revision was not accepted when it landed; it landed in state Needs Review.
This revision was automatically updated to reflect the committed changes.