Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8605937
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T02:58:11+00:00 2026-06-12T02:58:11+00:00

I ask for your patience about the lack of code snippets in this question

  • 0

I ask for your patience about the lack of code snippets in this question and the its vagueness, but I’m totally clueless, I don’t have any clue about the location of the bug, and I cannot paste an entire application.

I have a cross platform application which opens a file through the normal C API (fopen etc), writes some data (first passing the buffer to zlib to deflate it, but I don’t think that this is relevant) for a consistent time, and finally flushes and close it.

This works perfectly fine on all platform, except for the 64 bit build on Windows OS x64 with UAC turned on. Basically, on that precise setup, it seems that the file buffer is literally interlaced with what I’ve sent to stdout between the time I open the file and I flush it, as if any write to stdout used the same buffer of the other file.

It is important to note that this shouldn’t be related to any file system virtualization (the VirtualStore mechanism), as I’m writing in %USERPROFILE%\Saved Games\. The problem is surely related to UAC because if I turn it off, the problem isn’t happening. No problem in wine64 also.

Any pointer is valuable. Compiler is g++ 4.7.0 (cross compiling from linux).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T02:58:12+00:00Added an answer on June 12, 2026 at 2:58 am

    I have found a workaround for this problem.

    First blocker was that I compiled my application with -mwindows, and that prevented my application to be attached to the parent process console. But switching to -mconsole didn’t just fix it up. Even with this change everything I sent to stdout wasn’t being sent to the console. I didn’t state this issue in the question because it wasn’t a big deal, the application has another sort of console in it.

    I am certain that the whole problem is due to some bug (or some very poorly documented behaviour change) in msvcrt. Basically, when my application starts up, stdout is a valid pointer, but it is not really attached to the parent console. I have to do a freopen( "CON", "wt", stdout ); to see the output. Besides, fileno(stdout) without UAC returns 1 correctly, but with UAC on, stdout is still a valid pointer, but a call to fileno(stdout) return -1! I am wondering then where is really stdout pointing to in the second case.

    It is interesting to note that when compiling with -mwindows, fileno(stdout) returns 3! I don’t know if the POSIX standard requires stdout to have a file descriptor number of 1, but the choice of 3 is, at least, unusual.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'd like to ask your opinion on this. This is a theoretical question. I'm
I am quite new about using Solr, but would like to ask your help.
Greeting everyone, may I ask your help for following question? I'm using following code
I'm stuck with a problem and ask for your help. It's about navigation within
I have difficulty to solve this and would ask your help ! I'm trying
I want to ask for your prefered way to test Java EE code? I
I use c#, linq and EF4 I would like ask your help. My question:
I am writing to ask your opinion on how to interpret this case. I
I want to ask your opinion about one specific aspect of endless Qt vs
Hello I would like to ask your help regarding javascript code, how do I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.