ConEmu
ConEmu copied to clipboard
Excessive waiting after CRT free process exits
Versions
ConEmu build: 230724 x64 OS version: Windows 10 x64 1511 Used shell version: ConEmu, cmd / sh
Problem description
Tiny CRT free programs wait for a very long time after process exit. This is most likely the injected ConEmu thread waiting for all threads to exit or waiting for something else maybe.
The result is that after a program has returned from its main
/ mainCRTStartup
or just its entrypoint, it waits too long before actually returning control back to the terminal and thrashes the return exit code.
Doing an explicit ExitProcess
"solves" the problem, but it is rather brute force.
This behavior is not in standard cmd.exe
, it never waits and always returns the expected exit code even without an ExitProcess
.
Steps to reproduce
This is the shortest possible example that will reproduce the waiting, run this in a ConEmu cmd.exe
terminal:
-
echo mov $123,%eax;ret | gcc -xassembler -nostartfiles -
-
a & echo %errorlevel%
- <-- wait for 30 seconds -->
Actual results
0
Expected results
123