Skip to content
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

tok3_encode_names crashes on arm on invalid input #105

Closed
shubhamchandak94 opened this issue Oct 6, 2023 · 1 comment · Fixed by #106
Closed

tok3_encode_names crashes on arm on invalid input #105

shubhamchandak94 opened this issue Oct 6, 2023 · 1 comment · Fixed by #106

Comments

@shubhamchandak94
Copy link

shubhamchandak94 commented Oct 6, 2023

Hi, I observed that tok3_encode_names crashes on ARM but not x86_64 when providing an input
blk = [128, 10] (byte 128 followed by newline), level = 7, use_arith=false. Instead of 128, higher bytes also cause this issue.

Commit used: 2aca18b

lscpu:

Architecture:           aarch64
  CPU op-mode(s):       32-bit, 64-bit
  Byte Order:           Little Endian
CPU(s):                 8
  On-line CPU(s) list:  0-7
Vendor ID:              ARM
  Model name:           Neoverse-N1
    Model:              1
    Thread(s) per core: 1
    Core(s) per socket: 8
    Socket(s):          1
    Stepping:           r3p1
    BogoMIPS:           243.75
    Flags:              fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm lrcpc dcpop asimddp ssbs

Trace:

==70891== Process terminating with default action of signal 6 (SIGABRT): dumping core
==70891==    at 0x4A68454: __pthread_kill_implementation (in /usr/lib64/libc.so.6)
==70891==    by 0x4A1F31F: raise (in /usr/lib64/libc.so.6)
==70891==    by 0x4A06223: abort (in /usr/lib64/libc.so.6)
==70891==    by 0x14C9EB: build_trie (tokenise_name3.c:496)
==70891==    by 0x14C9EB: tok3_encode_names (tokenise_name3.c:1459)
==70891==    by 0x14C9EB: tok3_encode_names (tokenise_name3.c:1431)
@jkbonfield
Copy link
Collaborator

I may be a signed vs unsigned char issue and a last of an explicit cast somewhere, but I though the latest change disallowed anything more than 7-bit ASCII.

I'll have an explore. Thanks.

jkbonfield added a commit to jkbonfield/htscodecs that referenced this issue Oct 9, 2023
Replace aborts with returns.  Also be consistent in signed vs unsigned
char behaviour when looking for non-7-bit ASCII.

Fixes samtools#105
jkbonfield added a commit to jkbonfield/htscodecs that referenced this issue Oct 9, 2023
Replace aborts with returns.  Also be consistent in signed vs unsigned
char behaviour when looking for non-7-bit ASCII.

Fixes samtools#105
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants