perplexed
perplexed

Reputation: 13

Visual Studio confusing exception

For a robotics class I'm taking, we have to download the code from http://www.cs.okstate.edu/~katchou/vboost.cpp and place it into a project of the same name. When I debugged the program (by navigating to Debug>StartDebugging in Release mode) I got an error saying :

 First-chance exception at 0x6eedfb59 (msvcr100.dll) in vboost.exe: 0xC0000005:
Access   violation reading location 0x415c3a43.
    Unhandled exception at 0x6eedfb59 (msvcr100.dll) in vboost.exe: 0xC0000005: 
Access violation reading location 0x415c3a43.

After stopping the debugging process and a window pops up saying:

   Unhandled exception at 0x6eedfb59 (msvcr100.dll) in vboost.exe: 0xC0000005: 
Access violation reading location 0x415c3a43.

During the debugging without an option to ignore and pressing continue just makes the same window appear again.

Then another c file opens up titled strtol.c and in the "auto" window I notice that the pointer nptr (which is a parameter of the function strtoxl) is given some value and then it says [bad ptr] which I'm assuming means the pointer is bad. Underneath this is an error stating:Error: expression cannot be evaluated. The value is not 0 so it isn't NULL. The program stops debugging at line 99 of strol.c.

When I do the same thing in debug mode, the program runs fine until it starts to load the file names of images found in another file. It then exits the program with a 1 instead of the usual 0.

This may seem kind of vague but in all honesty I'm not sure what is going wrong. I tried searching the code I downloaded from that site for the functions strtol or strtoxl, of which neither are present, and I noticed on the call stack that msvcr100.dll seems to be accessing the strtol.c file but I'm not sure why or how. Any help will be appreciated.

Specifics: Host OS: Ubuntu 10.10 Guest Host: Windows 7 using VirtualBox Software: Visual Studio 2010 Express

Upvotes: 1

Views: 2897

Answers (2)

Andrey
Andrey

Reputation: 4356

You start the program without providing it with command line arguments it expects and it crashes while trying to access it. Fix the program to be more informative -and/or- pass correct arguments

Upvotes: 1

Erik
Erik

Reputation: 91270

The application requires 5 commandline parameters, and can take 2 optional - it'll crash if you don't pass the first 5.

See lines 364-431 in the cpp file.

  1. // Name of the classifier group (i.e., new.clas)
  2. // Number of positive images.
  3. // Initialize the negative image counter.
  4. // Number of classifier levels in the cascade.
  5. // Max # of features.
  6. (optional) -t, -v, -tab, -mem or -eyefull
  7. (optional) -filter

In VS2008 you set these in Project Properties/Debugging/Command Arguments - VS2005/2010 should be same or similar.

Upvotes: 4

Related Questions