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

[windows] DR print to stdout/stderr does not show up in cmd #261

Open
derekbruening opened this issue Nov 27, 2014 · 4 comments
Open

[windows] DR print to stdout/stderr does not show up in cmd #261

derekbruening opened this issue Nov 27, 2014 · 4 comments

Comments

@derekbruening
Copy link
Contributor

From derek.br...@gmail.com on February 18, 2010 20:43:16

we've long had issues with stdout/stderr in the cmd shell

xref:

PR 258731: [Linux] Client output to STDOUT during the exit event is lost

PR 333891: cygwin g++-compiled apps suppress all output from DR, where late
injection resulted in stderr/stdout being messed up

PR 208715 - Determina Case 4237: drinject in cmd.exe produces no
stdout/stderr output

PR 207959 - Determina Case 3481: Standalone unit tests not working on
windows, print to stderr fails issue #142 : Problem running Win64 Intel64 apps not statically linked to
user32.dll - stdin and stdout not acting as expected

filing this new case b/c I didn't realize that our tracedump standalone API
app also has failures to print visible stdout in cmd

Original issue: http://code.google.com/p/dynamorio/issues/detail?id=261

@derekbruening
Copy link
Contributor Author

From derek.br...@gmail.com on April 19, 2010 09:17:00

the issues with drinject are easily fixed: improper handle setup when creating the
child process. that's issue #142 /PR 208715.

this issue is different: DR's NtWriteFile to the stdout/stderr handles does not show
up in the cmd window. this is because WriteFile to a console handle calls
WriteConsole and never gets to NtWriteFile: instead it calls CsrClientCallServer and
csrss handle the write. so DR and clients can't easily write to the cmd console.

Summary: [windows] DR print to stdout/stderr does not show up in cmd

@derekbruening
Copy link
Contributor Author

From derek.br...@gmail.com on May 26, 2010 20:36:04

in r344 :
drsysm, which is already loading a private kernel32,
now exports drsym_write_to_console().

  • Not bothering to support stdout: only stderr.
  • Supports printing to both cmd and other windows.
    Unfortunately there are significant limitations to this console
    printing support:
  • It does not work from the exit event. Once the application terminates
    its state with csrss (toward the very end of ExitProcess), no output
    will show up on the console. We have no good solution here yet as exiting
    early is not ideal.
  • It does not work at all from graphical applications, even when they are
    launched from a console.
  • In the future, with earliest injection ( issue Windows earliest injection #234 ), writing to the
    console may not work from the client init event.

@derekbruening
Copy link
Contributor Author

From bruen...@google.com on February 22, 2013 19:09:09

even with dr_enable_console_printing(), there's not output in cmd on win2k.
this shows up in Dr. Memory where -results_to_stderr is all blank.
redirecting stderr to a file shows it all.

@derekbruening
Copy link
Contributor Author

From bruen...@google.com on February 24, 2013 22:08:42

scratch the win2k comment: that was actually issue #1089

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant