Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29274 Discussions

Unhandled exception in __intel_alloc_bpv@4()

jim_cox
Beginner
1,094 Views
This ought to be simple but...

__intel_alloc_bpv@4() is giving me an unhandled exception


The code looks like...

PROGRAM MAIN

CALL ASSPAM(ERRCHK)

CALL ASSPAM(ERRCHK)


The first subroutine works fine

But the second generates an exception as it begins.

The two routines are broadly similar and are not complicated

Compiler version is 11.1.038

Any ideas what might be generating this error?

advTHANKXAnce

Jim

=mjc=
.


0 Kudos
8 Replies
Steven_L_Intel1
Employee
1,094 Views

intel_alloc_bpv is called when you pass a procedure that requires uplevel context. It is also used when a program uses Variable Format Expressions. See my Doctor Fortran post Think, Thank, Thunk for some observations on this. It could be that the stack is getting corrupted across the first call.

What is ERRCHK?
0 Kudos
jim_cox
Beginner
1,094 Views

intel_alloc_bpv is called when you pass a procedure that requires uplevel context. It is also used when a program uses Variable Format Expressions. See my Doctor Fortran post Think, Thank, Thunk for some observations on this. It could be that the stack is getting corrupted across the first call.

What is ERRCHK?


LOGICAL*4 ERRCHK

Used to check that the routines are happy

.FALSE. on entry

What are 'Variable Format Expressions'?
0 Kudos
Steven_L_Intel1
Employee
1,094 Views
Variable Format Expressions are expressions in a format enclosed in angle brackets, like this:

100 FORMAT (F5.2)

Does this program have a CONTAINS statement? Can you attach the actual code?
0 Kudos
jim_cox
Beginner
1,094 Views
Variable Format Expressions are expressions in a format enclosed in angle brackets, like this:

100 FORMAT (F5.2)

Does this program have a CONTAINS statement? Can you attach the actual code?


There is no CONTAINS


Files attached - mail routine is ASSIGN.F

Crashes on the call to ASSLOD at line 245

Have found that if I replace the crashing call with a repeat call to ASSPAM (which worked ok first time at line 124 ) the same error occurs.

I really am stuck on this one - your help is appreciated

Thankx

Jim

PS: apologies for the coding style - the code base this comes from is over 25 years old - and it shows :(
0 Kudos
Les_Neilson
Valued Contributor II
1,094 Views
Unfortunately you didn't add all of the include files so I can't test your program; but compiling assign.f I find that IZONE is used to declare the size of various arrays (eg in the common blocks in assign.i) but IZONE is not given a valueanywhere in the code you attached! (Presumably it is in one of the include files not attached)
There are other variables without a type (eg LONGFILENAMES used as a logical)

Another thought :since this is old codeyou may need to see if itis relying on the original compiler giving variables an initialdefault value.

Les


0 Kudos
jim_cox
Beginner
1,094 Views
Quoting - Les Neilson
Unfortunately you didn't add all of the include files so I can't test your program; but compiling assign.f I find that IZONE is used to declare the size of various arrays (eg in the common blocks in assign.i) but IZONE is not given a valueanywhere in the code you attached! (Presumably it is in one of the include files not attached)
There are other variables without a type (eg LONGFILENAMES used as a logical)

Another thought :since this is old codeyou may need to see if itis relying on the original compiler giving variables an initialdefault value.

Les




I've attached a zip file which has, I hope, everything needed to compile the code. It is a huge codebase, so I may have well have missed something

There is also a couple of datafiles that are needed if you get it to run. I would also suggest you comment out the CALL ASSNET(ERRCHK) at line 154 to avoid trying to open a full dataset. The errior is still present if you do.

But specifically IZONE is declared

INTEGER, PARAMETER :: IZONE=999

in

INCLUDE 'D:SUITEINCLUDESLPARM.I'

called from

INCLUDE 'ASSIGN.I'

I have the compiler warning for undeclared variables on - Assign.f only warns for GDLY (which is a function in gdly.f)

Your comment about uninitialised variables is pertinent, but in my experience most of this code doesnt do that - rather they are created automatically by refering to them, or by assigning them a value

Thankx for your help

Jim

=mjc=
.
0 Kudos
Les_Neilson
Valued Contributor II
1,094 Views
Mmm
Well I downloaded it and created a new project (made some code changes to remove the d: stuff from the includes).
You are right when you say the code is a mess :-) for one thing it contains tab characters which plays havoc with the positioning of the '+' continuation character in fixed format code.

When I compile qlong95.f for example I get lots of errors not least of which there is an "END" statement part way through the code (near line 995) Thereare twoinclude MOVE.I statements, the compiler thinks one of them is within executable code because it comes after an assignment NTH = 0.50 but then there are repetitions ofREALRHO etc, REAL L and REAL T

The firstfive non-system calls in the main program assign.f are
call GAPINI, TRXOPN, PARAM, VERCHK, CLRPAG
none of which are included in the zip file. Though my guess is that CLRPAG and CURSOR (called in ASSPAM for example) are calls to clear the screen and position the cursor?

Just had another thought. Doesthe coderely on local variables (non common)being automatically SAVEd or re-initialisedon subsequentcalls? For example default initialisation implies save.

Les
0 Kudos
jim_cox
Beginner
1,094 Views
Quoting - Les Neilson
Mmm
Well I downloaded it and created a new project (made some code changes to remove the d:
stuff from the includes).
You are right when you say the code is a mess :-) for one thing it contains tab characters which plays havoc with the positioning of the '+' continuation character in fixed format code.

When I compile qlong95.f for example I get lots of errors not least of which there is an "END" statement part way through the code (near line 995) Thereare twoinclude MOVE.I statements, the compiler thinks one of them is within executable code because it comes after an assignment NTH = 0.50 but then there are repetitions ofREALRHO etc, REAL L and REAL T

The firstfive non-system calls in the main program assign.f are
call GAPINI, TRXOPN, PARAM, VERCHK, CLRPAG
none of which are included in the zip file. Though my guess is that CLRPAG and CURSOR (called in ASSPAM for example) are calls to clear the screen and position the cursor?

Just had another thought. Doesthe coderely on local variables (non common)being automatically SAVEd or re-initialisedon subsequentcalls? For example default initialisation implies save.

Les

Yes the tab characters do cause a right pain....

QLONG95.F is not actually being used - has been replaced by QLONG.F

which has 95 compiler
'warning #6717: This name has not been given an explicit type'
messages - but no errors


You will find GAPINI etc in TrxCnFnD.LIB - can supply code and project files if needed. The D in the name is for debug. There is also a release versuon TrxCnFn.LIB

Re the SAVE option - the original code compiles and runs ok with MS Fortran Powerstation v 4.0. I dont think it has a save option for local vars - and I dont think the code expects it.

Any other thoughts?

Thankx for your help

Jim


0 Kudos
Reply