Build compiler with -Dexecution_context on Windows [fixup #16447]#16502
Conversation
|
This breaks the interpreter on Windows: https://github.com/crystal-lang/crystal/actions/runs/20170611171/job/57926651383 We probably need to pay special attention to the interpreter, because we spawn fibers from the interpreted program in the interpeter itself. With |
|
Good point. We shouldn't resize the default context and instead create a dedicated parallel context for codegen only. Or create a concurrent context for running the interpreted code. Or both. |
|
What's weird is that preview_mt worked (oh, no stealing) 🤨 |
… the same time (#16503) When changing one of these files, we're often forgetting to change the other (latest example: #16502). Most changes affect both, so I think it makes sense to add this reminder. In cases where a change is only relevant for one of these files, we can ignore this failure. It might be possible to use a more elaborate mechanism to clarify that it's indeed fine to change only one, but this seems too much effort. The main goal is to avoid neglecting changes that should go in both.
|
I finally reproduced locally. I tried a few things (always run interpreter in a specific single-threaded context, disabling the PCRE2 thread local, but to no avail. Then I looked at the backtrace... and the error is on the following line:
|
|
This is related to reusing a dead stack fiber set on the current thread: Which would point the issue to the following line: crystal/src/fiber/stack_pool.cr Line 90 in be103f8 |
|
And this is likely related to the interpreter always releasing the fiber stack immediately: crystal/src/compiler/crystal/interpreter/context.cr Lines 117 to 128 in be103f8 I'll try to add an option to |
…ang#16502)" This reverts commit 0c7227b.
|
The bug is fixed in #16518. See this example run. |
In #16447 we forgot to add the
Makefilechange toMakefile.winas well.