简体   繁体   中英

How do I debug lower level File access exceptions/crashes in C++ unmanaged code?

I'm currently working on trying to resolve a crash/exception on an unmanaged C++ application.

The application crashes with some predicatibility. The program basically process a high volume of files combined with running a bunch of queries through the access DB.

It's definitely occuring during a file access. The error message is:

         "failed reading. Network name is no longer available."

It always seems to be crashing in the same lower level file access code. It's doing a lower level library Seek(), then a Read(). The exception occurs during the read.

To further complicate things, we can only get the errors to occur when we're running an disk balancing utility. The utility essentially examines file access history and moves more frequently/recently used files to faster storage retrieval while files that are used less frequently are moved to a slower retrieval area. I don't fully understand the architecture of the this particular storage device, but essentially it's got an area for "fast" retrieval and one for "archived/slower."

The issues are more easily/predicably reproducible when the utility app is started and stopped several times. According to the disk manufacturer, we should be able to run the utility in the background without effecting the behaviour of the client's main application.

Any suggestions how to proceed here? There are theories floating around here that it's somehow related to latency on the storage device. Is there a way to prove/disprove that? We've written a small sample app that basically goes out accesses/reads a whole mess of files on the drive. We've (so far) been unable to reproduce the issue even running with SmartPools. My thought is to try push the latency theory is to have multiple apps basically reading volumes of files from disk while running the utility application.

The memory usage and CPU usage do not look out of line in the Task Manager.

Thoughts? This is turning into a bit of a hairball.

Thanks, JohnB

Grab your debug binaries. Setup Application Verifier and add your application to its list. Hopefully wait for a crash dumb. Put that through WinDBG. Try command: !avrf See what you get....

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM