Hi All,
I am using ACE.
when i try to open a file with ACE_OS::fopen function in append mode, my program crashes.
There seems to be no problem when i try ACE_OS::fopen function with write or read mode.

code example.

ACE_OS::fopen("demo.txt", ACE_TEXT("w")); // working fine
ACE_OS::fopen("demo.txt", ACE_TEXT("r")); // working fine

ACE_OS::fopen("demo.txt", ACE_TEXT("a")); // program crashes

when i debug the the program crashes in os_ns_thread.inl file
in ACE_OS::thread_mutex_lock function

Regards,
Amit Pawar

Recommended Answers

All 3 Replies

Does this crash?

int main ( ) {
  ACE_OS::fopen("demo.txt", ACE_TEXT("a"));
}

If not, then there's a bug somewhere else in your program and what you're seeing is fallout from the result of your real bug.

Does this crash?

int main ( ) {
  ACE_OS::fopen("demo.txt", ACE_TEXT("a"));
}

If not, then there's a bug somewhere else in your program and what you're seeing is fallout from the result of your real bug.

HI Salem,
Thanks for the reply,
I had already created a new project, which only included

ACE_OS::fopen("demo.txt", ACE_TEXT("a"));

Then also program crashes:(

Well if you've got a really simple test case, then you need to be showing it to the author / maintainer of the package.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.