Skip to content

Conversation

@willieyz
Copy link
Contributor

@willieyz willieyz commented Dec 9, 2025

=================================================================
  ==19858==ERROR: AddressSanitizer: unknown-crash on address 0x7ffff4b0024e at pc 0x000000418234 bp 0x7fffffffaa30 sp 0x7fffffffaa28
  READ of size 32 at 0x7ffff4b0024e thread T0
      #0 0x418233 in PQCP_MLDSA_NATIVE_MLDSA44_mld_polyz_unpack_17_avx2 (/home/runner/work/mldsa-native/mldsa-native/test/build/mldsa44/bin/test_unit44+0x418233)
      #1 0x4108c3 in PQCP_MLDSA_NATIVE_MLDSA44_polyz_unpack (/home/runner/work/mldsa-native/mldsa-native/test/build/mldsa44/bin/test_unit44+0x4108c3)
      #2 0x403671 in test_mld_polyz_unpack_core (/home/runner/work/mldsa-native/mldsa-native/test/build/mldsa44/bin/test_unit44+0x403671)
      #3 0x403ba8 in test_native_polyz_unpack (/home/runner/work/mldsa-native/mldsa-native/test/build/mldsa44/bin/test_unit44+0x403ba8)
      #4 0x402b15 in main (/home/runner/work/mldsa-native/mldsa-native/test/build/mldsa44/bin/test_unit44+0x402b15)
      #5 0x7ffff6c2a47d in __libc_start_call_main (/nix/store/2j5v2nxxkqd6i53bzrg594rrr5r2v95b-glibc-join/lib/libc.so.6+0x2a47d) (BuildId: 184c6644327611cadef0a544327ebb842fceaa2c)
      #6 0x7ffff6c2a538 in __libc_start_main_alias_1 (/nix/store/2j5v2nxxkqd6i53bzrg594rrr5r2v95b-glibc-join/lib/libc.so.6+0x2a538) (BuildId: 184c6644327611cadef0a544327ebb842fceaa2c)
      #7 0x402f44 in _start (/home/runner/work/mldsa-native/mldsa-native/test/build/mldsa44/bin/test_unit44+0x402f44)
  
  Address 0x7ffff4b0024e is located in stack of thread T0 at offset 590 in frame
      #0 0x403aef in test_native_polyz_unpack (/home/runner/work/mldsa-native/mldsa-native/test/build/mldsa44/bin/test_unit44+0x403aef)
  
    This frame has 1 object(s):
      [32, 608) 'test_bytes' (line 476) <== Memory access at offset 590 partially overflows this variable
  HINT: this may be a false positive if your program uses some custom stack unwind mechanism, swapcontext or vfork
        (longjmp and C++ exceptions *are* supported)
  SUMMARY: AddressSanitizer: unknown-crash (/home/runner/work/mldsa-native/mldsa-native/test/build/mldsa44/bin/test_unit44+0x418233) in PQCP_MLDSA_NATIVE_MLDSA44_mld_polyz_unpack_17_avx2
  Shadow bytes around the buggy address:
    0x7ffff4afff80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    0x7ffff4b00000: f1 f1 f1 f1 00 00 00 00 00 00 00 00 00 00 00 00
    0x7ffff4b00080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    0x7ffff4b00100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    0x7ffff4b00180: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  =>0x7ffff4b00200: 00 00 00 00 00 00 00 00 00[00]00 00 f3 f3 f3 f3
    0x7ffff4b00280: f3 f3 f3 f3 f3 f3 f3 f3 f3 f3 f3 f3 00 00 00 00
    0x7ffff4b00300: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    0x7ffff4b00380: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    0x7ffff4b00400: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    0x7ffff4b00480: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  Shadow byte legend (one shadow byte represents 8 application bytes):
    Addressable:           00
    Partially addressable: 01 02 03 04 05 06 07 
    Heap left redzone:       fa
    Freed heap region:       fd
    Stack left redzone:      f1
    Stack mid redzone:       f2
    Stack right redzone:     f3
    Stack after return:      f5
    Stack use after scope:   f8
    Global redzone:          f9
    Global init order:       f6
    Poisoned by user:        f7
    Container overflow:      fc
    Array cookie:            ac
    Intra object redzone:    bb
    ASan internal:           fe
    Left alloca redzone:     ca
    Right alloca redzone:    cb
  ==19858==ABORTING
  make: *** [Makefile:72: run_unit_44] Error 1

@willieyz willieyz mentioned this pull request Dec 9, 2025
willieyz and others added 3 commits December 11, 2025 11:58
- Add test infrastructure in Makefile and scripts/tests
- Update build rules in test/mk/ for component testing

- Create test_unit.c and implement unit tests for
  mld_polyz_unpack and mld_polyz_unpack_c

Signed-off-by: willieyz <willie.zhao@chelpis.com>
Signed-off-by: Matthias J. Kannwischer <matthias@kannwischer.eu>
Signed-off-by: Matthias J. Kannwischer <matthias@kannwischer.eu>
@mkannwischer mkannwischer force-pushed the mld_polyz_unpack-debug branch from 07b1aba to 3cf65ad Compare December 11, 2025 03:59
Signed-off-by: Matthias J. Kannwischer <matthias@kannwischer.eu>
@mkannwischer mkannwischer force-pushed the mld_polyz_unpack-debug branch from 3cf65ad to 5b85d93 Compare December 11, 2025 04:44
@hanno-becker
Copy link
Contributor

We should be able to pick this up now that #784 is merged?

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 this pull request may close these issues.

4 participants