Sponsored Content
Homework and Emergencies Homework & Coursework Questions FORTRAN error *** glibc detected *** Post 302937682 by antonija on Saturday 7th of March 2015 06:06:31 PM
Old 03-07-2015
FORTRAN error *** glibc detected ***

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!

1. The problem statement, all variables and given/known data:


I'm doing aproximation of derivative called five-point stencil. For every value of x, in interval [a,b], in step of 0.1 i need to calculate derivative.

2. Relevant commands, code, scripts, algorithms:

The equation is like this:
Code:
Five-point stencil:
(-f(x + 2h) + 8f(x + h) - 8f(x - h) + f(x - 2h))/(12*h)
---> (-first+8*sec-8*third+fourth)/12*h

I want to calculate every of theese, so first, sec, third.... expression and then at the end calculate derivative.

3. The attempts at a solution (include all code and scripts):

Code:
variables = 'x'
x=a+2*h
do while(x<=b)
variablesvalues=x
x=x+delta
call recog_variables (func, variables)
first(i)=evaluate(variablesvalues)
print*,'to je',first(i)
i=i+1
call destroyfunc()
end do



x=a+h  !without this, program works, prints first(i), but it doesn't print sec(i).

do while(x<=b)
variablesvalues=x
x=x+delta
call recog_variables (func, variables)
sec(i)=evaluate(variablesvalues)
print*,'to je',sec(i)
i=i+1
call destroyfunc()
end do


4. Complete Name of School (University), City (State), Country, Name of Professor, and Course Number (Link to Course):

I'm studying physics in Rijeka, University of Rijeka, Croatia, but it's not for exact course, I'm doing it because I want to learn...
 

10 More Discussions You Might Find Interesting

1. Programming

*** glibc detected *** free(): invalid next size (normal): 0x0000000000503e70 ***

hi, I have made a small C program that make use of malloc and free for processing bitmap images. when i try to run the program, I am getting a error something like *** glibc detected *** free(): invalid next size (normal): 0x0000000000503e70 *** I am not sure of which free() is causing this... (1 Reply)
Discussion started by: vbreddy
1 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. Programming

Why does this occur? *** glibc detected *** malloc(): memory corruption: 0x10013ff8 ***

there seems not to be error in this segment. In some computers, it can work well. But in others, it will give a failure. why it ocurrs and how to deal with it? in a function: if( *ver == NULL ) { *ver = (vertex *) malloc(sizeof(vertex)); //this line ... (17 Replies)
Discussion started by: cdbug
17 Replies

5. Programming

"GLIBC detected Error" for a simple C code.

Here is a simple program to find the vowels in the string. Output is fine. But I'm getting GLIBC detected as shown below : :eek: *** glibc detected *** ./VOWELS: free(): invalid pointer: 0x08b82013 *** ======= Backtrace: ========= /lib/libc.so.6 /lib/libc.so.6(cfree+0x59) ./VOWELS... (5 Replies)
Discussion started by: Ranji Raj
5 Replies

6. Programming

*** glibc detected *** ./a.out: malloc(): memory corruption (fast):

*** glibc detected *** ./a.out: malloc(): memory corruption (fast): Posted A minute ago M trying to make multiway tree and dont know what happend when this part of code get executed: 01void ins(NODE *ptr) 02{ 03 //working 04 if(ptr!=NULL) 05 { 06 SNODE *var=NULL; 07 var=(SNODE... (3 Replies)
Discussion started by: exgenome
3 Replies

7. Programming

*** glibc detected *** : malloc(): memory corruption (fast)

Hi Friends, while executing the below code, am getting *** glibc detected *** ./ok: malloc(): memory corruption (fast) error, please suggest how to solve this issue. #include <stdio.h> #include <string.h> #include <sqlca.h> #include <alloca.h> /* Define constants for VARCHAR... (2 Replies)
Discussion started by: mpjobsrch
2 Replies

8. UNIX and Linux Applications

Install glibc-debug for glibc-2.11.3-17.31.1 on SLES 11

I have to debug a function getopt_long in glibc-2.11.3-17.31.1. For that how can I download and install its corresponding glibc-debug on SLES 11? (8 Replies)
Discussion started by: rupeshkp728
8 Replies

9. Programming

*** glibc detected *** ./a.out malloc() memory corruption

I am facing a problem of memory corruption. The loop runs for the first time but does not go through the second time. What could be the problem? for(int z=0;z<2;z++) { fp=fopen("poly.dat","r"); /*do something which reads this file into a 2D array*/ fclose(fp); ... (10 Replies)
Discussion started by: dare
10 Replies

10. 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
GLSTENCILFUNC(3G)														 GLSTENCILFUNC(3G)

NAME
glStencilFunc - set function and reference value for stencil testing C SPECIFICATION
void glStencilFunc( GLenum func, GLint ref, GLuint mask ) PARAMETERS
func Specifies the test function. Eight tokens are valid: GL_NEVER, GL_LESS, GL_LEQUAL, GL_GREATER, GL_GEQUAL, GL_EQUAL, GL_NOTEQUAL, and GL_ALWAYS. The initial value is GL_ALWAYS. ref Specifies the reference value for the stencil test. ref is clamped to the range [0,2n-1], where n is the number of bitplanes in the stencil buffer. The initial value is 0. mask Specifies a mask that is ANDed with both the reference value and the stored stencil value when the test is done. The initial value is all 1's. DESCRIPTION
Stenciling, like depth-buffering, enables and disables drawing on a per-pixel basis. You draw into the stencil planes using GL drawing primitives, then render geometry and images, using the stencil planes to mask out portions of the screen. Stenciling is typically used in multipass rendering algorithms to achieve special effects, such as decals, outlining, and constructive solid geometry rendering. The stencil test conditionally eliminates a pixel based on the outcome of a comparison between the reference value and the value in the stencil buffer. To enable and disable the test, call glEnable and glDisable with argument GL_STENCIL_TEST. To specify actions based on the outcome of the stencil test, call glStencilOp. func is a symbolic constant that determines the stencil comparison function. It accepts one of eight values, shown in the following list. ref is an integer reference value that is used in the stencil comparison. It is clamped to the range [0,2n-1], where n is the number of bitplanes in the stencil buffer. mask is bitwise ANDed with both the reference value and the stored stencil value, with the ANDed values participating in the comparison. If stencil represents the value stored in the corresponding stencil buffer location, the following list shows the effect of each comparison function that can be specified by func. Only if the comparison succeeds is the pixel passed through to the next stage in the rasterization process (see glStencilOp). All tests treat stencil values as unsigned integers in the range [0,2n-1], where n is the number of bitplanes in the stencil buffer. The following values are accepted by func: GL_NEVER Always fails. GL_LESS Passes if ( ref & mask ) < ( stencil & mask ). GL_LEQUAL Passes if ( ref & mask ) <= ( stencil & mask ). GL_GREATER Passes if ( ref & mask ) > ( stencil & mask ). GL_GEQUAL Passes if ( ref & mask ) >= ( stencil & mask ). GL_EQUAL Passes if ( ref & mask ) = ( stencil & mask ). GL_NOTEQUAL Passes if ( ref & mask ) != ( stencil & mask ). GL_ALWAYS Always passes. NOTES
Initially, the stencil test is disabled. If there is no stencil buffer, no stencil modification can occur and it is as if the stencil test always passes. ERRORS
GL_INVALID_ENUM is generated if func is not one of the eight accepted values. GL_INVALID_OPERATION is generated if glStencilFunc is executed between the execution of glBegin and the corresponding execution of glEnd. ASSOCIATED GETS
glGet with argument GL_STENCIL_FUNC glGet with argument GL_STENCIL_VALUE_MASK glGet with argument GL_STENCIL_REF glGet with argument GL_STENCIL_BITS glIsEnabled with argument GL_STENCIL_TEST SEE ALSO
glAlphaFunc(3G), glBlendFunc(3G), glDepthFunc(3G), glEnable(3G), glIsEnabled(3G), glLogicOp(3G), glStencilOp(3G) GLSTENCILFUNC(3G)
All times are GMT -4. The time now is 01:45 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy