<p>The simplest way to debug this: run osm2pgsql inside gdb</p>

<pre><code> gdb -ex=r --args ./osm2pgsql  .......
</code></pre>

<p>press Ctrl-C when it hangs and then enter <code>bt</code> command. You'll get the call stack (maybe put it here) and see what function is doing wrong.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br>Reply to this email directly or <a href="https://github.com/openstreetmap/osm2pgsql/issues/500#issuecomment-156088537">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AD2-7nekvoY-5-bK7lJkfAvUMQsiedriks5pFHrmgaJpZM4Gg9yF.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/openstreetmap/osm2pgsql/issues/500#issuecomment-156088537"></link>
  <meta itemprop="name" content="View Issue"></meta>
</div>
<meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>