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 8020637
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T21:44:36+00:00 2026-06-04T21:44:36+00:00

I wrote a C++ CLI program with MS VC++ 2010 and GCC 4.2.1 (for

  • 0

I wrote a C++ CLI program with MS VC++ 2010 and GCC 4.2.1 (for Mac OS X 10.6 64 bit, in Eclipse).
The program works well under GCC+OS X and most times under Windows. But sometimes it silently freezes. The command line cursor keeps blinking, but the program refuses to continue working.

The following configurations work well:
GCC with ‘Release’ and ‘Debug’ configuration.
VC++ with ‘Debug’ configuration

The error only occurs in the configuration ‘VC++ with ‘Release’ configuration’ under Win 7 32 bit and 64 bit. Unfortunately this is the configuration my customer wants to work with ;-(

I already checked my program high and low and fixed all memory leaks. But this error still occurs. Do you have any ideas how I can find the error?

  • 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-04T21:44:37+00:00Added an answer on June 4, 2026 at 9:44 pm
    • Use logging to narrow down which part of code the program is executing when it crashes. Keep adding log until you narrow it down enough to see the issue.
    • Enable debug information in the release build (both compiler and linker); many variables won’t show up correctly, but it should at least give you sensible backtrace (unless the freeze is due to stack smashing or stack overflow), which is usually enough if you keep functions short and doing just one thing.
    • Memory leaks can’t cause freezes. Other forms of memory misuse are however quite likely to. In my experience overrunning a buffer often cause freezes when that buffer is freed as the free function follows the corrupted block chains. Also watch for any other kind of Undefined Behaviour. There is a lot of it in C/C++ and it usually behaves as you expect in debug and completely randomly when optimized.
    • Try building and running the program under DUMA library to check for buffer overruns. Be warned though that:
      • It requires a lot of memory. I mean easily like thousand times more. So you can only test on simple cases.
      • Microsoft headers tend to abuse their internal allocation functions and mismatch e.g. regular malloc and internal __debug_free (or the other way ’round). So might get a few cases that you’ll have to carefully workaround by including those system headers into the duma one before it redefines the functions.
    • Try building the program for Linux and run it under Valgrind. That will check more problems in addition to buffer overruns and won’t use that much memory (only twice as normal, but it is slower, approximately 20 times).
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

A program I wrote (in C#) accesses through a C++/CLI wrapper library a native
A CLI program of mine compiles and runs fine on windows. Compiles fine on
I wrote a PHP-CLI script that mixes two audio (.WAV PCM) files (with some
I wrote a program that forks some processes with fork(). I want to kill
I wrote a C program in Linux that mallocs memory, ran it in a
OK, the title is a bit(lot) cryptic, but that's the best one-line-summary I could
| wrote C++/CLI code with .NET framework 4.0.30319, I would like to recompile it
PHP via CLI successfully logs errors to /var/log/php_errors.log. But apache + php does not
I have a C++/CLI System::Windows::Forms::UserControl derived control which should only redraw (a small portion
i have written a c++/cli program which calls my native c++ function which has

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.