Uh oh!
There was an error while loading. Please reload this page.
lib: add late code injector - #37503
Conversation
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Trott
commented
Feb 24, 2021
Should this be documented? Does this need a test? |
Co-authored-by: Gireesh Punathil <gpunathi@in.ibm.com>
RaisinTen
commented
Feb 24, 2021
@Trott yes, will surely add documentation + tests for this after |
addaleax
commented
Feb 24, 2021
In the current form, this should definitely be implemented in userland through |
jasnell
commented
Feb 24, 2021
Yeah, without more information about the specific set of use cases being targeted here, I have to agree with @addaleax |
gireeshpunathil
commented
Feb 24, 2021
@addaleax - how does that work? with |
devsnek
commented
Feb 24, 2021
@gireeshpunathil at startup, load a small module loader script, instead of the main script: 'use strict';process.on('SIGUSR1',()=>{require(process.env.THE_MODULE);deleterequire.cache[require.resolve(process.env.THE_MODULE)];}); |
gireeshpunathil
commented
Feb 24, 2021
@devsnek - makes sense, in the given premise of this PR ( there are certain preparation possible prior to the process launch). However, the original issue does not have such a premise. How do we run an arbitrary piece of code in a running process, where the process did not undergo any preparatory steps. This PR is probably a middleground approach wherein the name of the module is set on the
, not because we have that flexibility. |
mscdex
commented
Feb 24, 2021
If you want to run arbitrary code after launch, why not start a tcp server in conjunction with |
addaleax
commented
Feb 24, 2021
I wouldn't call this PR a midde ground, though, because it has the exact same set of requirements as what @devsnek and I would be suggesting. If you want a no-preparation-at-all scenario, then you'll need a different approach. |
gireeshpunathil
commented
Feb 25, 2021
@mscdex - that needs the target process to be prepared for receiving an arbitrary code, right? Here is my requirement, restating:
|
gireeshpunathil
commented
Feb 25, 2021
@addaleax - yes agree. Please let @RaisinTen / me know if you have ideas on those lines. |
mscdex
commented
Feb 25, 2021
@gireeshpunathil It sounds like what you're wanting is impossible then. Even with this PR it requires an environment variable on startup of the process? |
gireeshpunathil
commented
Feb 25, 2021
@mscdex - agree, this PR assumes we are informed about a future attach. |
RaisinTen
commented
Mar 15, 2021
Thanks for the reviews. Closing in favour of #37748. |
Fixes: #37440