Bug 46786 - Process.GetProcessesByName(...) does not return processes
Summary: Process.GetProcessesByName(...) does not return processes
Alias: None
Product: Class Libraries
Classification: Mono
Component: System (show other bugs)
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)

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


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

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