-
Notifications
You must be signed in to change notification settings - Fork 630
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
negative array indices in step_update_EDHB #1482
Comments
To provide some additional information, this issue is related to a
Line 536 in 2dcfa9f
In this case, Lines 376 to 378 in 2dcfa9f
In this case, the problem is with the
Lines 547 to 548 in 2dcfa9f
The similar problem here are the The errors can be removed simply by enforcing the rule that these lines are invoked only for non-negative indices, that is when |
It might be helpful to print out the coordinates of the problematic point, i.e. add something like if (i - s1 < 0) {
IVEC_LOOP_ILOC(gv, iloc);
// print out iloc
} |
Some more clues: the failing subtest in Lines 984 to 985 in f2bae0c
The error is related to the Lines 140 to 146 in f2bae0c
(The error is not related to the z-mirror symmetry.) |
The failing subtest in meep/tests/convergence_cyl_waveguide.cpp Lines 175 to 176 in f2bae0c
Following the suggestion of using an if-statement inside Note that this particular test setup uses a Bloch-periodic boundary condition k=(kr,kz)=(0.1,0) in cylindrical coordinates. Removing this boundary condition did not affect the negative array index error. |
When the test cases "convergence_cyl_waveguide" and "symmetry" were ran with ASan, it reports the heap-buffer-overflow meep/src/step_generic_stride1.cpp:539:29 and heap-buffer-overflow meep/src/step_generic_stride1.cpp:551:46
My study shows that the index values
i - s1
andi - s2
will hit negative values in LOOP_OVER_VOL_OWNED. When I used if statements(i >=s1)
and(i >= s2)
to conditionally access the arrays, test was passed without warnings.Since this loop macro is used in many places, could you please take a look and find a generic solution to fix this issue?
The text was updated successfully, but these errors were encountered: