Skip to content
  • Cheng Shao's avatar
    86406f48
    rts: fix rts_clearMemory logic when sanity checks are enabled · 86406f48
    Cheng Shao authored and Marge Bot's avatar Marge Bot committed
    This commit fixes an RTS assertion failure when invoking
    rts_clearMemory with +RTS -DS. -DS implies -DZ which asserts that free
    blocks contain 0xaa as the designated garbage value. Also adds the
    sanity way to rts_clearMemory test to prevent future regression.
    Closes #26011.
    
    ChatGPT Codex automatically diagnosed the issue and proposed the
    initial patch in a single shot, given a GHC checkout and the following
    prompt:
    
    ---
    
    Someone is reporting the following error when attempting to use `rts_clearMemory` with the RTS option `-DS`:
    
    ```
    test.wasm: internal error: ASSERTION FAILED: file rts/sm/Storage.c, line 1216
    
        (GHC version 9.12.2.20250327 for wasm32_unknown_wasi)
        Please report this as a GHC bug:  https://www.haskell.org/ghc/reportabug
    ```
    
    What's the culprit? How do I look into this issue?
    
    ---
    
    I manually reviewed & revised the patch, tested and submitted it.
    86406f48
    rts: fix rts_clearMemory logic when sanity checks are enabled
    Cheng Shao authored and Marge Bot's avatar Marge Bot committed
    This commit fixes an RTS assertion failure when invoking
    rts_clearMemory with +RTS -DS. -DS implies -DZ which asserts that free
    blocks contain 0xaa as the designated garbage value. Also adds the
    sanity way to rts_clearMemory test to prevent future regression.
    Closes #26011.
    
    ChatGPT Codex automatically diagnosed the issue and proposed the
    initial patch in a single shot, given a GHC checkout and the following
    prompt:
    
    ---
    
    Someone is reporting the following error when attempting to use `rts_clearMemory` with the RTS option `-DS`:
    
    ```
    test.wasm: internal error: ASSERTION FAILED: file rts/sm/Storage.c, line 1216
    
        (GHC version 9.12.2.20250327 for wasm32_unknown_wasi)
        Please report this as a GHC bug:  https://www.haskell.org/ghc/reportabug
    ```
    
    What's the culprit? How do I look into this issue?
    
    ---
    
    I manually reviewed & revised the patch, tested and submitted it.
Loading