Bug 46786 - Process.GetProcessesByName(...) does not return processes
Summary: Process.GetProcessesByName(...) does not return processes
Alias: None
Product: Class Libraries
Classification: Mono
Component: System ()
Version: 4.8.0 (C9)
Hardware: PC Linux
: --- normal
Target Milestone: Untriaged
Assignee: Ludovic Henry
Depends on:
Reported: 2016-11-11 08:45 UTC by Roman
Modified: 2017-10-12 12:05 UTC (History)
2 users (show)

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:

Description Roman 2016-11-11 08:45:05 UTC
I've created first application which has name a SlideShow.exe.
When I ran it I look via break point process name after such code:
Process process = Process.GetCurrentProcess();

that process.ProcessName is "SlideShow".

So than I ran second another application which must get processes by name.

Process[] processes = Process.GetProcessesByName("SlideShow");

and oops! processes.Length is 0.

Why? What is it a rubbish?
Comment 1 Ludovic Henry 2017-02-08 20:49:35 UTC
Hi Roman, can you still reproduce? If yes, can you please provide a repro? Thank you.
Comment 2 Roman 2017-02-09 15:13:57 UTC
Hi Ludovic, I don't have enough time for testing your bugs.
I use mono because I like linux and hate microsoft. But if xamarin gets money for xamarin sdk and xamarin studio that let's them to work for gotten money. And if I know c++ I'd never use mono on linux OS.
Comment 3 Ludovic Henry 2017-04-10 17:57:20 UTC
If you can still reproduce, please reopen the bug with more information. Thank you.
Comment 4 Roman 2017-04-14 08:23:16 UTC
Ok, I've reproduced this bug. 

destructor@babylon-5:~ > mono --version
Mono JIT compiler version 4.8.1 (Stable Wed Apr 12 12:00:40 UTC 2017)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
        TLS:           __thread
        SIGSEGV:       altstack
        Notifications: epoll
        Architecture:  amd64
        Disabled:      none
        Misc:          softdebug 
        LLVM:          supported, not enabled.
        GC:            sgen

video here https://www.dropbox.com/s/v89hdrvoy7iphyd/Process_GetProcessesByName.ogv?dl=0

solution for self-testing here https://www.dropbox.com/s/q6mgyersyhzq8cg/TestProcess.7z?dl=0

Any questions?

Good luck!
Comment 5 Marek Safar 2017-10-12 12:05:23 UTC
This works for me with Mono 5.4

The process name from your test I get is

Current process name is mono-sgen64