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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T13:24:41+00:00 2026-05-29T13:24:41+00:00

I have the following line in my program that causes a run-time warning: if

  • 0

I have the following line in my program that causes a run-time warning:

if (!is_directory("C:\\NGFMS_Debug\\Files") && !create_directories("C:\\NGFMS_Debug\\Files"))

The text of the warning is as so: “A buffer overrun has occurred in XXX.exe which has corrupted the program’s internal state.”

The warning comes in the call to “is_directory(…)”. I’m guessing the space for the string isn’t getting allocated, but I thought syntax like this was legal.

The is_directory function is a part of boost/filesystem.hpp and I am using the following namespaces:

using namespace boost;
using namespace boost::filesystem;
using namespace std;

This is getting compiled under VS2005 C++. Any ideas?

Update

I tried a couple different things and stepped through the code and here is what I found.

If I do this

char* path_chars_c;
path_chars_c = "C:\\Debug\\Files";
string path_str_c(path_chars_c);

The variable path_chars_c contains the appropriate string, but the variable path_str_c contains garbage after initialization. So it appears that the string initialization is broken here. Has anyone ever seen this?

  • 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-05-29T13:24:42+00:00Added an answer on May 29, 2026 at 1:24 pm

    This is a surprising error — that seems like a pretty standard use of boost::filesystem::is_directory(). Have you tried stepping into it w/ a debugger to see where the issue happens?

    One (remote) possibility comes to mind — if you are linking libraries that have NDEBUG enabled with libraries that have NDEBUG disabled, you can run into trouble. In particular, a few boost datatypes will allocate some extra debugging fields when debugging is turned on. So if an object gets created by one piece of code that thinks debugging is off, but then used by another piece of code that thinks debugging is on, then you can get random memory errors (such as buffer overflows).

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

Sidebar

Related Questions

I have the following line of text that I need to display <ul><li>Complementary to
I have the following line between my \maketitle and my \begin{abstract}: \center{ \textsc{Some text
I have the following source for an assembly program that I got in a
I have a Python program running a thread that consistently outputs the following: (my_program.py:12313):
I have written the following line of code that reads the data in a
I am trying to run a java program from command line. I tried following
I have the following line: 14:48 say;0ed673079715c343281355c2a1fde843;2;laka;hello ;) I parse this by using a
I have the following line of code in a link on my webpage: <a
I have the following line of code: public bool dcpl_radar() { if (radar ==
I have the following line in my IsapiRewrite.ini file: RewriteRule ^/test-url.asp$ http://www.google.co.uk/ [R=301,L] But

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.