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

memory leak, valgrind...help plz!

Hi,

I'm trying to figure out the origin of a memory corruption in my code using valgrind.
valgrind gave me a number of messages that didn't help much, the first invalid read/write message is as follow:

==22774== Invalid write of size 4
==22774== at 0x488F53A: std::string::_Alloc_hider::_Alloc_hider(char*, std::allocator<char> const&) (in /usr/lib/libstdc++.so.5.0.3)
==22774== by 0x488FC26: std::string::string(char const*, std::allocator<char> const&) (in /usr/lib/libstdc++.so.5.0.3)
==22774== by 0x8181D12: Basic::Basic(sc_module_name, SocIf*, char const*, ParameterSet&) (basic_top.cpp:48)
==22774== by 0x8115700: sc_main (main.cpp:112)
==22774== by 0x8BBE423: main (in /.................../sc_exe-g++)
==22774== Address 0x53E7A84 is 0 bytes after a block of size 420 alloc'd
==22774== at 0x401A9D0: operator new(unsigned) (vg_replace_malloc.c:164)
==22774== by 0x8115691: sc_main (main.cpp:112)
==22774== by 0x8BBE423: main (in /.............../sc_exe-g++)
at basic_top.cpp:48 i have only a string initialisation!!!


My stupid questions are:
-what does "Address 0x53E7A84 is 0 bytes after a block of size 420 alloc'd" refers to?
-the above messsage is the first on the list, does this mean that the memory corruption comes definitelyfrom Basic constructor??

Cheers,
I.Kazzouzi
Jan 17 '07 #1
3 2899
Can u plz paste ur source code here?


Hi,

I'm trying to figure out the origin of a memory corruption in my code using valgrind.
valgrind gave me a number of messages that didn't help much, the first invalid read/write message is as follow:

==22774== Invalid write of size 4
==22774== at 0x488F53A: std::string::_Alloc_hider::_Alloc_hider(char*, std::allocator<char> const&) (in /usr/lib/libstdc++.so.5.0.3)
==22774== by 0x488FC26: std::string::string(char const*, std::allocator<char> const&) (in /usr/lib/libstdc++.so.5.0.3)
==22774== by 0x8181D12: Basic::Basic(sc_module_name, SocIf*, char const*, ParameterSet&) (basic_top.cpp:48)
==22774== by 0x8115700: sc_main (main.cpp:112)
==22774== by 0x8BBE423: main (in /.................../sc_exe-g++)
==22774== Address 0x53E7A84 is 0 bytes after a block of size 420 alloc'd
==22774== at 0x401A9D0: operator new(unsigned) (vg_replace_malloc.c:164)
==22774== by 0x8115691: sc_main (main.cpp:112)
==22774== by 0x8BBE423: main (in /.............../sc_exe-g++)
at basic_top.cpp:48 i have only a string initialisation!!!


My stupid questions are:
-what does "Address 0x53E7A84 is 0 bytes after a block of size 420 alloc'd" refers to?
-the above messsage is the first on the list, does this mean that the memory corruption comes definitelyfrom Basic constructor??

Cheers,
I.Kazzouzi
Jan 17 '07 #2
Hi,

I forgot to add in my previous message that I'm using systemC library.
concerning the source code i can't past it here...coz i'm not allowed!!!

thks,
Jan 17 '07 #3
i understand ur concern.Just change name of variables or if u want then make a similar sample program using different variable for pasting

Hi,

I forgot to add in my previous message that I'm using systemC library.
concerning the source code i can't past it here...coz i'm not allowed!!!

thks,
Jan 17 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

10
by: Debian User | last post by:
Hi, I'm trying to discover a memory leak on a program of mine. I've taken several approaches, but the leak still resists to appear. First of all, I've tried to use the garbage collector to...
2
by: tuarek | last post by:
Hi all, Our DB2 Server processes used up host machine's whole memory. Without getting the server down, how can we relieve the memory load. CRM Users are getting error messages, I need...
5
by: questions? | last post by:
I am new to C programming. I just wrote a quite long program for my project, but I have memory leak and the program keeps asking for more and more memory. What are the basic rules for checking...
4
by: mast2as | last post by:
Hi guys I wrote a short program to test a Tree class... I plan to use it a lot in my application so thought I would do a memory leak check before I start using it. The code seems good to me in a...
4
by: mast2as | last post by:
Hi again I was still debugging some code and check for memory leaks with valgrind and found out that valgrind finds a leak when i use deque<Somethingaqueue ?! I am compiling under Linux for...
1
by: benyeung99 | last post by:
I use c++ for writing plugins which run on Linux based application. The application is a third party software and source code is not available. Plugins are called by the application repeatedly...
8
by: kk_oop | last post by:
Hi. Any recommendations for memory leak detection tools for C++ running on Linux or Solaris? I'm interested in static (compile time) and runtime detection. It's for a large project. Thanks! ...
4
by: =?gb2312?B?uqO35w==?= | last post by:
Hi i am using libMagick++.a of Magick-6.2.8 in linux.but now i encounter some leaks when reading blob into image , writting image into blob, or throwing expection .that are my code patch and...
1
by: GLiang.liu.cn | last post by:
Today I use the valgrind to find the memory leak in my application. But it just gives me such information: ==4323== ==4323== 856,984 bytes in 2 blocks are indirectly lost in loss record 7 of 7...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
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: 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
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
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.