11-07-2016
Without knowing what language you're using, anything about what your code looks like, nor what error is actually being reported by valgrind, about all that we can say is that you are probably trying to free an area of memory that you allocated at some point in the past and corrupted part of the region of memory that your memory allocation library uses to keep track of its memory pool OR you are trying to free memory that was never allocated.
Without more information, every assignment statement in your code is suspect, every return statement in your code is suspect, and every reference to every object that is a pointer in your code is suspect.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I have some files that appear to have no inode numbers. To complicate the matter, the filenames have UTF8 (I think) characters.
I am trying to delete them. In fact, and this might make things easier, I'm trying to delete their parent directory.
I don't know what to try next, please help.
... (5 Replies)
Discussion started by: jaffachamp
5 Replies
2. Shell Programming and Scripting
I do not know much about shell scripting so I am at a loss here. If someone can help me, that would be great!
I have two directories
/dir1
/dir2
I need to delete all files from /dir1 and that does not have a correspondent file in /dir2. It should NOT check file suffixes in /dir2 . Why?... (20 Replies)
Discussion started by: kaah
20 Replies
3. Shell Programming and Scripting
Hi folks,
I've list of LDAP records in this format:
cat cmmac.export.tmp2
dn: deviceId=0a92746a54tbmd34b05758900131136a506,ou=devices,ou=customer,ou=nl,o=upc
cmmac: 00:13:11:36:a5:06
dn: deviceId=0a92746a62pbms4662299650015961cfa23,ou=devices,ou=customer,ou=nl,o=upc
cmmac:... (4 Replies)
Discussion started by: tomas.polak
4 Replies
4. Shell Programming and Scripting
here is what i want to achieve.. i have a file with below contents
cat fileName
blah blah blah
.
.DROP this
REJECT that
.
--sport 7800 -j REJECT --reject-with icmp-port-unreachable
--dport 7800 -j REJECT --reject-with icmp-port-unreachable
.
.
.
more blah blah blah
--dport 3306... (14 Replies)
Discussion started by: vivek d r
14 Replies
5. UNIX for Advanced & Expert Users
Hi ,
i have a file with data as below.This is same file. But actual file contains to many rows.
i want to search for a string "Field 039 00" and delete that line and previous 3 lines in that file.. Can some body suggested me how can i do using either sed or awk command ?
Field 004... (7 Replies)
Discussion started by: vadlamudy
7 Replies
6. UNIX for Dummies Questions & Answers
Hello masters,
I am filtering data based on completeness. A (Name , Group) combination in File2 is only complete when it has data for all subgroups specified in File1.
All incomplete (Name , Group) combinations do not appear in the output.
So for example , Name1 Group 1 in File2 is... (6 Replies)
Discussion started by: senhia83
6 Replies
7. Shell Programming and Scripting
Hi
My directory structure is as below.
dir1, dir2, dir3
I have the list of files to be deleted in the below path as below.
/staging/retain_for_2years/Cleanup/log $ ls -lrt
total 0
drwxr-xr-x 2 nobody nobody 256 Mar 01 16:15 01-MAR-2015_SPDBS2
drwxr-xr-x 2 root ... (2 Replies)
Discussion started by: prasadn
2 Replies
8. Linux
Dear All,
I got the valgrind report as below
Mismatch free() / delete / delete
at 0x4006895: operator delete(void*) (vg_replace_malloc.c:480)
by 0x8EA6D11: corefunction.
I supect that it is expect me to write free() instead of delete p1.
Given the the code.
I have the structure.
... (7 Replies)
Discussion started by: SA_Palani
7 Replies
9. UNIX for Advanced & Expert Users
rsync with --delete won't honor the delete if the source is something/*. I want the delete to work, but not to delete directories on the target that are peer to the intended directory. For example, using these source and target file structures:
Source on desktop:
~/
Money/
... (4 Replies)
Discussion started by: JavaMeister
4 Replies
10. UNIX for Advanced & Expert Users
I got a requirement where I need to compare two files wrt to each columns and write the corresponding difference in another file along with some identification showing mismatched columns. Pointing out the mismatched columns is my main problem statement. For example we have files like:
File 1 ... (8 Replies)
Discussion started by: piyush pankaj
8 Replies
LEARN ABOUT REDHAT
tcl_mem_debug
TCL_MEM_DEBUG(3) Tcl Library Procedures TCL_MEM_DEBUG(3)
__________________________________________________________________________________________________________________________________________________
NAME
TCL_MEM_DEBUG - Compile-time flag to enable Tcl memory debugging.
DESCRIPTION
When Tcl is compiled with TCL_MEM_DEBUG defined, a powerful set of memory debugging aids are included in the compiled binary. This
includes C and Tcl functions which can aid with debugging memory leaks, memory allocation overruns, and other memory related errors.
ENABLING MEMORY DEBUGGING
To enable memory debugging, Tcl should be recompiled from scratch with TCL_MEM_DEBUG defined. This will also compile in a non-stub version
of Tcl_InitMemory to add the memory command to Tcl.
TCL_MEM_DEBUG must be either left defined for all modules or undefined for all modules that are going to be linked together. If they are
not, link errors will occur, with either TclDbCkfree and Tcl_DbCkalloc or Tcl_Ckalloc and Tcl_Ckfree being undefined.
Once memory debugging support has been compiled into Tcl, the C functions Tcl_ValidateAllMemory, and Tcl_DumpActiveMemory, and the Tcl mem-
ory command can be used to validate and examine memory usage.
GUARD ZONES
When memory debugging is enabled, whenever a call to ckalloc is made, slightly more memory than requested is allocated so the memory debug-
ging code can keep track of the allocated memory, and eight-byte ``guard zones'' are placed in front of and behind the space that will be
returned to the caller. (The sizes of the guard zones are defined by the C #define LOW_GUARD_SIZE and #define HIGH_GUARD_SIZE in the file
generic/tclCkalloc.c -- it can be extended if you suspect large overwrite problems, at some cost in performance.) A known pattern is writ-
ten into the guard zones and, on a call to ckfree, the guard zones of the space being freed are checked to see if either zone has been mod-
ified in any way. If one has been, the guard bytes and their new contents are identified, and a ``low guard failed'' or ``high guard
failed'' message is issued. The ``guard failed'' message includes the address of the memory packet and the file name and line number of
the code that called ckfree. This allows you to detect the common sorts of one-off problems, where not enough space was allocated to con-
tain the data written, for example.
DEBUGGING DIFFICULT MEMORY CORRUPTION PROBLEMS
Normally, Tcl compiled with memory debugging enabled will make it easy to isolate a corruption problem. Turning on memory validation with
the memory command can help isolate difficult problems. If you suspect (or know) that corruption is occurring before the Tcl interpreter
comes up far enough for you to issue commands, you can set MEM_VALIDATE define, recompile tclCkalloc.c and rebuild Tcl. This will enable
memory validation from the first call to ckalloc, again, at a large performance impact.
If you are desperate and validating memory on every call to ckalloc and ckfree isn't enough, you can explicitly call Tcl_ValidateAllMemory
directly at any point. It takes a char * and an int which are normally the filename and line number of the caller, but they can actually
be anything you want. Remember to remove the calls after you find the problem.
SEE ALSO
memory, Tcl_ValidateAllMemory, Tcl_DumpActiveMemory
KEYWORDS
memory, debug
Tcl 8.1 TCL_MEM_DEBUG(3)