Post Reply 
Memory corruption issues with a certain integral.
05-13-2021, 01:39 AM (This post was last modified: 05-13-2021 01:52 AM by t_angenbrandt.)
Post: #1
Memory corruption issues with a certain integral.
Good evening.
I have created a tiny program to faster integrate over spherical, cylindrical etc. coordinate systems. The relevant part for this example is as follows:

// Vol.elem. vektoriell Sph. Koordinaten
function e_sp_vol(p_r,p_ϑ,p_φ)
local ret:= ABS(dot(cross(∂(v_r_sp(r,ϑ,φ),r),∂(v_r_sp(r,ϑ,φ),ϑ)),∂(v_r_sp(r,ϑ,φ),φ)));
return ret;
// Volumenintegral für ein Skalarfeld in Sph. Koordinaten
function int_sp(field,p_r,p_ra,p_rb,p_ϑ,p_ϑa,p_ϑb,p_φ,p_φa,p_φb)
local i_field;
local ret;
i_field := subst(field,p_r=ivar_r);
i_field := subst(i_field,p_ϑ=ivar_ϑ);
i_field := subst(i_field,p_φ=ivar_φ);
ret := ∫(∫(∫(i_field*e_sp_vol(ivar_r,ivar_ϑ,ivar_φ),ivar_φ,p_φa,p_φb),ivar_ϑ,p_ϑa,​p_ϑb),ivar_r,p_ra,p_rb);
return ret;

Basically this program takes the arguments and calculates the attached integral.

The problem is, when this function is executed for a couple of times, the CAS starts to misbehave and memory corruption seems to occur; sometimes the operating system simply crashes. The variable browser in HP Connectivity Kit shows seemingly empty variables with strange contents (see attached screen).

You may test this program by calling it with

It sould return the volume of a sphere as it does as long as the memory corruption is not severe enough.

When we restart the CAS, the purged variables look as attached in the screenshot.

Tell me if you have any ideas on what I am missing there.
Kind regards.

Information on the environment:
Prime G2
20210505 update (it was buggy before this version as well)

Attached File(s) Thumbnail(s)
Find all posts by this user
Quote this message in a reply
Post Reply 

Messages In This Thread
Memory corruption issues with a certain integral. - t_angenbrandt - 05-13-2021 01:39 AM

User(s) browsing this thread: 1 Guest(s)