Operating System - OpenVMS
cancel
Showing results for 
Search instead for 
Did you mean: 

Unusual error from Pascal NEW

 
Brian Reiter
Valued Contributor

Unusual error from Pascal NEW

Hi Folks,

One of our development teams is getting the following error message from the Pascal compiler.

%PAS-F-ERRDURNEW, error during NEW
-LIB-F-BADBLOADR, bad block address
%TRACE-F-TRACEBACK, symbolic stack dump follows
image module routine line rel PC abs PC
PAS$RTL 0 0000000000034430 000000007C132430
PAS$RTL 0 000000000003438C 000000007C13238C

(I've attached the output as well.)

The HELP/MESS indicates that this a problem with invalid virtual addresses being passed to LIB$GET_VM or LIB$FREE_VM. The development team have not been able to reproduce this problem in isolation, it only occurs when the full process is up and running.

Any thoughts as to what the problem could be? The point which is the target of the new is local to the procedure.


cheers


Brian
11 REPLIES 11
Brian Reiter
Valued Contributor

Re: Unusual error from Pascal NEW

And the attachment (to make the reading that much easier)

Hoff
Honored Contributor

Re: Unusual error from Pascal NEW

What you're describing - right down to the development team not being able to reproduce it -- points to a corrupted heap and a data or timing or load sensitivity in the code.

I've posted up articles on implementing and using fenceposts and debugging memory management. That material was for C, but this most certainly looks like there's something that's stomped on the heap here.

http://64.223.189.234/node/401

That "something" here could be code in the application that's overrunning a variable or a buffer, an unsynchronized and late-arriving I/O that lands in its buffer from a previously-active stack frame, etc.

Start instrumenting your memory management code, and start centralizing your memory management. Also apply current ECOs for OpenVMS and the LIBRTL.
Volker Halle
Honored Contributor

Re: Unusual error from Pascal NEW

Brian,

consider to use SET PROC/DUMP before running the image, which produces this error. Then a process/image dump will be written, if the error happens. This will allow further diagnosis of the memory contents at the time of the error.

Volker.
John Gillings
Honored Contributor

Re: Unusual error from Pascal NEW

Brian,

Encapsulate your allocations and deallocations in a layer of calls so you can easily add diagnostics.

Try adding calls to LIB$SHOW_VM, LIB$VERIFY_VM_ZONE in various places. If you don't know which done which zone you're in, write a routine which loops using LIB$FIND_VM_ZONE to verify all zones. Call it from strategic points in your code to try to home in on where the heap is being trodden on.
A crucible of informative mistakes
Brian Reiter
Valued Contributor

Re: Unusual error from Pascal NEW

Volker,

I'll as the development team to do the SET PROC/DUMP.

John,

The errors come out of a call to NEW so we have no means of instrumenting that. I will ask the team to add some to calls to check out the VM zones.

I'll also do a check on the code and check for some of the more obvious coding errors (IOSBs used by a QIO being defined as procedure local etc.)

cheers

Brian