# PyCharm exit code -1073741819 (0xC0000005)

**URL:** <https://numba.discourse.group/t/pycharm-exit-code-1073741819-0xc0000005/740>\
**Category:** Support: What is this error message?\
**Created:** [June 3, 2021, 10:55am UTC](https://numba.discourse.group/t/pycharm-exit-code-1073741819-0xc0000005/740 "2021-06-03T10:55:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![numbaproblems](https://avatars.discourse-cdn.com/v4/letter/n/dec6dc/32.png) [@numbaproblems](https://numba.discourse.group/u/numbaproblems)\
**Post date:** [June 3, 2021, 10:55am UTC](https://numba.discourse.group/t/pycharm-exit-code-1073741819-0xc0000005/740/1 "2021-06-03T10:55:53Z")

</div>

I have a function that uses jit (intersects\_numba) which is called in another function (ray\_intersection) that is used for ray tracing. If I obtain the objects that are arguments in the ray tracing function by simply creating them as outputs of other individual functions the script runs without any problems.  
The problem occurs when I create those objects in a function that contains inside the smaller functions and I have all the objects as outputs of that said function.  
After I do that, even though the objects are the same in the two cases, PyCharm is crashing in the intersects\_numba function.

The code that I will share is the smallest reproducible one that I could create to show the error, since the full code is confidential.

```auto
from shapely.geometry import Polygon, Point, LineString
import numpy as np
from shapely.geos import lgeos
from numba import jit

GEOSContains_ctypes = lgeos._lgeos.GEOSContains_r
GEOSIntersects_r = lgeos._lgeos.GEOSIntersects_r
GEOS_HANDLE = lgeos.geos_handle

def get_all(polygon_a):
    polygon_shapely_a = np.array([Polygon(section_polygon) for section_polygon in polygon_a])
    polygon_geom = np.array([x._geom for x in polygon_shapely_a])

    return polygon_geom

@jit(nopython=True)
def intersects_numba(p_geom, array_geom, geos_handle):
    n = array_geom.shape[0]
    res = np.array([GEOSIntersects_r(geos_handle, p_geom, array_geom[i]) for i in range(n)])
    return res

def ray_intersection(ray_geom, polygon_geom):
    int_array = []
    for ii, line_string in enumerate(ray_geom):
        bool_array = intersects_numba(line_string, polygon_geom, GEOS_HANDLE)
        print(bool_array)
        int_array.append(bool_array)
    return int_array

def rt_arrays(ray, polygon_geom):
    linestring_ray = [LineString(linestring) for linestring in ray]
    geom_ray = np.array([x._geom for x in linestring_ray])
    int_arr = ray_intersection(geom_ray, polygon_geom)
    a = 2 + 2
    return a

polygon_list = [[[0.0, 0.0], [2500.0, 0.0], [2493.91, 174.391], [0.0, 0.0]],
                [[0.0, 0.0], [2493.91, 174.391], [2475.67, 347.933], [0.0, 0.0]],
                [[0.0, 0.0], [2475.67, 347.933], [2445.369, 519.779], [0.0, 0.0]],
                [[0.0, 0.0], [2445.369, 519.779], [2403.154, 689.093], [0.0, 0.0]],
                [[0.0, 0.0], [2403.154, 689.093], [2349.232, 855.05], [0.0, 0.0]],
                [[0.0, 0.0], [2349.232, 855.05], [2283.864, 1016.842], [0.0, 0.0]],
                [[0.0, 0.0], [2283.864, 1016.842], [2207.369, 1173.679], [0.0, 0.0]],
                [[0.0, 0.0], [2207.369, 1173.679], [2120.12, 1324.798], [0.0, 0.0]],
                [[0.0, 0.0], [2120.12, 1324.798], [2022.542, 1469.463], [0.0, 0.0]],
                [[0.0, 0.0], [2022.542, 1469.463], [1915.111, 1606.969], [0.0, 0.0]],
                [[0.0, 0.0], [1915.111, -1606.969], [2022.542, -1469.463], [0.0, 0.0]],
                [[0.0, 0.0], [2022.542, -1469.463], [2120.12, -1324.798], [0.0, 0.0]],
                [[0.0, 0.0], [2120.12, -1324.798], [2207.369, -1173.679], [0.0, 0.0]],
                [[0.0, 0.0], [2207.369, -1173.679], [2283.864, -1016.842], [0.0, 0.0]],
                [[0.0, 0.0], [2283.864, -1016.842], [2349.232, -855.05], [0.0, 0.0]],
                [[0.0, 0.0], [2349.232, -855.05], [2403.154, -689.093], [0.0, 0.0]],
                [[0.0, 0.0], [2403.154, -689.093], [2445.369, -519.779], [0.0, 0.0]],
                [[0.0, 0.0], [2445.369, -519.779], [2475.67, -347.933], [0.0, 0.0]],
                [[0.0, 0.0], [2475.67, -347.933], [2493.91, -174.391], [0.0, 0.0]],
                [[0.0, 0.0], [2493.91, -174.391], [2500.0, 0.0], [0.0, 0.0]]]
ray = [[[3.603, 16.128, 11.55], [2003.603, 16.128, 11.55]],
       [[3.603, 16.128, 11.55], [2003.2983900000002, 51.03281, 11.55]]]

polygon_geom_a = get_all(polygon_list)
a = rt_arrays(ray, polygon_geom_a)

```

> Process finished with exit code -1073741819 (0xC0000005)

If I don’t use the get\_all() function to create the polygon\_geom object (In reality I create some other objects as well) the script is executed without a problem.

```auto
polygon_shapely_a = np.array([Polygon(section_polygon) for section_polygon in polygon_list])
polygon_geom_a = np.array([x._geom for x in polygon_shapely_a])

a = rt_arrays(ray, polygon_geom_a)

```

> Process finished with exit code 0

I’d appreciate any help on this, this is the second time that I post the same issue, the first time I didn’t receive much feedback several months ago.

---

<div class="post-metadata">

**Author:** ![gmarkall](https://yyz2.discourse-cdn.com/free1/user_avatar/numba.discourse.group/gmarkall/32/42_2.png) [@gmarkall](https://numba.discourse.group/u/gmarkall)\
**Post date:** [June 4, 2021, 11:35am UTC](https://numba.discourse.group/t/pycharm-exit-code-1073741819-0xc0000005/740/2 "2021-06-04T11:35:55Z")

</div>

0cC0000005 is the exit code for an access violation in Windows - generally this occurs when a program access invalid / out of bounds memory. If you remove the jit decorators, does your program execute correctly?

(This is similar advice to the previous response you received - if the code doesn’t work without the jit decorator, then that needs to be resolved first before looking into issues using the jit decorator)
