Bug 25224 - stack overflow after printfn something
Summary: stack overflow after printfn something
Alias: None
Product: Runtime
Classification: Mono
Component: JIT (show other bugs)
Version: 5.10 (2017-12)
Hardware: PC All
: --- normal
Target Milestone: ---
Assignee: jaykrell
Depends on:
Reported: 2014-12-10 07:20 UTC by ZAN DoYe
Modified: 2018-03-19 13:37 UTC (History)
6 users (show)

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


Description ZAN DoYe 2014-12-10 07:20:39 UTC
let rec a ()= printfn "%d" 1; b ()
and b ()= a ()
let ()= a ()

compiled with fsharp
The 3 lines program above causes stack overflow.
If I replace `"%d" 1' with `"1"', the program just keep running properly.
Comment 1 Zoltan Varga 2014-12-11 13:29:32 UTC
Seems to be caused by missing tail call optimization.
Comment 2 Zoltan Varga 2014-12-11 15:40:19 UTC
Fixed in mono master ca0dd5c0bb0f600331aac3c6b8d0579e37cdd0c7.
Comment 3 Zoltan Varga 2014-12-11 17:52:23 UTC
Reverted the fix as it causes a perf regression.
Comment 4 Ludovic Henry 2018-01-05 13:47:31 UTC
I can reproduce with Mono (2017-12/ec4a957151a).
Comment 5 Ludovic Henry 2018-02-25 23:11:59 UTC
Comment 6 Ludovic Henry 2018-03-09 20:10:59 UTC
Comment 7 Ludovic Henry 2018-03-09 20:12:03 UTC
Fixed in master with https://github.com/mono/mono/commit/b4ee86154fce71ba4eb96f4c591a5ce236d23b85

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 25224 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: