🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: microsoft.public.vc.activextemplatelib
2 messages
2 total messages Started by David Morgenlender Thu, 25 Jun 1998 00:00
HELP!!! Automation Controller calls to Server Crashes - Stack Overflow - How debug???
#14
Author: David Morgenlender
Date: Thu, 25 Jun 1998 00:00
34 lines
2611 bytes
I'm developing an app with an Automation Controller (client) written in Borland
C++ Builder 3 & an Automation Server written in Visual C++ 5.  The Server is an
in-process server (DLL).  The Controller calls methods in the Server via vtbl.
I've got one method call from the Controller to the Server working fine.  But
I'm having big problems with the 2nd.  It crashes with a Stack Overllow
exception somewhere between the call in the Controller app & reaching the method
in the Server.  

One thing that makes debugging difficult is that I can't find any way to
simultaneously debug the EXE (in BCB3) & the DLL (in VC5).  So I must debug in
one or the other.

When I debug the EXE, a stack overflow messagebox appears.  The call stack
window doesn't even show the EXE.  From the stack bottom, there are MANY calls
from the same address in the DLL.  Then some other addresses in the DLL.  Then
addresses from various other places including MFC42D.DLL.  But since the
debugger can't read the VC5 symbol table, there's nothing I can do with the
addresses.

When I debug the DLL, starting the EXE in the process, I get a stack overflow
messagebox, but the call stack cannot be displayed.  

Short of somehow debugging COM through disassembled code, there's not much I can
do here.  I've already tried changing how I specify the array (x[] to *x).  I
guess I could get rid of the array just to see if that helps ... but that's a
lot of work.  I've already shrunk the array to miniscule size.

Any suggestions???

=======================================================
Dave Morgenlender
e-mail: dmorgen@alum.mit.edu
=======================================================
Re: HELP!!! Automation Controller calls to Server Crashes - Stack Overflow - How debug???
#15
Author: David Morgenlender
Date: Thu, 25 Jun 1998 00:00
24 lines
2248 bytes
Funny, but within minutes of sending the message I found the bug.  But there are
still some mysteries here.

I rebooted the system, rebuilt everything & generated mapfiles;  I was able to
figure out that the recursive call was within my app code in the DLL.  The
answer was quickly apparent - I had forgotten to specify a  scope, so a class
method was calling itself.  I had previously tried to look for the address
without the mapfile pointing the way to the module, & wasn't able to get VC5 to
do this.

But here's the big mystery ... sitting right on that function call was a
breakpoint!!!  I did not set it this go round, i.e. it was there the whole time.
But when I had previously run the app under the VC5 debugger this breakpoint was
never hit!!!  This was the first place in my app code to be executed after the
COM method call from the controller.  So I naturally assumed my code had never
been reached.  Also, I couldn't get VC5 to show me a call stack after the crash,
which would've pointed right to this spot.  There was something about rebooting
& restarting VC5 that caused it to fix itself!  Very strange!

=======================================================
Dave Morgenlender
e-mail: dmorgen@alum.mit.edu
=======================================================
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads