-
Notifications
You must be signed in to change notification settings - Fork 272
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
[BLD] Segmentation fault when tested on some platforms #3676
Comments
It's fine, or anyway it's much better than keeping them to yourself :) |
@olebole do you have access to a machine with any of the architecture where the problem arises? If so, it would be useful to be able run the test through gdb to get where in |
@cphyc that's a good point -- and we might be particularly susceptible due to the bit twiddling we do in the coarse index initialization. |
It is not endianess -- all failing architectures are little endian (as x86), and the only big endian arch we have (s390x) builds fine (all tests passing). |
@olebole Not to sound too amateur, but do you think we could conceivably reproduce the error with an emulator or something, even if it's very slow? |
I am not sure whether an emulator is as picky as the hardware when it comes to alignment errors. You could try it, and if you are lucky, then it reproduce the problem. |
I could create a stack trace on mipsel64:
These lines look like this: /* "yt/geometry/particle_oct_container.pyx":597
* mi = bounded_morton_split_dds(ppos[0], ppos[1], ppos[2], LE,
* dds, mi_split)
* mask[mi] = 1 # <<<<<<<<<<<<<<
* particle_counts[mi] += 1
* # Expand mask by softening
*/
__pyx_t_13 = __pyx_v_mi;
*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_mask.data + __pyx_t_13 * __pyx_v_mask.strides[0]) )) = 1; Note that the yt/yt/geometry/particle_oct_container.pyx Lines 595 to 597 in d0e1257
One observation was that this seems not 100% reproducible; I needed actually two attempts to get it (in the first one, the test passes). |
To complete this, here is an
EDIT I updated this and the previous post with running a build without optimization ( What may be the problem is this: |
Thanks so much for the detailed log. I think I may have tracked the issue down to the fact --- a/yt/geometry/particle_oct_container.pyx
+++ b/yt/geometry/particle_oct_container.pyx
@@ -587,11 +587,11 @@ cdef class ParticleBitmap:
for i in range(3):
axiter[i][1] = 999
# Skip particles outside the domain
- if pos[p,i] >= RE[i] or pos[p,i] < LE[i]:
+ if not (LE[i] <= pos[p, i] < RE[i]):
skip = 1
break
ppos[i] = pos[p,i]
- if skip==1: continue
+ if skip == 1: continue
mi = bounded_morton_split_dds(ppos[0], ppos[1], ppos[2], LE,
dds, mi_split)
mask[mi] = 1
@@ -756,11 +756,11 @@ cdef class ParticleBitmap:
skip = 0
for i in range(3):
axiter[i][1] = 999
- if pos[p,i] >= RE[i] or pos[p,i] < LE[i]:
+ if not (LE[i] <= pos[p, i] < RE[i]):
skip = 1
break
ppos[i] = pos[p,i]
- if skip==1: continue
+ if skip == 1: continue
# Only look if collision at coarse index
mi1 = bounded_morton_split_dds(ppos[0], ppos[1], ppos[2], LE,
dds1, mi_split1) Essentially the issue seems to be that [EDIT: easier fix!] |
Small update @olebole I have tested the proposed bugfix (#3688) locally and it seems to be passing. I have left it to draft so that it isn't fixed if it doesn't solve this issue. |
Bug report
Bug summary
When running the tests, on some platforms appears a segmentation fault in
test_gadget_binary
.The platforms are MIPS (32+64 bit; official Debian architectures), HP-PA, RiscV64, Sparc64 (unofficial architectures).
(sorry for flowing you with exotic bugs)
Actual outcome
Full build log for RiscV64
This seems to happen in
yt/geometry/particle_oct_container.pyx
Version Information
The text was updated successfully, but these errors were encountered: