473,406 Members | 2,956 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

whats wrong with this stack

Hi,

There is a strang bug appearing not-so-often in my application. I'm
pasting the stack calls window contents when my app crashes. Following
it is:

msvcr80d.dll!fastcopy_I(void * dst=0x01e46130, void * src=0x00001280,
int len=0) + 0x4b bytes C
msvcr80d.dll!_VEC_memcpy(void * dst=0x01e46130, void * src=0x000012fc,
int len=8) + 0x52 bytes C
msvcr80d.dll!_VEC_memcpy(void * dst=0x01e46128, void * src=0x00001304,
int len=212202116) + 0xb4 bytes C
OC.dll!FlexibleBuffer::AddtoBuffer(const char * str=0x01d5c010,
unsigned int buf_length=31744304) Line 21 + 0x13 bytes C++
msvcr80d.dll!_VEC_memcpy(void * dst=0x01e46130, void * src=0x000012fc,
int len=8) + 0x52 bytes C
msvcr80d.dll!_VEC_memcpy(void * dst=0x01e46128, void * src=0x00001304,
int len=212202116) + 0xb4 bytes C
OC.dll!FlexibleBuffer::AddtoBuffer(const char * str=0x01d5c010,
unsigned int buf_length=31744304) Line 21 + 0x13 bytes C++
msvcr80d.dll!_VEC_memcpy(void * dst=0x01e46128, void * src=0x00001304,
int len=212202116) + 0xb4 bytes C
>OC.dll!FlexibleBuffer::AddtoBuffer(const char * str=0x01d5c008, unsigned int buf_length=31744296) Line 21 + 0x13 bytes C++
OC.dll!FlexibleBuffer::AddtoBuffer(const char * str=0x01e46128,
unsigned int buf_length=4868) Line 21 + 0x13 bytes C++
OC.dll!DataReceiver::ReceiveAll(char * recvbuf=0x01dca028, int
recvbuflength=6412, char * * allfiledata=0x0ca5f46c) Line 316 C++
OC.dll!DataReceiver::internaldatarecv() Line 161 + 0x1d bytes C++
OC.dll!DataReceiver::ReceiveData() Line 213 + 0x8 bytes C++
OC.dll!HomePortClient::MaybeRecv(DataReceiver * datarecv=0x01ddac88)
Line 382 + 0x8 bytes C++
OC.dll!HomePortClient::CheckForOtherCommands() Line 368 C++
OC.dll!HomePortClient::connect() Line 289 C++
OC.dll!HomePortClient::Run() Line 46 C++
OC.dll!AsyncBase::ThreadStart(void * param=0x01e29f50) Line 22 + 0xe
bytes C++
KERNEL32.DLL!77e8987c()
[Frames below may be incorrect and/or missing, no symbols loaded for
KERNEL32.DLL]

look at the first call to DataReceiver::ReceiveAll, it calls the
AddtoBuffer, which again calls AddtoBuffer and it may look like a
recursive call but there is no way in my code that AddtoBuffer calls
itself. This second call is where buffer and integers show abnormal
values. How is it possible that these 2 calls are being shown in the
call stack? Who made the second call? Any idea on what places I should
check, can I write some source code which could help me debug this kind
of bug? Problem is that this code runs a LOT of times, say thousands of
times. And only sometimes it crashes. Also, this app is heavily
multithreaded, at the time this call stack was recorded, I think there
must be about 20+ threads running. But ofcourse I assume that at any
given time the call stack window only shows the calls of single thread.
I'm pasting the code for AddtoBuffer below:

void FlexibleBuffer::AddtoBuffer(const char * str, size_t buf_length)
{
_P_BUF_MEM_INFO b= new _BUF_MEM_INFO();

b->buf = new char [buf_length];
b->length_of_buf = buf_length;
memcpy ( b->buf, str, buf_length);
m_list_buffer.push_back ( b );
this->m_total_list_buffer_count += buf_length;

}

regards,
-ab.

Nov 20 '06 #1
2 2828
look at the first call to DataReceiver::ReceiveAll, it calls the
AddtoBuffer, which again calls AddtoBuffer and it may look like a
recursive call but there is no way in my code that AddtoBuffer calls
itself. This second call is where buffer and integers show abnormal
values. How is it possible that these 2 calls are being shown in the
call stack? Who made the second call? Any idea on what places I should
check, can I write some source code which could help me debug this kind
of bug? Problem is that this code runs a LOT of times, say thousands of
times. And only sometimes it crashes. Also, this app is heavily
multithreaded, at the time this call stack was recorded, I think there
must be about 20+ threads running.
Since the application uses buffers on the heap, memcpy, multithreading,
etc., I would first check it for heap usage issues with PageHeap:
http://www.debuginfo.com/tips/userbpntdll.html

If the app passes PageHeap test clean, try to trace (OutputDebugString, etc.)
the values of all parameteres passed to all functions mentioned on the call
stack (and related functions, if needed), as well as entry/exit of those functions.
At the moment of the crash, use the tracing output to determine if the values
are correct, where have they come from, etc.

Also you might try to get the call stack with WinDbg, to see if it will
report it differently.

--
Oleg
[VC++ MVP http://www.debuginfo.com/]


Nov 20 '06 #2
hey thanks !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

I installed the debugging tools and running my app in the gflags
changed the crash dialog n gave a error box "Memory Error". Although
this is not at all a descriptive error but from my earlier experience
with the application tells me what the problem was (it was with a third
party mini database dll cuz i didnt update the database table's schemas
after updating the dll). Something tells me that playing with the
debugging tools requires a lot of understanding of os related stuff and
I have only played with windbg while i used to play with sscli's source
code.

regards,
-ab.

On Nov 20, 5:55 pm, "Oleg Starodumov" <com-dot-debuginfo-at-oleg>
wrote:
look at the first call to DataReceiver::ReceiveAll, it calls the
AddtoBuffer, which again calls AddtoBuffer and it may look like a
recursive call but there is no way in my code that AddtoBuffer calls
itself. This second call is where buffer and integers show abnormal
values. How is it possible that these 2 calls are being shown in the
call stack? Who made the second call? Any idea on what places I should
check, can I write some source code which could help me debug this kind
of bug? Problem is that this code runs a LOT of times, say thousands of
times. And only sometimes it crashes. Also, this app is heavily
multithreaded, at the time this call stack was recorded, I think there
must be about 20+ threads running.Since the application uses buffers on the heap, memcpy, multithreading,
etc., I would first check it for heap usage issues with PageHeap:http://www.debuginfo.com/tips/userbpntdll.html

If the app passes PageHeap test clean, try to trace (OutputDebugString, etc.)
the values of all parameteres passed to all functions mentioned on the call
stack (and related functions, if needed), as well as entry/exit of those functions.
At the moment of the crash, use the tracing output to determine if the values
are correct, where have they come from, etc.

Also you might try to get the call stack with WinDbg, to see if it will
report it differently.

--
Oleg
[VC++ MVPhttp://www.debuginfo.com/]
Nov 20 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Chris Geerdink | last post by:
combo with PHP. what is wrong with the Javascript? else { include("mysql.php"); $query1 = mysql_query("INSERT INTO gbook (naam, email, text) VALUES ('".$_POST."', '".$_POST."',...
51
by: WindAndWaves | last post by:
Can anyone tell me what is wrong with the goto command. I noticed it is one of those NEVER USE. I can understand that it may lead to confusing code, but I often use it like this: is this...
8
by: Z D | last post by:
Hi, I was wondering what's the point of "finally" is in a try..catch..finally block? Isn't it the same to put the code that would be in the "finally" section right after the try/catch block?...
1
by: aa | last post by:
When I am reading from local disk (d:), everithing is OK, but then I am reading from map disk I am geting the this error. Whats wrong. Thanks Server Error in '/Extra' Application....
7
by: Mike Barnard | last post by:
It's a simple test... VERY SIMPLE. But... In an external stlyesheet some attributes don't show. With the same styles cut and pasted to the test internally it works as expected. Anyone tell...
2
by: Abubakar | last post by:
Hi all, I'm writing an app in vc++ 2k5 (all native/unmanaged). This application does a lot of multithreading and socket programming. Its been months since I'm developing this application, at...
3
by: belton180 | last post by:
CODE]../* Program function: Simulate the stack using a stack limit of 10. Display a menu for the the following. Create a stack Insert an item in the stack Pop an item from the stack ...
5
by: islayer | last post by:
can someone tell me what is wrong with the bold code? i am just learning perl. the program should create a perl file with a random name (5 letters, followed by a number), but the name is always just...
1
by: linksterman | last post by:
I am making this pretty basic chat project, and I found this echo server on the internet and decided to modify it my needs (much of the methods and fields are the same). Basically what my program...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.