Subprocess command lines are missing substrings on Linux |
||||||
Issue descriptionout/Default/chrome --ash-host-window-bounds="1024x768" --user-data-dir=/w/udd --ash-dev-shortcuts --ash-debug-shortcuts --mash ps aux | grep out/Default jamesco+ 77255 3.6 0.1 555460 158228 pts/4 Sl+ 12:17 0:02 /w/chrome/src/out/Default/chrome --type=utility --field-trial-handle=5947800527288043731,14672982841380830024,131072 --lang=en-US --no-sandbox --is-service --disable-service-process-resource-loading --message-loop-type-ui --ash-debug-shortcuts --ash-dev-shortcuts --ash-host-window-bounds=1024x768 --login-profile=test-user --login-user=stub-user@example.com --mash --user-data-dir -dir=/w/udd --homedir=/usr/local/google/home/jamescook --service-request-channel-token=F245734EC2AEB37699C9DA0123D732E3 --shared-files=v8_natives_data:100,v8_snapshot_data:101 jamesco+ 77256 2.2 0.0 460212 110144 pts/4 Sl+ 12:17 0:01 /w/chrome/src/out/Default/chrome --type=utility --field-trial-handle=5947800527288043731,14672982841380830024,131072 --lang=en-US --no-sandbox --is-service --disable-service-process-resource-loading --ash-debug-shortcuts --ash-dev-shortcuts --ash-host-window-bounds=1024x768 --login-profile=test-user --login-user=stub-user@example.com --mash --user-data-dir -dir=/w/udd --homedir=/usr/local/google/home/jamescook --service-request-channel-token=23DBE446592D764BA78F1F7838D47870 --shared-files=v8_natives_data:100,v8_snapshot_data:101 jamesco+ 77257 0.9 0.0 428740 92452 pts/4 Sl+ 12:17 0:00 /w/chrome/src/out/Default/chrome --type=utility --field-trial-handle=5947800527288043731,14672982841380830024,131072 --lang=en-US --no-sandbox --is-service --disable-service-process-resource- -dir=/w/udd --homedir=/usr/local/google/home/jamescook --service-request-channel-token=7F79E9F59C6FB62C308BFD7019CA21DF --shared-files=v8_natives_data:100,v8_snapshot_data:101 Note that "--user-data-dir" is followed by "-dir=/w/udd". Also, "--disable-service-process-resource-" looks truncated.
,
Oct 6 2017
Before you sync, could you tell me what revision you're at? I'm curious as to what could lead to the manged command lines. Also, I assume this is a release build with DCHECKS, is that right?
,
Oct 9 2017
I already synced. I don't see it at r507320. I'm not sure what revision I was at before. This was release with dcheck, correct.
,
Oct 10 2017
Weird. I'm going to move to fixed. Hopefully it doesn't come back.
,
Oct 11 2017
I just saw something similar without mash. "ps aux" shows me a command line for gpu-broker followed by hundreds of space characters. jamesco+ 107100 0.0 0.0 398980 20796 ? S 08:20 0:00 /opt/google/chrome/chrome --type=gpu-broker <<<< spaces end here I'm at cd48a52a45c78b5db09dde9bfcd5f022d61db994 synced today. This is odd. I wonder if this is a chrome thing or a Goobuntu bug or me just misunderstanding what ps is supposed to do. Up to you if you want to reopen this. It doesn't seem to be causing problems.
,
Oct 12 2017
piman / marcheu - Did you guys see command line problems recently? I saw this today with the --login-user=stub flag truncated to "--login-user=st" followed by 2 spaces. /proc shows 2 null bytes after that flag, before --mash. jamescook@jamescook:/x/chromeos$ hd /proc/192406/cmdline 00000000 2f 77 2f 63 68 72 6f 6d 65 2f 73 72 63 2f 6f 75 |/w/chrome/src/ou| 00000010 74 2f 44 65 66 61 75 6c 74 2f 63 68 72 6f 6d 65 |t/Default/chrome| 00000020 20 2d 2d 74 79 70 65 3d 75 74 69 6c 69 74 79 20 | --type=utility | 00000030 2d 2d 66 69 65 6c 64 2d 74 72 69 61 6c 2d 68 61 |--field-trial-ha| 00000040 6e 64 6c 65 3d 35 35 32 36 35 36 34 31 30 39 32 |ndle=55265641092| 00000050 35 38 32 35 32 33 33 32 2c 31 33 36 38 35 36 33 |58252332,1368563| 00000060 30 36 38 31 36 33 38 31 32 30 36 31 31 2c 31 33 |0681638120611,13| 00000070 31 30 37 32 20 2d 2d 6c 61 6e 67 3d 65 6e 2d 55 |1072 --lang=en-U| 00000080 53 20 2d 2d 6e 6f 2d 73 61 6e 64 62 6f 78 20 2d |S --no-sandbox -| 00000090 2d 6e 6f 2d 73 61 6e 64 62 6f 78 20 2d 2d 6d 61 |-no-sandbox --ma| 000000a0 73 68 2d 73 65 72 76 69 63 65 2d 6e 61 6d 65 3d |sh-service-name=| 000000b0 75 69 20 2d 2d 6d 65 73 73 61 67 65 2d 6c 6f 6f |ui --message-loo| 000000c0 70 2d 74 79 70 65 2d 75 69 20 2d 2d 61 73 68 2d |p-type-ui --ash-| 000000d0 64 65 62 75 67 2d 73 68 6f 72 74 63 75 74 73 20 |debug-shortcuts | 000000e0 2d 2d 61 73 68 2d 64 65 76 2d 73 68 6f 72 74 63 |--ash-dev-shortc| 000000f0 75 74 73 20 2d 2d 61 73 68 2d 68 6f 73 74 2d 77 |uts --ash-host-w| 00000100 69 6e 64 6f 77 2d 62 6f 75 6e 64 73 3d 31 30 32 |indow-bounds=102| 00000110 34 78 37 36 38 20 2d 2d 6c 6f 67 69 6e 2d 70 72 |4x768 --login-pr| 00000120 6f 66 69 6c 65 3d 74 65 73 74 2d 75 73 65 72 20 |ofile=test-user | 00000130 2d 2d 6c 6f 67 69 6e 2d 75 73 65 72 3d 73 74 00 |--login-user=st.| 00000140 00 2d 2d 6d 61 73 68 00 2d 2d 6e 6f 2d 73 61 6e |.--mash.--no-san|
,
Oct 12 2017
Is the command-line (as seen by base::CommandLine::ForCurrentProcess) actually broken, or just what shows up in ps? Child processes don't run the way you would normally expect them too (either fork from the zygote without exec, or exec "/proc/self/exe"), and so normally you wouldn't see the command line show up in ps, but IIRC we go through special hacks to modify the arguments region to try to show the right thing.
,
Oct 12 2017
piman, I get the correct values in base::CommandLine::ForCurrentProcess(). Maybe the hacks are broken. Do you remember where they are? sky, I'll take this, since you can't repro. Frankly, though, I may just unassign if it isn't obvious. Note to self: jamesco+ 30380 10.0 0.1 613240 160112 pts/26 Sl+ 14:40 0:02 /w/chrome/src/out/Default/chrome --type=utility --field-trial-handle=9089763872225323766,4378837369564525740,131072 --lang=en-US --no-sandbox --no-sandbox --mash-service-name=ui --message-loop-type-ui --ash-debug-shortcuts --ash-dev-shortcuts --ash-host-window-bounds=1024x768 --login-profile=test-user --login-user=st --mash --no-sandbox --user-data-dir=/w/udd --user-data-dir=/w/udd --homedir=/usr/local/google/home/jamescook --service-request-channel-token=06A9A6CA05D7FDDCBF4C5A70F59427D2 --shared-files=v8_natives_data:100,v8_snapshot_data:101 "--login-user=st" appears truncated. However, logging inside this process shows the full command line: /proc/self/exe --type=utility --field-trial-handle=9089763872225323766,4378837369564525740,131072 --lang=en-US --no-sandbox --no-sandbox --mash-service-name=ash --message-loop-type-ui --ash-debug-shortcuts --ash-dev-shortcuts --ash-host-window-bounds=1024x768 --login-profile=test-user --login-user=stub-user@example.com --mash --no-sandbox --user-data-dir=/w/udd --user-data-dir=/w/udd --homedir=/usr/local/google/home/jamescook --service-request-channel-token=2C563AB6E59B1B7D0210664B14911FA2 --shared-files=v8_natives_data:100,v8_snapshot_data:101
,
Oct 12 2017
Rather, this was the output of ps (the other was for UI service process): jamesco+ 30381 5.7 0.0 488684 112304 pts/26 Sl+ 14:40 0:01 /w/chrome/src/out/Default/chrome --type=utility --field-trial-handle=9089763872225323766,4378837369564525740,131072 --lang=en-US --no-sandbox --no-sandbox --mash-service-name=ash --message-loop-type-ui --ash-debug-shortcuts --ash-dev-shortcuts --ash-host-window-bounds=1024x768 --login-profile=test-user --login-user=st --mash --no-sandbox --user-data-dir=/w/udd --user-data-dir=/w/udd --homedir=/usr/local/google/home/jamescook --service-request-channel-token=2C563AB6E59B1B7D0210664B14911FA2 --shared-files=v8_natives_data:100,v8_snapshot_data:101
,
Oct 12 2017
I believe the hacks are in https://cs.chromium.org/chromium/src/services/service_manager/embedder/set_process_title.cc?q=SetProcessTitleFromCommandLine&sq=package:chromium&dr=CSs&l=39 and https://cs.chromium.org/chromium/src/services/service_manager/embedder/set_process_title_linux.cc?sq=package:chromium&dr=CSs&l=54
,
Oct 26 2017
I'm not going to get to this. If anyone picks this up in the future, I was building with target_os="chromeos" on Goobuntu Linux. The setproctitle() hacks seem suspicious.
,
Oct 3
|
||||||
►
Sign in to add a comment |
||||||
Comment 1 by sky@chromium.org
, Oct 6 2017