-
Notifications
You must be signed in to change notification settings - Fork 629
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
segmentation fault in _default_material argument of create_structure_and_set_materials #1483
Comments
Which |
I'm not clear on what simulation you are running — IIRC, anything that calls the routines in meepgeom.cpp should normally call |
To provide some additional information, the error reported by the address sanitizer is related to the statement Lines 402 to 406 in f2bae0c
Lines 444 to 448 in f2bae0c
Lines 2549 to 2553 in f2bae0c
The issue here is that (define nothing (if (eq? MATERIAL-TYPE 'SCM)
'()
(if (for-all? (class-properties-all material-type)
property-has-default?)
(make material-type)
no-default)))
(define-input-var default-material nothing MATERIAL-TYPE) A NULL pointer therefore cannot be cast into a |
void*
to material_type
) reported by ASan
It seems like there is a missing |
The problem here seems to be SWIG deleting the Lines 1887 to 1889 in ef8f6fc
Lines 1907 to 1908 in ef8f6fc
Lines 2060 to 2070 in ef8f6fc
Note that Line 232 in ef8f6fc
The SWIG generated file
The obvious solution seems to be to just prevent SWIG from deleting |
When I ran a simulation case involved gradient calculation (
calculate_gradient()
),default_material
in C++ implementation is never assigned the type ofmaterial_type
and pointed to a valid memory allocation in the workflow of gradient calculation. So the conversion fromvoid*
tomaterial_type
is invalid. A simple workaround is to delete the "else if" branch, and It passed test cases. Please check this issue.The text was updated successfully, but these errors were encountered: