Bug 32539 - Process.ProcessName value fetched using Process.GetProcesses () is trimmed to 15 characters
Summary: Process.ProcessName value fetched using Process.GetProcesses () is trimmed to...
Status: RESOLVED FIXED
Alias: None
Product: Class Libraries
Classification: Mono
Component: System (show other bugs)
Version: unspecified
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: marcos.henrich
URL:
Depends on:
Blocks:
 
Reported: 2015-07-28 14:36 UTC by Manish Sinha
Modified: 2015-08-14 05:19 UTC (History)
2 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Manish Sinha 2015-07-28 14:36:29 UTC
Steps to reproduce

1. Create a Console Project
2. Add this in Main method


> var processes = System.Diagnostics.Process.GetProcesses ();
> foreach (var process in processes) {
> 	try {
>		Console.WriteLine (process.ProcessName +"\t"+process.ProcessName.Length);
>	} catch (Exception) {
>
>	}
>}


and run it. All the process name are trimmed to at max 15 characters.

The same thing happens with process.MainModule.FileName. If the FileName is absolute path, it is not trimmed else if it is launched without command line, then it is trimmed. example

> var processes = System.Diagnostics.Process.GetProcesses ();
>foreach (var process in processes) {
>	try {
>		Console.WriteLine (process.MainModule.FileName +"\t"+process.MainModule.FileName.Length);
>	} catch (Exception) {
>
>	}
>}

> mdworker	8
> Google Chrome H	15
> /Library/Frameworks/Mono.framework/Versions/4.2.0/bin/mono	58
> Google Chrome H	15
> Google Chrome H	15
Comment 1 marcos.henrich 2015-07-29 12:09:54 UTC
Hi Manish,

Thank you for the bug report.

The following pull request fixes the issue:
https://github.com/mono/mono/pull/1952
Comment 2 marcos.henrich 2015-08-11 08:11:30 UTC
Fixed in master 6fc86ee499b93937a52d685a3ca01e5bbecbd0ae.
https://github.com/mono/mono/commit/6fc86ee499b93937a52d685a3ca01e5bbecbd0ae
Comment 3 marcos.henrich 2015-08-14 05:19:56 UTC
Fixed in mono mono-4.2.0-pre2-branch 644d8d657183eb8fd9641a159fec77ce10314b0e
https://github.com/mono/mono/commit/644d8d657183eb8fd9641a159fec77ce10314b0e