这是indexloc提供的服务,不要输入任何密码
Skip to content

AddressSanitizer can't report the issue of freeing stack or local pointer on windows #5918

@forchid

Description

@forchid

Context

  • Operating System & Odin Version:
    Odin: dev-2025-11-nightly:e5153a9
    OS: Windows 10 version: 20H2
    CPU: Intel(R) Core(TM) i7-6500U CPU @ 2.50GHz
    RAM: 8029 MiB
    Backend: LLVM 20.1.0

Expected Behavior

Report AddressSanitizer: bad-free.

Current Behavior

Crash! But it's ok on Linux, and the C++ program also is detected on windows by llvm-mingw.

Failure Information (for bugs)

>free-local
freeing ..

>echo %errorlevel%
-1073740940

Steps to Reproduce

  1. Compiling
>odin build free-local.odin -file -debug -sanitize:address
  1. Executing
>free-local
freeing ..
  1. The errorlevel
>echo %errorlevel%
-1073740940

Failure Logs

free-local.odin

package main

import "core:fmt"

main :: proc() {
    i := 10
    p := &i
    p^ = 20
    
    fmt.println("freeing ..")
    free(p)
    fmt.println("freed!")
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions