Open Bug 1551254 Opened 6 years ago Updated 3 years ago

No mechanism of printf seems to work with `./mach run` on windows

Categories

(Firefox Build System :: General, defect)

defect

Tracking

(Not tracked)

People

(Reporter: kats, Unassigned)

Details

It used to be that if you added a printf_stderr to the code, and then ran like so:
./mach run 2>&1 | tee log
it would output your printf to the console. However at some point (in the last year or so) that seems to have broken.

I tried the patch from bug 1257155 along with various other things (disabling sandboxing, the -console and -attach-console flags, etc.) and nothing seems to work. I also tried using MOZ_LOG instead of printf and MOZ_LOG_FILE to send it to a file per https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Gecko_Logging and that doesn't seem to work either. So now I'm just at my wits end.

Aaron, do you know of some way to make this work? It may or may not be related to the launcher process; bug 1528963 seems to indicate that it might be.

Flags: needinfo?(aklotz)

I also saw the problem with local build on Windows. I temporarily workaround it by enabling ASan.
https://developer.mozilla.org/en-US/docs/Mozilla/Testing/Firefox_and_Address_Sanitizer#Creating_local_builds_on_Windows

If you run ./obj-x86_64-pc-mingw32/dist/bin/firefox.exe directly, tee works as expected. This is not a Firefox problem but a ./mach run problem.

Component: Widget: Win32 → General
Product: Core → Firefox Build System
Summary: No mechanism of printf seems to work on windows → No mechanism of printf seems to work with `./mach run` on windows

Indeed, you're right (thanks!). For future reference I get printf_stderr in the GPU process by doing this:

  • create a profile for testing
  • run objdir/dist/bin/firefox.exe --wait-for-browser -P test_profile_name 2>&1 | tee log
Flags: needinfo?(aklotz)
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.