stack trace not working independently?

S

saju.prabhakaran

We have an application developed in c++ and the development environment
is visual studio .net 2003. We have added a cpp program to the
application which will create a log file containing the trace back
details which will help us to identify the areas of application
crashes. The log file will contain details about the file name, line
number and the order of the called functions leading to the crash. The
cpp program we had added is stackwalker.cpp which is downloaded from
the net. This application is working fine in the system where we are
building the application. But when we copy the executable alone to a
different system where we dont have any supporting softwares like
visual studio .net 2003, it is creating a log file but the log file
does not have the necessary trace back details. Can any one say why the
trace back details is not getting generated when we run the executable
alone in a separate system. Is there any separate library files or dll
files that we need to include along with the executable or do we need
to make any changes in the environmental variable settings.
 
M

mlimber

We have an application developed in c++ and the development environment
is visual studio .net 2003. We have added a cpp program to the
application which will create a log file containing the trace back
details which will help us to identify the areas of application
crashes. The log file will contain details about the file name, line
number and the order of the called functions leading to the crash. The
cpp program we had added is stackwalker.cpp which is downloaded from
the net. This application is working fine in the system where we are
building the application. But when we copy the executable alone to a
different system where we dont have any supporting softwares like
visual studio .net 2003, it is creating a log file but the log file
does not have the necessary trace back details. Can any one say why the
trace back details is not getting generated when we run the executable
alone in a separate system. Is there any separate library files or dll
files that we need to include along with the executable or do we need
to make any changes in the environmental variable settings.

This is not a C++ language question. You should instead ask it in a
Microsoft-specific group, or ask it of the vendor of stackwalker.cpp.
See this FAQ for what is on-topic in this group and for some
suggestions of where else you might post:

http://www.parashift.com/c++-faq-lite/how-to-post.html#faq-5.9

Cheers! --M
 
M

Marek Vondrak

We have an application developed in c++ and the development environment
is visual studio .net 2003. We have added a cpp program to the
application which will create a log file containing the trace back
details which will help us to identify the areas of application
crashes. The log file will contain details about the file name, line
number and the order of the called functions leading to the crash. The
cpp program we had added is stackwalker.cpp which is downloaded from
the net. This application is working fine in the system where we are
building the application. But when we copy the executable alone to a
different system where we dont have any supporting softwares like
visual studio .net 2003, it is creating a log file but the log file
does not have the necessary trace back details. Can any one say why the
trace back details is not getting generated when we run the executable
alone in a separate system. Is there any separate library files or dll
files that we need to include along with the executable or do we need
to make any changes in the environmental variable settings.

If you look at its implementation you will see that it relies on MS's
dbghelp.dll (imagehlp.dll), which implements the tracing capabilities and
interprets the MS debugging information, so that stack can be traced
and function addresses can be translated to function names. The reason
why it does not work on your machine is (either or both):

a) symbol files (.pdb) for your executable and dlls are not present on the
target computer

b) the supporting dlls on the target computer do not understand debugging
information produced by MSVC7.1 (this is very likely - for example
dbghelp.dll/imagehlp.dll shipped with Windows2000 does not understand
PDB files generated by MSVC7)

Back in 2003 I implemented another stack tracer that takes a similar
approach as stackwalker.cpp does. You might want to look at:
http://cvs.sourceforge.net/viewcvs....in32/stack_tracer_win32.cpp?rev=1.8&view=auto

-- Marek
 
S

saju.prabhakaran

Thanks for your great help.
Is there any way to fix this issue, i mean make the present executable
working in another windows machine..
Shall i copy all thie required dll and .pdb file to the second machine
where my executable having problem.?

sam
 
M

Marek Vondrak

Is there any way to fix this issue, i mean make the present executable
working in another windows machine..
Shall i copy all thie required dll and .pdb file to the second machine
where my executable having problem.?

Yes. Copy the pdb files and the required DLLs. Debugger can be used to
determine what DLLs are mapped to your process (this should actually be
inspected after a stack trace is dumped because SymInitialize() might load
other DLLs).

Be aware that the stackwalk.cpp implementation (unlike mine) does not work
on NT4 nor W9x. However, this is probably no longer an issue...

-- Marek
 
S

saju.prabhakaran

Hi Marek,

Could you please help us in sharing the piece of sample code for
tracking the Stacks in release and debug code .We are not getting the
reuslts what we are expected.We are not able get the base class
StackTracer and stack_tracer_win32.h file.

We are getting compilation results when we build with #include
<dbghelp.h> included in the code .We dont find this file in my system.


Thanks in advance
 
R

red floyd

Hi Marek,

Could you please help us in sharing the piece of sample code for
tracking the Stacks in release and debug code .We are not getting the
reuslts what we are expected.We are not able get the base class
StackTracer and stack_tracer_win32.h file.

We are getting compilation results when we build with #include
<dbghelp.h> included in the code .We dont find this file in my system.

How about taking this to an MS newsgroup?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,817
Latest member
DicWeils

Latest Threads

Top