473,385 Members | 1,569 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,385 software developers and data experts.

memmory corruption

hello everyone ,
is there any cmmnd in gdb or any other way to find out whats the total
dynamically allocated memory
a process holds at various instances of execution???

and what can be the possible reasons of an error like

glibc detected:malloc() memory corruption

when the program executes almost the same function abt 2000 times with
no error
it does use dynamically alloted space and free it at every function
call
thank you very much

Jul 25 '08 #1
2 1139
mohi wrote:
hello everyone ,
is there any cmmnd in gdb or any other way to find out whats the total
dynamically allocated memory
a process holds at various instances of execution???
What hppnd to your vowels? Never mind.

GDB is off-topic. Try 'gnu.*' hierarchy, or the newsgroup for your OS,
which I strongly recommend because that forum will deal with tools much
better than c.l.c++, since tools are almost always platform- and OS-
specific.
and what can be the possible reasons of an error like

glibc detected:malloc() memory corruption
Buffer overrun, double deletion of memory, attempt to use dynamic memory
after it has been deleted, allocation using 'new[]' then deletion using
'delete' instead of 'delete[]'...
when the program executes almost the same function abt 2000 times with
no error
it does use dynamically alloted space and free it at every function
call
If you are sure allocations and deallocations are correctly paired up,
then it probably isn't that particular function...

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
Jul 25 '08 #2
On Jul 25, 7:15 pm, Victor Bazarov <v.Abaza...@comAcast.netwrote:
mohi wrote:
[...]
glibc detected:malloc() memory corruption
Buffer overrun, double deletion of memory, attempt to use
dynamic memory after it has been deleted, allocation using
'new[]' then deletion using 'delete' instead of 'delete[]'...
Just about any undefined behavior could in theory cause it.
Using an uninitialized pointer, for example.
when the program executes almost the same function abt 2000
times with no error it does use dynamically alloted space
and free it at every function call
If you are sure allocations and deallocations are correctly
paired up, then it probably isn't that particular function...
Back in the old days (in C), about 50% of the time, this was
caused by someone allocating strlen(s) bytes, then using strcpy
to copy into the allocated memory. I you're using C++
correctly (std::string, std::vector, etc.), those sort of
problems should be close to non-existant, but if he's got an
array new anywhere, it's a likely candidate. Another
possibility is that something didn't get recompiled when a
header was modified. So the size of a class changes, but the
operator new uses the old size.

--
James Kanze (GABI Software) email:ja*********@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34
Jul 25 '08 #3

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

Similar topics

5
by: Noa Garnett | last post by:
I'm developing on C++, using visual studio 6.0 with service pack 5. I have a memory corruption while debugging. Some of the variables I'm using are suddenly set to zero while progressing along the...
19
by: Mark C. | last post by:
The company I work for has been running Access 2000 on a Windows NT server with Opportunistic Locking turned off on the server without issue for almost a year. We have just switched to a Windows...
6
by: Mike | last post by:
I have done a lot of research on DAO and database corruption and have not yet found any solid information for my problem. I use DAO extensively in my Access 97 databases (back-end on network,...
4
by: DFS | last post by:
" has detected corruption in this file. To try to repair the corruption, first make a backup copy of the file. Then, on the Tools menu, point to Database Utilities and click Compact and Repair...
47
by: ship | last post by:
Hi We need some advice: We are thinking of upgrading our Access database from Access 2000 to Access 2004. How stable is MS Office 2003? (particularly Access 2003). We are just a small...
8
by: ranjeet.gupta | last post by:
Dear All Is the Root Cause of the Memory corruption is the Memory leak, ?? suppose If in the code there is Memory leak, Do this may lead to the Memory Corruption while executing the program ? ...
23
by: Dave G | last post by:
Since upgrading one of my clients from A97/W2000 to A2003/XP they have suffered no end of data corruption problems, mainly involving one of the main tables. The corruption can result in one...
2
by: nepdae | last post by:
Please forgive me, this is a long one. My 11-user Access 2000 database is having recurring corruption problems. The symptoms include the following: 1) corrupted fields in recently created or...
42
by: Doug | last post by:
I am in a friendly debate with some co-workers... and my boss. We use Access 2003 for the frontend (on workstations) as well as for the backend (on a Dell PowerEdge running Windows 2000 server,...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.