You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Process.Parent property is null on Linux if the process name contains a space #12908
First-Time-IssueEasy issues first time contributors can work on to learn about this projectIssue-BugIssue has been identified as a bug in the productOS-LinuxResolution-FixedThe issue is fixed.Up-for-GrabsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorsWG-Enginecore PowerShell engine, interpreter, and runtime
I'm willing to contribute assuming help is still wanted. I have found a fix by modifying CorePsPlatform.cs, solely. The fix involves skipping the process name, as suggested. I will open a PR once I have approval. :)
note: this is going to be my first ever contribution to open source, so please help me out if I'm missing out any documentation conventions as is considered standard for PRs to this repository.
Since, per standard, the rest of the line should all be numeric fields, it might be valuable to look for the ')' in reverse and then parse from there. You could also do a regular expression, but you have to anchor it to the start and end to ensure proper parsing:
'^\d+ \(.+\) [A-Z] (?<parent>\d+)(?: \d+){48}$'
In the above, the 'parent' named capture group would be the parent PID. The regular expression, while computationally expensive, is probably the most robust way in my opinion.
Bryan Berns (@NoMoreFood) I have accounted for the last occurring ')' using Substring and LastIndexOf, I had a feeling that will be less expensive than a regex but still work everytime, without fail.
I have a question regarding your standard process of raising a PR; will I have to fork the repo and submit a branch from there or will I be added as a collaborator and directly set an upstream branch to this repo?
Standard practice is to fork the repository, create a branch in your repository, and then
submit a pull request to merge changes in that branch into the upstream. One the pull is submitted, this project has a bunch of test that will kick in for coding style and regression testing so watch your PR to make sure those all pass. You'll also likely be asked to create a regression test for this problem.
First-Time-IssueEasy issues first time contributors can work on to learn about this projectIssue-BugIssue has been identified as a bug in the productOS-LinuxResolution-FixedThe issue is fixed.Up-for-GrabsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorsWG-Enginecore PowerShell engine, interpreter, and runtime
Activity
rajdeep-biswas commentedon Jun 8, 2020
I'm willing to contribute assuming help is still wanted. I have found a fix by modifying CorePsPlatform.cs, solely. The fix involves skipping the process name, as suggested. I will open a PR once I have approval. :)
note: this is going to be my first ever contribution to open source, so please help me out if I'm missing out any documentation conventions as is considered standard for PRs to this repository.
NoMoreFood commentedon Jun 9, 2020
Keep in mind that you could have a process name itself with one or more parentheses. Something like:
17718 (really weird process( ) name) T 15873 17718 15873 34816 ....Since, per standard, the rest of the line should all be numeric fields, it might be valuable to look for the ')' in reverse and then parse from there. You could also do a regular expression, but you have to anchor it to the start and end to ensure proper parsing:
'^\d+ \(.+\) [A-Z] (?<parent>\d+)(?: \d+){48}$'In the above, the 'parent' named capture group would be the parent PID. The regular expression, while computationally expensive, is probably the most robust way in my opinion.
rajdeep-biswas commentedon Jun 9, 2020
Bryan Berns (@NoMoreFood) I have accounted for the last occurring ')' using Substring and LastIndexOf, I had a feeling that will be less expensive than a regex but still work everytime, without fail.
I have a question regarding your standard process of raising a PR; will I have to fork the repo and submit a branch from there or will I be added as a collaborator and directly set an upstream branch to this repo?
NoMoreFood commentedon Jun 9, 2020
Standard practice is to fork the repository, create a branch in your repository, and then
submit a pull request to merge changes in that branch into the upstream. One the pull is submitted, this project has a bunch of test that will kick in for coding style and regression testing so watch your PR to make sure those all pass. You'll also likely be asked to create a regression test for this problem.
rajdeep-biswas commentedon Jun 9, 2020
Thanks for the info! I have raised PR #12925