Sponsored Content
Top Forums Programming FORTRAN: double free or corruption Post 302807297 by Marce on Tuesday 14th of May 2013 12:48:11 PM
Old 05-14-2013
FORTRAN: double free or corruption

Hello.
I'm looking for a quite "interesting" bug I'm using fortran 90, compiler gfortran and the main idea is for every time step I build a bin structure for search contact between particles, for this at the begining
Code:
TYPE :: circle_index
			INTEGER(kind = 4) :: ind_p
			TYPE(circle_index), POINTER :: p
END TYPE
		
TYPE(circle_index), DIMENSION(:), POINTER :: Bins(:)
TYPE(circle_index), DIMENSION(:), POINTER :: Bins_Tail(:)
TYPE(circle_index),POINTER :: headB

And the next part it's called almost every time step.
I compute rows and colums variables for allocate memory

Code:
ALLOCATE(Bins(rows*columns),Bins_Tail(rows*columns))

Then I do the search for finally
Code:
DO pos = 1, rows*columns
	headB => Bins(pos)%p
	DO
		IF(.NOT. ASSOCIATED(headB)) EXIT
		ptr_index => headB%p
		DEALLOCATE(headB)
		headB => ptr_index
	END DO
END DO
DEALLOCATE(Bins, Bins_Tail)

The search is ok, but I get some of these errors
*** glibc detected *** double free or corruption (out)
*** glibc detected *** free(): invalid next size (normal)

And it's wierd for me because if I'm deallocating in the wrong way I expect the error at the beginig but it does not. The error just appear more after, am I doing it wrong?
I already use -fbounds-check but does not work and is really dificult debug step by step because the simulation is very long, so any ideas?

Does anybody have an idea what is happening here? Have you seen something similar yet? What could i still try?

Greetings & thank you,
Marce.
 

7 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

file corruption

Hi, All of a sudden I landed in a strange problem. I was working with my C source code in vi editor. I did a wq! and when reopened, the file is full of "data".. I mean the text contents are gone!!. I believe this is a file corruption. I have tried the -r option with vi, but no success. ... (5 Replies)
Discussion started by: shibz
5 Replies

2. Programming

*** glibc detected *** double free or corruption: 0x40236ff4 ***

when i try to use the class i wrote, i either get this: *** glibc detected *** double free or corruption: 0x40236ff4 *** and the proccess exits with an error code of 0; or it segfaults. could someone look at my header file (with imp.) to give me some insight as to why its not working? ... (19 Replies)
Discussion started by: norsk hedensk
19 Replies

3. Programming

Pointer to a struct (with pointers) *** glibc detected *** double free

I am using a structure defined as follows struct gene_square { double *x; double *y; };I have class, with a member function which is a pointer of this type: gene_square* m_Genes;I am allocating memory in the constructors like this: m_Genes = new gene_square; for (ii=0;... (1 Reply)
Discussion started by: jatoo
1 Replies

4. Solaris

Data corruption

I have a solaris 5.6 on which oracle is installed. we have an alert file alert_net1.log now whenever any datacorruption happens we get the file id and block id in the above file. through this file and block id , we try to find out which table is corrupted and then try to... (1 Reply)
Discussion started by: asalman.qazi
1 Replies

5. Solaris

MountPoint / is 8% with 899.49MB free crossing threshold of 10% free

Hi, I have a problem one of the server file system cross the limitation MountPoint / is 8% with 899.49MB free crossing threshold of 10% free out put please help how to resolve this dev/vx/dsk/bootdg/rootvol 9.8G 8.8G 956M 91% / /devices ... (3 Replies)
Discussion started by: sriniva0
3 Replies

6. UNIX for Advanced & Expert Users

File System corruption

Hi, While a tar file was created, the file system got full and there was no message on the tar failure. Then the system was shut down and the administrator says because the file system was full the shut down procedure corrupted the file system. I'm wondering, unix should have given some... (2 Replies)
Discussion started by: manivanm
2 Replies

7. Programming

C++ glibc detected double free or corruption(!prev) using shared library

Currently I test a shared library vendor provided in linux , the following is the simple source : #include <iostream> using namespace std; extern int test1(); extern int test2(); int main() { cout << "hello world" << endl ; return 0 ; cout << "Test 1" << endl; ... (6 Replies)
Discussion started by: barfatchen
6 Replies
CONFIG.GUESS(1) 						   User Commands						   CONFIG.GUESS(1)

NAME
config.guess - guess the build system triplet SYNOPSIS
config.guess [OPTION] DESCRIPTION
The GNU build system distinguishes three types of machines, the `build' machine on which the compilers are run, the `host' machine on which the package being built will run, and, exclusively when you build a compiler, assembler etc., the `target' machine, for which the compiler being built will produce code. This script will guess the type of the `build' machine. Output the configuration name of the system `config.guess' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit ENVIRONMENT VARIABLES
config.guess might need to compile and run C code, hence it needs a compiler for the `build' machine: use the environment variable `CC_FOR_BUILD' to specify the compiler for the build machine. If `CC_FOR_BUILD' is not specified, `CC' will be used. Be sure to specify `CC_FOR_BUILD' is `CC' is a cross-compiler to the `host' machine. CC_FOR_BUILD a native C compiler, defaults to `cc' CC a native C compiler, the previous variable is preferred REPORTING BUGS
Report bugs and patches to <config-patches@gnu.org>. Originally written by Per Bothner. Copyright 1992-2016 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICU- LAR PURPOSE. SEE ALSO
autoconf(1), automake(1), autoreconf(1), autoupdate(1), autoheader(1), autoscan(1), config.guess(1), config.sub(1), ifnames(1), libtool(1). GNU Autoconf 2.69 August 2017 CONFIG.GUESS(1)
All times are GMT -4. The time now is 04:55 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy