Sponsored Content
Operating Systems Linux Red Hat Free() corrupted unsorted chunks Post 302843421 by Karunx on Tuesday 13th of August 2013 06:21:58 AM
Old 08-13-2013
Free() corrupted unsorted chunks

We are migrating Pro*C code from SOLARIS to LINUX-Redhat.

While migrating we face memory de-allocation issue intermittently when accessing large volume of data.

Below is the part of the code(since code is big I am putting the part of the code where the issue comes):

------------------------------------------------------------

Code:
void free_frm_nde(node * nde_ptr)
{
static int num_ndes;
int i;

if (nde_ptr == NULL)
return;

if (nde_ptr->ptr_nxt != NULL)
free_frm_nde(nde_ptr->ptr_nxt);

for (i = 0; i < 7; i++)
{
if (nde_ptr->ptr_dwn[i] != NULL)
free_frm_nde(nde_ptr->ptr_dwn[i]); 
}
free(nde_ptr->ptr_dta); -- Error occurs here
free(nde_ptr);
}

------------------------------------------------------------

Below is the error message:

Code:
*** glibc detected *** : ./filename: free(): corrupted unsorted chunks: 0x0a068b80 ***
======= Backtrace: =========
/lib/libc.so.6[0xa044a5]
/lib/libc.so.6(cfree+0x59)[0xa048e9]
./filename[0x8051180]
./filename[0x805115c]
./filename[0x805115c]
./filename[0x805115c]
./filename[0x805115c]
./filename[0x804cb31]
./filename[0x804eea7]
./filename[0x804ed8f]
./filename[0x8049a27]
./filename[0x804966f]
/lib/libc.so.6(__libc_start_main+0xdc)[0x9b0e9c]
./[0x8048f21]
======= Memory map: ========
0097c000-00997000 r-xp 00000000 fd:03 229417 /lib/ld-2.5.so
00997000-00998000 r--p 0001a000 fd:03 229417 /lib/ld-2.5.so
00998000-00999000 rw-p 0001b000 fd:03 229417 /lib/ld-2.5.so
0099b000-00aef000 r-xp 00000000 fd:03 230066 /lib/libc-2.5.so
00aef000-00af0000 ---p 00154000 fd:03 230066 /lib/libc-2.5.so
00af0000-00af2000 r--p 00154000 fd:03 230066 /lib/libc-2.5.so
00af2000-00af3000 rw-p 00156000 fd:03 230066 /lib/libc-2.5.so
00af3000-00af6000 rw-p 00af3000 00:00 0
00af8000-00b0d000 r-xp 00000000 fd:03 230096 /lib/libpthread-2.5.so
00b0d000-00b0e000 ---p 00015000 fd:03 230096 /lib/libpthread-2.5.so

Any idea about this issue would be appreciated.

Thanks in advance.


Thanks in advance

Last edited by Don Cragun; 08-13-2013 at 08:36 AM.. Reason: Added CODE tags
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

remove chunks of text from file

All, So, I have an ldif file that contains about 6500 users worth of data. Some users have a block of text I'd like to remove, while some don't. Example (block of text in question is the block starting with "authAuthority: ;Kerberosv5"): User with text block: # username, users,... (7 Replies)
Discussion started by: staze
7 Replies

2. Shell Programming and Scripting

Comparing two unsorted files

Hi Guys, I'm a complete shell scripting newbie and need some help with comparing a file against a master file and outputting the results. master.txt would look something like this: 000123 000345 000341 000927 000762 000235 000155 000452 000846 000623 file.txt would look like... (1 Reply)
Discussion started by: ven
1 Replies

3. Shell Programming and Scripting

onstat -d chunks perl monitor

I have a file I need to monitor with a perl script with the following format. I need to send off a 0 if it is above 95 in the 5th colum and a 1 if it is below. Any help on a simple perl script would be great. 75424958 999975 983170 /dev/rmetrochunk00 98.32 760c2dd8 ... (3 Replies)
Discussion started by: jlaigo2
3 Replies

4. Shell Programming and Scripting

Combining chunks of data

Hi there! Need help on some issue, I have data like this: 123 456 789 012 i need it to be like this: 123789 456012 Anyone has any idea how to do this? Thanks! Regards, Ken How to use code tags (8 Replies)
Discussion started by: kennethtls
8 Replies

5. Shell Programming and Scripting

Comparing two large unsorted csv files

Hi All, My requirement is to write a shell script to compare two large csv files. I've created sample files for explaining my problem i.e., a.csv and b.csv contents of files: ----------------- a.csv ------ Type,Memory (Kb),Location HD,Size (Mb),Serial # XT,640,D402,0,MG0010... (2 Replies)
Discussion started by: vasavi
2 Replies

6. Shell Programming and Scripting

Splitting a file into chunks of 1TB

Hi I have a file with different filesystems with there sizes. I need to split them in chucks of 1TB. The file looks like vf_MTLHQNASF07_Wkgp2 187428400 10601AW1 vf_MTLHQNASF07_Wkgp2 479504596 10604AW1 vf_MTLHQNASF07_Wkgp2 19940 10605AID vf_MTLHQNASF07_Wkgp2 1242622044... (4 Replies)
Discussion started by: bombcan
4 Replies

7. Shell Programming and Scripting

Chunks of bash shell programming

I am going to provide a chunks of codes that I do not understand. Please help with them in a layman's terms. 1) ${DEBUG:-0} -------------------------------------------------------------------------- 2) print "${1}" ... (7 Replies)
Discussion started by: lg123
7 Replies

8. Shell Programming and Scripting

Compare two unsorted unequal files extracted from xml

I have two files for comparison which are extracts from set of xml files. file1 has: Comparing File: BRCSH1to320140224CC3.xml :: TZZZ:BR :: TAZZ:OUT UIZZ:0 :: ERAZ:1.000000 UIZZ:0 :: CTZZ:B UIZZ:0 :: CCAZ:MYR Comparing File: BRMY20140224CC18REG013SPFNSY13.xml :: TZZZ:BR :: TAZZ:INB... (1 Reply)
Discussion started by: vamsi gunda
1 Replies

9. Shell Programming and Scripting

Move files from one directory to another in chunks

All, I have an application that is not working properly and the company is 'in the process' of fixing it. In the meantime, I want to write a bash script work-around. However, what I thought was going to be simple is seemingly not. Need: - Move files from one directory to another in... (3 Replies)
Discussion started by: hburnswell
3 Replies

10. UNIX for Beginners Questions & Answers

Perl: Can someone please explain this code "sort { $a <=> $b } @unsorted"

@sorted = sort { $a <=> $b } @unsorted; I am having hard time understanding how this works? I know the output but interested to know the working. Thanks in advance. (2 Replies)
Discussion started by: Tanu
2 Replies
libpthread(3LIB)						Interface Libraries						  libpthread(3LIB)

NAME
libpthread - POSIX threads library SYNOPSIS
cc -mt [ flag... ] file... -lpthread [ -lrt library... ] DESCRIPTION
Historically, functions in this library provided POSIX threading support. See standards(5). This functionality now resides in libc(3LIB). This library is maintained to provide backward compatibility for both runtime and compilation environments. The shared object is imple- mented as a filter on libc.so.1. New application development needs to specify -lpthread only to obtain POSIX semantics for fork(2) that assumes the behavior of fork1(2) rather than the default behavior that forks all threads. INTERFACES
The shared object libpthread.so.1 provides the public interfaces defined below. See intro(3) for additional information on shared object interfaces. __pthread_cleanup_pop __pthread_cleanup_push pthread_attr_destroy pthread_attr_getdetachstate pthread_attr_getguardsize pthread_attr_getinheritsched pthread_attr_getschedparam pthread_attr_getschedpolicy pthread_attr_getscope pthread_attr_getstackaddr pthread_attr_getstacksize pthread_attr_init pthread_attr_setdetachstate pthread_attr_setguardsize pthread_attr_setinheritsched pthread_attr_setschedparam pthread_attr_setschedpolicy pthread_attr_setscope pthread_attr_setstackaddr pthread_attr_setstacksize pthread_cancel pthread_cond_broadcast pthread_cond_destroy pthread_cond_init pthread_cond_reltimedwait_np pthread_cond_signal pthread_cond_timedwait pthread_cond_wait pthread_condattr_destroy pthread_condattr_getpshared pthread_condattr_init pthread_condattr_setpshared pthread_create pthread_detach pthread_equal pthread_exit pthread_getconcurrency pthread_getschedparam pthread_getspecific pthread_join pthread_key_create pthread_key_delete pthread_kill pthread_mutex_consistent_np pthread_mutex_destroy pthread_mutex_getprioceiling pthread_mutex_init pthread_mutex_lock pthread_mutex_setprioceiling pthread_mutex_trylock pthread_mutex_unlock pthread_mutexattr_destroy pthread_mutexattr_getprioceiling pthread_mutexattr_getprotocol pthread_mutexattr_getpshared pthread_mutexattr_getrobust_np pthread_mutexattr_gettype pthread_mutexattr_init pthread_mutexattr_setprioceiling pthread_mutexattr_setprotocol pthread_mutexattr_setpshared pthread_mutexattr_setrobust_np pthread_mutexattr_settype pthread_once pthread_rwlock_destroy pthread_rwlock_init pthread_rwlock_rdlock pthread_rwlock_tryrdlock pthread_rwlock_trywrlock pthread_rwlock_unlock pthread_rwlock_wrlock pthread_rwlockattr_destroy pthread_rwlockattr_getpshared pthread_rwlockattr_init pthread_rwlockattr_setpshared pthread_self pthread_setcancelstate pthread_setcanceltype pthread_setconcurrency pthread_setschedparam pthread_setspecific pthread_sigmask pthread_testcancel FILES
/lib/libpthread.so.1 a filter on /lib/libc.so.1 /lib/64/libpthread.so.1 a filter on /lib/64/libc.so.1 ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsl (32-bit) | +-----------------------------+-----------------------------+ | |SUNWcslx (64-bit) | +-----------------------------+-----------------------------+ |MT-Level |Safe | +-----------------------------+-----------------------------+ SEE ALSO
pvs(1), intro(2), intro(3), libc(3LIB), libc_db(3LIB), libthread(3LIB), attributes(5), standards(5), threads(5) SunOS 5.10 24 Mar 2004 libpthread(3LIB)
All times are GMT -4. The time now is 03:35 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy