<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>pebble8888</author_name>
  <author_url>https://blog.hatena.ne.jp/pebble8888/</author_url>
  <blog_title>Pebble Coding</blog_title>
  <blog_url>https://pebble8888.hatenablog.com/</blog_url>
  <categories>
    <anon>iOS/macOS</anon>
  </categories>
  <description>xcode address sanitizerでヒープ破壊箇所を検出してみます。 - (void)viewDidLoad { [super viewDidLoad]; uint8_t* a = malloc(16); memset(a, 0, 17); } 普通に実行してみると、 どこで破壊されているのか分かりませんね。 これをソースの行レベルで検出するには、address sanitizer を使います。 以下の画面の、「Address Sanitizer」と「Detect use of stack after return」にチェックをつけておきます。 破壊箇所がソースの行が出てきました。</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fpebble8888.hatenablog.com%2Fentry%2F2018%2F12%2F20%2F202648&quot; title=&quot;xcode address sanitizerでヒープ破壊箇所を検出する - Pebble Coding&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url>https://cdn-ak.f.st-hatena.com/images/fotolife/p/pebble8888/20181220/20181220201839.png</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2018-12-20 20:26:48</published>
  <title>xcode address sanitizerでヒープ破壊箇所を検出する</title>
  <type>rich</type>
  <url>https://pebble8888.hatenablog.com/entry/2018/12/20/202648</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
