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
Open

Comments

@hypersw
Copy link
Collaborator

@hypersw 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

@Maximus5 Maximus5 commented Dec 17, 2015

151217?

@hypersw
Copy link
Collaborator Author

@hypersw hypersw commented Dec 27, 2015

untitled20151227071212

untitled20151227071251

So no.

@Maximus5
Copy link
Owner

@Maximus5 Maximus5 commented Dec 27, 2015

Revokes?

@hypersw
Copy link
Collaborator Author

@hypersw 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 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.

@hypersw
Copy link
Collaborator Author

@hypersw 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

@Maximus5 Maximus5 commented May 17, 2016

Is it fixed?

@hypersw
Copy link
Collaborator Author

@hypersw 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 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
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.