This is Xamarin's bug tracking system. For product support, please use the support links listed in your Xamarin Account.
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: ---
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)

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


Attachments

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

Note You need to log in before you can comment on or make changes to this bug.