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

Projects
None yet
2 participants
@hypersw
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

This comment has been minimized.

Show comment
Hide comment
@Maximus5

Maximus5 Dec 17, 2015

Owner

151217?

Owner

Maximus5 commented Dec 17, 2015

151217?

@hypersw

This comment has been minimized.

Show comment
Hide comment
@hypersw

hypersw Dec 27, 2015

Collaborator

untitled20151227071212

untitled20151227071251

So no.

Collaborator

hypersw commented Dec 27, 2015

untitled20151227071212

untitled20151227071251

So no.

@Maximus5

This comment has been minimized.

Show comment
Hide comment
@Maximus5

Maximus5 Dec 27, 2015

Owner

Revokes?

Owner

Maximus5 commented Dec 27, 2015

Revokes?

@hypersw

This comment has been minimized.

Show comment
Hide comment
@hypersw

hypersw Dec 27, 2015

Collaborator

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).

Collaborator

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

This comment has been minimized.

Show comment
Hide comment
@hypersw

hypersw Dec 27, 2015

Collaborator

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

Collaborator

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

This comment has been minimized.

Show comment
Hide comment
@hypersw

This comment has been minimized.

Show comment
Hide comment
@hypersw

hypersw Feb 13, 2016

Collaborator

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.

Collaborator

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

Maximus5/conemu-inside#4: Don't show ‘Can't create new virtual consol…
…e’ error if parent was killed during initialization.
@Maximus5

This comment has been minimized.

Show comment
Hide comment
@Maximus5

Maximus5 May 17, 2016

Owner

Is it fixed?

Owner

Maximus5 commented May 17, 2016

Is it fixed?

@hypersw

This comment has been minimized.

Show comment
Hide comment
@hypersw

hypersw May 17, 2016

Collaborator

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

Collaborator

hypersw commented May 17, 2016

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

@hypersw

This comment has been minimized.

Show comment
Hide comment
@hypersw

hypersw May 18, 2016

Collaborator

untitled20160518034812
fresh one

Collaborator

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