#126 Can not redirect output from DllMain

WSL
closed
None
Support
fixed
featured-pre-wsl
False
2013-02-18
2002-04-16
No

When I print from DllMain and redirect
all output to file, I miss output from
DllMain(DLL_THREAD_DETACH).

$ a.exe
DLL_PROCESS_ATTACH
main
output
DLL_PROCESS_DETACH
$ a.exe > log 2>&1
$ cat log
DLL_PROCESS_ATTACH
main
output
$

Please see example in the attachment.

Discussion

  • Aleksey Dukhnyakov

    Example

     
    Attachments
  • Aleksey Dukhnyakov

    Logged In: YES
    user_id=516883

    Doesn't matter what I am using:
    printf or fprintf(stderr,...),
    cygwin bash or command promt

    The same programs for MSVC works properly

     
  • Danny Smith

    Danny Smith - 2002-04-17

    Logged In: YES
    user_id=11494

    Thanks for the report and test case. I can confirm that bug
    and have a naive fix for it that works for your test case
    and for another one that I've coded: simply call _flushall
    () as the last thing that DllMainCRTStartup does on
    DLL_PROCESS_DETACH. However, that seems too easy and I
    need to do a lot more testing. Care to help with testing a
    patched dllcrt2.o?

     
  • Aleksey Dukhnyakov

    Logged In: YES
    user_id=516883

    Thanks a lot!

    We will use workaround _flushall() till new release of
    MINGW.
    By the way, where I can find patched dllcrt2.o ?
    In CVS ?

     
  • Danny Smith

    Danny Smith - 2002-05-05

    Logged In: YES
    user_id=11494

    Fixed in latest mingw-runtime-2.0 snapshot.
    Danny

     
  • Danny Smith

    Danny Smith - 2002-05-05
    • status: open --> closed-remind
     
  • Earnie Boyd

    Earnie Boyd - 2013-01-30
    • labels: mingw runtime (deprecated use WSL) -->
    • status: closed-remind --> closed
    • resolution: --> fixed
    • category: --> Known_bugs
    • milestone: --> WSL
     
  • Earnie Boyd

    Earnie Boyd - 2013-02-18
    • type: --> Support
    • category: Known_bugs --> featured-pre-wsl
    • patch_attached: --> False
     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks