title: Error "Segmentation fault (core dumped)" when import module built from pybind11
body: <p>i met issue with python3 while import module built from pybind11
  "pcap.h" imported for libpcap in Linux</p>
  
  <pre><code># test.cpp
  
  #include "pybind11/pybind11.h"
  #include "pybind11/stl.h"
  #include "pcap.h"
  
  void open_pcap(std::string &amp;filename)
  {
      char errbuf[PCAP_ERRBUF_SIZE];
      char *file_name = const_cast&lt;char *&gt;(filename.c_str());
  
      // "segmentation fault" if i add bellow line
      pcap_t *pcapfd = pcap_open_offline(file_name, errbuf);
  }
  
  namespace py = pybind11;
  PYBIND11_MODULE(test, m)
  {
      m.def("open_pcap", &amp;open_pcap);
  }
  </code></pre>
  
  <p>Compile successed with </p>
  
  <pre><code>c++ -O3 -Wall -shared -std=c++11 -fPIC `python3 -m pybind11 --includes` test.cpp -o test`python3-config --extension-suffix`
  </code></pre>
  
  <p>but when i import from python3, i met error</p>
  
  <pre><code>Python 3.6.9 (default, Nov  7 2019, 10:44:02) 
  [GCC 8.3.0] on linux
  Type "help", "copyright", "credits" or "license" for more information.
  &gt;&gt;&gt; import test
  Segmentation fault (core dumped)
  </code></pre>
  
  <p>only view info for error with python3 -v -c "import test"</p>
  
  <pre><code>...
  # /usr/lib/python3/dist-packages/apt/progress/__pycache__/text.cpython-36.pyc matches /usr/lib/python3/dist-packages/apt/progress/text.py
  # code object from '/usr/lib/python3/dist-packages/apt/progress/__pycache__/text.cpython-36.pyc'
  # /usr/lib/python3/dist-packages/apt/progress/__pycache__/base.cpython-36.pyc matches /usr/lib/python3/dist-packages/apt/progress/base.py
  # code object from '/usr/lib/python3/dist-packages/apt/progress/__pycache__/base.cpython-36.pyc'
  import 'fcntl' # &lt;class '_frozen_importlib.BuiltinImporter'&gt;
  import 'apt.progress.base' # &lt;_frozen_importlib_external.SourceFileLoader object at 0x7f583e1da7b8&gt;
  import 'apt.progress.text' # &lt;_frozen_importlib_external.SourceFileLoader object at 0x7f583e20b2b0&gt;
  import 'apt.package' # &lt;_frozen_importlib_external.SourceFileLoader object at 0x7f583fdad160&gt;
  # /usr/lib/python3/dist-packages/apt/__pycache__/cache.cpython-36.pyc matches /usr/lib/python3/dist-packages/apt/cache.py
  # code object from '/usr/lib/python3/dist-packages/apt/__pycache__/cache.cpython-36.pyc'
  import 'apt.cache' # &lt;_frozen_importlib_external.SourceFileLoader object at 0x7f583fdbd2b0&gt;
  # /usr/lib/python3/dist-packages/apt/__pycache__/cdrom.cpython-36.pyc matches /usr/lib/python3/dist-packages/apt/cdrom.py
  # code object from '/usr/lib/python3/dist-packages/apt/__pycache__/cdrom.cpython-36.pyc'
  import 'apt.cdrom' # &lt;_frozen_importlib_external.SourceFileLoader object at 0x7f583e1f30b8&gt;
  Segmentation fault (core dumped)
  </code></pre>