Skip to content

Segfaults in test suite (bam.c) #56

@benmenadue

Description

@benmenadue

I'm seeing segfaults in the test suite which appear to be coming from this section (specific the load from *fromi).

io_lib/io_lib/bam.c

Lines 233 to 244 in 3ca1202

{
uint64_t *fromi = (uint64_t *)from;
uint64_t *toi = (uint64_t *)to;
while (next_condition >= 8) {
uint64_t w = *fromi ^ 0x0a0a0a0a0a0a0a0aUL;
if (haszero(w))
break;
*toi++ = *fromi++;
next_condition -= 8;
}
}

It looks like my compiler (GCC 15.1.0) has vectorised that while loop and is using vmovdqa for that load:

=> 0x000000000047b937 <+823>:	vmovdqa (%r11,%rcx,1),%ymm4

However that pointer is not aligned suitably for that:

(gdb) print $r11
$13 = 4914885

I suspect the pointer types here need to be replaced with their corresponding __attribute__((aligned(1))) types, and indeed this replacement allows those tests to complete.

(There's also a couple other occurrences of uint*_t in ALLOC_UAC blocks in that file that might need to be replaced with the corresponding _u type.)

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