0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

AddressSanitizer:DEADLYSIGNAL

Posted at

競技プログラミングをするのに,WSL の Ubuntu 22.04 LTS で,g++ 13.1 を使用しています.メモリ関係のバグを報告してもらうために,次のオプションを付けてコンパイルしています.

-fsanitize=address,undefined -fno-sanitize-recover -fno-omit-frame-pointer

最近,このように作成した a.out が,数回に一回くらい,ランダムにエラーを起こすようになりました.以下のエラーメッセージをはき出す無限ループに陥ります.

AddressSanitizer:DEADLYSIGNAL

検索をしてバグ報告を見つけ,そこに書かれていた,次の workaround を実施したところ,エラーは発生しなくなりました.

sudo sysctl vm.mmap_rnd_bits=28

ChatGPTに教えてもらって/etc/sysctl.d/99-asan.conf というファイルを作り,vm.mmap_rnd_bits=28 を記述して,起動時から有効にするようにしました.一応エラーなく動いているようです.

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?