Search the Community
Showing results for tags 'crash'.
Found 2 results
-
Detect stack full for recursive routine
david_navigator posted a topic in RTL and Delphi Object Pascal
I have some inherited code that does some complex maths using a recursive function (i.e the function calls itself). Last night a customer had a situation where running the routine killed the app. My belief is that the app ran out of stack space due to this routine calling itself multiple times and thus died. Is there anyway to detect this is likely to happen so that the code can be aborted with a message instead? David -
Memory exception fault when using PyArg_ParseTuple(y*) with buffer pointer
dnbif72 posted a topic in Python4Delphi
Hello, I am getting a memory exception when parsing numpy data buffers passed using the PyArg_ParseTuple() method. I am using C++Builder in 11.3. I updated my P4D yesterday, using the auto installer and code from the master repo. My code on the C++ end is: PPyObject array1( PPyObject self, PPyObject args ) { TPythonEngine * eng = GetPythonEngine(); unsigned int i1; unsigned long num_points; double * data; int ret = eng->PyArg_ParseTuple(args,"y*",&data); // copy data num_points = python_interface::num_points; for (i1=0; i1<num_points; i1++) python_interface::test_array1[i1] = *(data+i1); return eng->ReturnNone(); } on the python side I have: import numpy as np import python_module num_pts = 10 python_module.array_size(num_pts) test_arr1 = np.linspace(1.0,10.0,num_pts,dtype=float) python_module.array1(test_arr1.data) test_arr2 = np.linspace(2.0,20.0,num_pts,dtype=float) python_module.array2(test_arr2.data) The data is passed fine, and the values are consistent. The exception occurs when the ReturnNone() call is made. Project p4d.exe raise exception class $C0000005 with message 'access violation at 0x00c1d000: read of address 0x000000b8'. Exception occurs regardless of whether or not data is copied. The script does not continue pass this point, and returns the exception so the second array is never passed. Any ideas? Please let me know if you need any other info, and any help would be appreciated.- 5 replies
-
- parsetuple
- exception
-
(and 2 more)
Tagged with: