VB6 Debugging - compiled
Asked Answered
A

1

0

My scenario is I'm supporting a VB6 app at the place I work and in the last few weeks it has started crashing more often than it ever used to. It uses both a local Access MDB database and a remote SQL Server DB for different types of storage. The good news is we are writing a replacement app, the band news I need to support this one in the meantime and the vendor is long gone from this world.

What are some ways I could try and diagnose what is causing the crash? For example so far I've tried ODBC tracing (For the MDB component), SQL Profiler tracing and ProcMon on a client PC.

Is there anything else I could try to discover what the app was trying to do at the time of the crash?

Absentminded answered 1/7, 2016 at 15:0 Comment(3)
It never gives any error messages? Just hangs or disappears? Single user or multiple?Squamation
It gives errors that are too vague. The VB6 errors are not shown, if existant. Multiple users, each with a local MDB and central SQLAbsentminded
I would have suspected Access corruption but not likely to happen across multiple local databases. That would lead me to think a recent update that has gotten rolled out to more and more machines OR some kind of new network issue to the SQL server that's not being handled. You say VB6 errors are not shown but you are apparently seeing "vague" errors so what are those? Are they all Win 7 64 PCs?Squamation
D
3

You can also start in a debugger.

windbg or ntsd (ntsd is a console program and maybe installed). Both are also from Debugging Tools For Windows.

Download and install Debugging Tools for Windows

http://msdn.microsoft.com/en-us/windows/hardware/hh852363

Install the Windows SDK but just choose the debugging tools.

Create a folder called Symbols in C:\

Start Windbg. File menu - Symbol File Path and enter

srv*C:\symbols*http://msdl.microsoft.com/download/symbols

then

windbg -o -g -G c:\windows\system32\cmd.exe /k batfile.bat

You can press F12 to stop it and kb will show the call stack (g continues the program). If there's errors it will also stop and show them.

Type lm to list loaded modules, x *!* to list the symbols and bp symbolname to set a breakpoint

Use db address (as in db 01244 to see what's at that memory.

If programming in VB6 then this environmental variable link=/pdb:none stores the symbols in the dll rather than seperate files. Make sure you compile the program with No Optimisations and tick the box for Create Symbolic Debug Info. Both on the Compile tab in the Project's Properties.

Dorn answered 3/7, 2016 at 22:51 Comment(8)
My apologies, I should have been more explicit. I do not have the source of this app to recompile it with symbols.Absentminded
No but windows will use it's own symbols for it's own calls.Dorn
A program spends 90% of the time in Windows code. A VB program spends most of it's remaining time in the VB runtime. Therefore your code is a couple of percent of the code running. Symbols are available for VB runtime. Windbg will download symbols for windows. Symbols make live a double plus lot easier but aren't necessary. Plus you'll get crash details and WHERE it crashed. There is little likelihood of success but will answer your question - where is it crashing?.Dorn
Thankyou @Noodles that sounds like good sense. I got windbg installed and running as you suggest. All I seem to get at the event points is a number of "Unknown Exception - code c000008f (first chance)" which my first few Googles haven't been useful. I'll keep going with it tomorrow (had some bad weeks recently, hence the gap in replies)Absentminded
It looks like a NTStatus code. 0xC000008F STATUS_FLOAT_INEXACT_RESULT from msdn.microsoft.com/en-au/library/cc704588.aspxDorn
Also when it crashes do a kb to see the call stack, this is what function called what function that called the function that crashed. You'll always be 5 to 20 deep in the call stack.Dorn
Thanks @Noodles, I've got some information now from the scenario which crashes the user (btw it never crashes on my PC) and windbg is detecting a breaking event. Even more excitingly if I run the app in compatibility=WinXP the breaking event doesn't occur, and these behaviors are repeatable. I may have to start a further question to dig into what these debug events mean, but you have answered the question asked.Absentminded
@Noodles Symbols are available for the VB6 runtime (Msvbvm60.dll)? I've never seen symbols downloaded from the MS symbol server for that. What version of Msvbvm60.dll are the symbols available for?Levana

© 2022 - 2024 — McMap. All rights reserved.