Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ConEmu Inside HWND Crashes Within Startup If the Parent Process Revokes HWND #4

Open
hypersw opened this issue Dec 15, 2015 · 10 comments

Comments

@hypersw
Copy link
Collaborator

hypersw commented Dec 15, 2015

  • Make a HWND.
  • Run ConEmu with the inside-HWND parameter.
  • Kill the window immediately. As it requires a yield of control on that thread, it'll actually wait until you exit the current message handler, so just spawn ConEmu.exe and either kill the HWND or the process altogether. Stopping with debugger is a good example.

=>

ConEmu asserts with

Can't create DC window!
LastError=0x00000057
The parameter is incorrect.
@Maximus5
Copy link
Owner

151217?

@hypersw
Copy link
Collaborator Author

hypersw commented Dec 27, 2015

untitled20151227071212

untitled20151227071251

So no.

@Maximus5
Copy link
Owner

Revokes?

@hypersw
Copy link
Collaborator Author

hypersw commented Dec 27, 2015

Destroys, or whatever.
So HWND is available and valid when ConEmu gets it on the commandline, but when it tries to use this HWND, it's already gone. I guess that's the cause.

I believe what ConEmu does with HWNDs makes its and host process' threads of execution make sync cross-calls sometimes, which means that ConEmu will be waiting for the host process callback to execute. This increases the risk, as it gives the host process an explicit chance to do smth to its HWND (and waits for it).

@hypersw
Copy link
Collaborator Author

hypersw commented Dec 27, 2015

Simple repro: run conemu-inside in debugger, set a breakpoint on after starting the ConEmu process, break on it, then kill the debuggee.

@Maximus5
Copy link
Owner

Maximus5 commented Feb 3, 2016

@hypersw
Copy link
Collaborator Author

hypersw commented Feb 13, 2016

untitled20160213164109

On a fresh build. Though looks like a new message (on some next init stage).

Repro is the same: in ConEmuSession::.ctor, after processNew.Start(), kill the WinForms-hosting process. ConEmu process is left alone in some half-inited state.

Maximus5 added a commit to Maximus5/ConEmu that referenced this issue Feb 14, 2016
…e’ error if parent was killed during initialization.
@Maximus5
Copy link
Owner

Is it fixed?

@hypersw
Copy link
Collaborator Author

hypersw commented May 17, 2016

Not fully. I would still see this window from time to time, rarely now though.

@hypersw
Copy link
Collaborator Author

hypersw commented May 18, 2016

untitled20160518034812
fresh one

hypersw added a commit that referenced this issue May 18, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants