-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: electron #685
fix: electron #685
Conversation
rcl logging uses `program_invocation_name` to determine the log file, chromium mangles the program name to include all args, this causes a ENAMETOOLONG error when starting ros. Workaround is to replace the first occurence of ' -' with the null terminator. see: https://unix.stackexchange.com/questions/432419/unexpected-non-null-encoding-of-proc-pid-cmdline
some info about the problem. electron/chromium changes This is a workaround for it that terminates argv[0] on the first " -" occurrence so ros logging can create usable filenames. @minggangw Do you think if we should workaround it in rclnodejs or try to fix it in rcl? rcl is using |
As the usage of Electron is specific to rclnodejs only, I think it's fine to solve it inside rclnodejs itself.
So, how rcl deals with the log file's name on Windows/macOS? What happens if we are running Election with rclnodejs on Windows when logging, will still meet ENAMETOOLONG? |
https://github.com/chromium/chromium/blob/f18e79d901f56154f80eea1e2218544285e62623/services/service_manager/embedder/set_process_title.cc#L88 It says here that windows and mac doesn't do anything so I believe that this only affects linux. |
I see, so I reckon we will not have this kind of problem on Windows/macOS and this PR looks good now 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on this issue, lgtm and thanks!
@koonpeng would you please change the status to “Ready for review”, so I can merge this PR. |
I just updated to status. Thanks! |
* workaround process name mangling by chromium rcl logging uses `program_invocation_name` to determine the log file, chromium mangles the program name to include all args, this causes a ENAMETOOLONG error when starting ros. Workaround is to replace the first occurence of ' -' with the null terminator. see: https://unix.stackexchange.com/questions/432419/unexpected-non-null-encoding-of-proc-pid-cmdline * fix gcc warning * only enable workaround for linux and glibc
Workaround ENAMETOOLONG error when running in electron renderer process.
With this PR in electron electron/electron#24659, rclnodejs is able to run in electron's main process and renderer process with
allowRendererProcessReuse
set tofalse
.