Skip to content

CUDA santizer segfault before detecting memory errors #218

@ehein6

Description

@ehein6

uv/pixi CLI Version

0.63.2

Mojo Version

0.26.2.0.dev2026020505

GPU Information

NVIDIA B200

Operating System

Ubuntu 22.04

Related Puzzle

Puzzle 10

What happened?

The compute sanitizer appears to segfault, but then produces the expected output. Below is the output after fixing the memory bug in the first example.

Steps to Reproduce

Solve puzzle 10 part one and run:

MODULAR_DEVICE_CONTEXT_MEMORY_MANAGER_SIZE_PERCENT=0 pixi run compute-sanitizer --tool memcheck mojo problems/p10/p10.mojo --memory-bug

The error occurs even without solving the puzzle first, we just see the memory errors detected too.

Relevant Log Output

MODULAR_DEVICE_CONTEXT_MEMORY_MANAGER_SIZE_PERCENT=0 pixi run compute-sanitizer --tool memcheck mojo problems/p10/p10.mojo --memory-bug

========= COMPUTE-SANITIZER
[106586:106586:20260210,170812.481306:WARNING close_multiple.cc:66] close: Bad file descriptor (9)
[106586:106586:20260210,170812.481416:WARNING close_multiple.cc:66] close: Bad file descriptor (9)
Please submit a bug report to https://github.com/modular/modular/issues and include the crash backtrace along with all the relevant source codes.
Stack dump:
0.      Program arguments: /home/ubuntu/mojo-gpu-puzzles/.pixi/envs/default/bin/mojo problems/p10/p10.mojo --memory-bug
 #0 0x0000624253c04edb (/home/ubuntu/mojo-gpu-puzzles/.pixi/envs/default/bin/mojo+0x7bfdedb)
 #1 0x0000624253c0273a (/home/ubuntu/mojo-gpu-puzzles/.pixi/envs/default/bin/mojo+0x7bfb73a)
 #2 0x0000624253c05a87 (/home/ubuntu/mojo-gpu-puzzles/.pixi/envs/default/bin/mojo+0x7bfea87)
 #3 0x000074295fc42520 (/usr/lib/x86_64-linux-gnu/libc.so.6+0x42520)
 #4 0x0000742963e68d99 (/home/ubuntu/mojo-gpu-puzzles/.pixi/envs/default/compute-sanitizer/libTreeLauncherTargetInjection.so+0x68d99)
 #5 0x0000742964cc78c5 (/home/ubuntu/mojo-gpu-puzzles/.pixi/envs/default/compute-sanitizer/libInterceptorInjectionTarget.so+0x1b8c5)
 #6 0x0000624250f11e2b (/home/ubuntu/mojo-gpu-puzzles/.pixi/envs/default/bin/mojo+0x4f0ae2b)
 #7 0x0000624250f0d55d (/home/ubuntu/mojo-gpu-puzzles/.pixi/envs/default/bin/mojo+0x4f0655d)
 #8 0x0000624250ef9565 (/home/ubuntu/mojo-gpu-puzzles/.pixi/envs/default/bin/mojo+0x4ef2565)
 #9 0x000062424fad5968 (/home/ubuntu/mojo-gpu-puzzles/.pixi/envs/default/bin/mojo+0x3ace968)
#10 0x000062424fad2c29 (/home/ubuntu/mojo-gpu-puzzles/.pixi/envs/default/bin/mojo+0x3acbc29)
#11 0x000062424fad5073 (/home/ubuntu/mojo-gpu-puzzles/.pixi/envs/default/bin/mojo+0x3ace073)
#12 0x000074295fc29d90 (/usr/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#13 0x000074295fc29e40 __libc_start_main (/usr/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#14 0x000062424faa9ba5 (/home/ubuntu/mojo-gpu-puzzles/.pixi/envs/default/bin/mojo+0x3aa2ba5)
[106585:106585:20260210,170812.586839:WARNING spawn_subprocess.cc:251] intermediate process terminated by signal 11 (Segmentation fault) (core dumped)
out shape: 2 x 2
Running memory bug example (bounds checking issue)...
out: HostBuffer([10.0, 11.0, 12.0, 13.0])
expected: HostBuffer([10.0, 11.0, 12.0, 13.0])
✅ Memory test PASSED! (memcheck may find bounds violations)
========= ERROR SUMMARY: 0 errors

Additional Context

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions