Bug 25720 - Runtime crashing when evaluating System.Diagnostics.Process.HasExited property
Summary: Runtime crashing when evaluating System.Diagnostics.Process.HasExited property
Status: RESOLVED FIXED
Alias: None
Product: Runtime
Classification: Mono
Component: General (show other bugs)
Version: unspecified
Hardware: All All
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2015-01-05 14:38 UTC by Eirik Tsarpalis
Modified: 2015-02-12 14:26 UTC (History)
6 users (show)

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


Attachments

Description Eirik Tsarpalis 2015-01-05 14:38:09 UTC
Running the following code (in F#) results in consistent crashing of the mono runtime:
```
let p = System.Diagnostics.Process.GetCurrentProcess()
p.HasExited
```
with the following error
```
* Assertion at processes.c:2595, condition `mp' not met

Stacktrace:

  at <unknown> <0xffffffff>
  at (wrapper managed-to-native) System.Diagnostics.Process.ExitCode_internal (intptr) <0xffffffff>
  at System.Diagnostics.Process.get_ExitCode () <0x0002f>
```
Comment 1 Zoltan Varga 2015-01-06 13:02:11 UTC
What mono version is this ? Please try at least mono 3.12, many process crashes etc. were fixed in that version.
Comment 2 Eirik Tsarpalis 2015-01-07 06:37:24 UTC
It's mono 3.12 from the beta channel of OSX

Mono JIT compiler version 3.12.0 ((detached/a813491 Thu Dec 11 12:24:44 EST 2014)
Comment 3 Zoltan Varga 2015-01-07 07:06:17 UTC
I can reproduce this.
Comment 4 Zoltan Varga 2015-01-08 04:48:45 UTC
Fixed in mono master b1038846342d5b7bb030c58ec4c463de6d12f06e.
Comment 5 Prerana 2015-01-16 02:32:29 UTC
When this fix will be released? I am unable to pull it from mono masters. 
Xamarin Studio currently is :

Xamarin Studio
Version 5.7 (build 661)
Installation UUID: fccf861a-7e5e-44b3-bba1-fa9c8372a28f
Runtime:
	Mono 3.12.0 ((detached/a813491)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 312000068
Comment 6 Prerana 2015-01-16 03:58:53 UTC
When this fix will be released? I am unable to pull it from mono masters. 
Xamarin Studio currently is :

Xamarin Studio
Version 5.7 (build 661)
Installation UUID: fccf861a-7e5e-44b3-bba1-fa9c8372a28f
Runtime:
	Mono 3.12.0 ((detached/a813491)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 312000068
Comment 7 Zoltan Varga 2015-01-16 08:27:28 UTC
It will be in the next major mono release after 3.12. As a workaround, avoid calling HasExited on
the current process, i.e.
if (proc != Process.CurrentProcess)
    proc.HasExited ...
Comment 8 Vsevolod Kukol 2015-01-21 08:13:19 UTC
The recent official debian packages (http://origin-download.mono-project.com/repo/debian) seem to be affected, too. And there is no way back for Linux users (ok only the distribution packages, which are quite old on e.g.  Ubuntu).
Is there no way to merge the fix into the 3.12 branch for the official debian release?
Comment 9 henrik 2015-02-12 12:02:39 UTC
Duplicate to https://bugzilla.xamarin.com/show_bug.cgi?id=26514 ?

Fixed by b103884?
Comment 10 henrik 2015-02-12 13:26:36 UTC
The workaround doesn't work in this code https://github.com/fsprojects/Paket/commit/25c363a0d35ca7fd8e3ef48c34ccd74d0071f0da
Comment 11 Zoltan Varga 2015-02-12 14:26:38 UTC
Try proc.Id != Process.GetCurrentProcess ().Id. That seems to work in 3.12 too.

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.


Create a new report for Bug 25720 on Developer Community or GitHub if you have new information to add and do not yet see a matching report.

  • Export the original title and description: Developer Community HTML or GitHub Markdown
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments


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.

Related Links: