Skip to content

segfault in ScalarField3D_value #40

Description

@filefolder

Hi Malcom,

I had been experiencing this issue for quite some time, I suspect caused by an edge effect somewhere as it mostly happens with shallower models.

2023260T11:18:19::INFO::0000:: Tracing rays. (using within the context of pyvoro as usual!)
[gadi-cpu-clx-2555:2519722:0:2519722] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x813db60)
==== backtrace (tid:2519722) ====
 0 0x0000000000012cf0 __funlockfile()  :0
 1 0x000000000004e41a __pyx_f_7pykonal_6fields_13ScalarField3D_value()  /home/158/rp6923/pykonal/pykonal/fields.cpp:10512
 2 0x0000000000057f26 __pyx_f_7pykonal_6fields_13ScalarField3D_trace_ray()  /home/158/rp6923/pykonal/pykonal/fields.cpp:9622
 3 0x000000000005a736 __pyx_pf_7pykonal_6fields_13ScalarField3D_4trace_ray()  /home/158/rp6923/pykonal/pykonal/fields.cpp:10149
 4 0x000000000005a736 __pyx_pw_7pykonal_6fields_13ScalarField3D_5trace_ray()  /home/158/rp6923/pykonal/pykonal/fields.cpp:10132

adding the last bit within the else clause in fields.pyx around line 500 seems to be a valid workaround... FWIW to anyone else and curious if this is a thing you've ran into yourself or might have a better way to address.

        for iax in range(3):
            if (
                (
                    point[iax] < self.cy_min_coords[iax]
                    or point[iax] > self.cy_max_coords[iax]
                )
                and not self.cy_iax_isperiodic[iax]
                and not self.cy_iax_isnull[iax]
            ):
                return (null)
            idx[iax]   = (point[iax] - self.cy_min_coords[iax]) / self.cy_node_intervals[iax]
            if self.cy_iax_isnull[iax]:
                ii[iax][0] = 0
                ii[iax][1] = 0
            else:
                ii[iax][0]  = <Py_ssize_t>idx[iax]
                ii[iax][1]  = <Py_ssize_t>(ii[iax][0]+1) % self.npts[iax]

                # **** double check still in bounds
                if ii[iax][0] < 0 or ii[iax][0] >= self.npts[iax] or ii[iax][1] < 0 or ii[iax][1] >= self.npts[iax]:
                    return null

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions