Maximus5 / ConEmu

Customizable Windows terminal with tabs, splits, quake-style, hotkeys and more
https://conemu.github.io/
BSD 3-Clause "New" or "Revised" License
8.55k stars 571 forks source link

Crash only within ConEmu when running jom.exe #2356

Closed alberthdev closed 3 years ago

alberthdev commented 3 years ago

Versions

ConEmu build: 210816 x32 OS version: Windows Server 2019 Standard Evaluation x64 Used shell version (Far Manager, git-bash, cmd, powershell, cygwin, whatever): cmd

Problem description

When using Jom v1.1.3 to try and build a nmake Makefile in ConEmu via cmd, Jom will crash. Repeating the same exact commands in the Windows Command Prompt yields no crash.

Steps to reproduce

  1. Ensure that you have the following installed:

  2. Setup the test case. Create a directory that holds the makefile defined below. To replicate exactly, this was contained within C:\JomCrashRepro.

    • Makefile:

      foo: @ @ perl -e "print 'Hello World'"

      all: foo

  3. Run the commands defined below to reproduce this crash.

    • In cmd, this can be ran without any modification.
    • In ConEmu, for debugging purposes:
      • Under Settings > General, I ensured that "Inject ConEmuHk.dll into all processes started in ConEmu tabs" was checked; and
      • Under Settings > Startup > Environment, I added set ConEmuReportExe=jom.exe for doing the memory dump.
      • I restarted ConEmu after those changes were made prior to running the commands.
    • Commands:

      call "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\Common7\Tools\VsDevCmd.bat" -arch=x86 -host_arch=amd64 -vcvars_ver=14.16 cd \JomCrashRepro C:\staging\jom-1.1.3\jom /VERSION C:\staging\jom-1.1.3\jom /J2 echo %ERRORLEVEL%

Actual results

Crash of jom.exe with ConEmuHk.dll as the faulting module.

Expected results

Expected the jom process to complete successfully, with output of "Hello World".

Additional files

More details (screenshots, output, etc.) can be found here (this was done to keep this issue succinct): https://alberthdev.github.io/issues-extra/Maximus5/ConEmu/conemu-crash-with-jom/

Memory dump produced from the steps above: https://drive.google.com/file/d/1maT1F_xc7S0RT7bskpCDj6IUdPpUc2CU/view?usp=sharing

ConEmu logs and config XML: https://drive.google.com/file/d/1_ESWn9MWwiM2pctXOCoXKvZ_oNRgBZVk/view?usp=sharing

Maximus5 commented 3 years ago

Thank you for the report. It would be nice to have a crash dump of the moment of the crash. The dump uploaded by you is the moment of the ConEmu message appearance (dll is loaded), it's not useful to find the problem.

To make a dump I'd suggest at the moment the dialog appears execute from ConEmu menu "Debug / Debug active process" and than continue. ConEmu will create a dump at the moment of the crash. Or you may use any other debugger of your choice.

Maximus5 commented 3 years ago

Nevermind. I've managed to reproduce. Actually, that looks like a bug in jom (it calls CreateProcess with both lpApplicationName and lpCommandLine set to empty strings). But of course ConEmu should not crash in that case.

Maximus5 commented 3 years ago

https://conemu.github.io/blog/2021/08/22/Build-210822.html

alberthdev commented 3 years ago

Confirmed that we're all good now with the latest build. Interesting that jom is trying to run empty commands... probably worth fixing sometime. Thanks for your quick fix + help!