<!DOCTYPE html><html><head>
<style type="text/css">body { font-family:'Times New Roman'; font-size:13px}</style>
</head>
<body><div>FWIW, my reply with an attached image is waiting for approval.</div><div><br></div><div><br></div><blockquote style="margin: 0 0 0.80ex; border-left: #0000FF 2px solid; padding-left: 1ex"><div dir="ltr">I haven't done serious Windows coding since the NT days, but I found this. Sounds like this will do it and then you can load the dump in visual studio and get the stack track, yes?<div><br></div><div>Anyone who actually uses windows + visualstudio want to comment?</div><div><br></div><div>-kurt<br><div><br></div><div><a href="http://cwspencer.co.uk/blog/2012/10/getting-useful-c-exception-information-from-visual-studio/">http://cwspencer.co.uk/blog/2012/10/getting-useful-c-exception-information-from-visual-studio/</a><br></div><div><br></div><div>Which down at the bottom says:</div><div><br></div><div><span style="color:rgb(51,51,51);font-family:georgia,"bitstream charter",serif;font-size:16px">You can get </span><a href="http://msdn.microsoft.com/en-us/library/windows/desktop/bb787181(v=vs.85).aspx" style="background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial;border:0px;margin:0px;padding:0px;vertical-align:baseline;color:rgb(116,51,153);font-family:georgia,"bitstream charter",serif;font-size:16px">WER to generate full crash dumps</a><span style="color:rgb(51,51,51);font-family:georgia,"bitstream charter",serif;font-size:16px"> when your program crashes and you don’t have a debugger attached by creating the </span><code style="background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial;border:0px;margin:0px;padding:0px;vertical-align:baseline;font-family:monaco,consolas,"andale mono","dejavu sans mono",monospace;font-size:13px;color:rgb(51,51,51)">DWORD</code><span style="color:rgb(51,51,51);font-family:georgia,"bitstream charter",serif;font-size:16px"> registry key</span><code style="background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial;border:0px;margin:0px;padding:0px;vertical-align:baseline;font-family:monaco,consolas,"andale mono","dejavu sans mono",monospace;font-size:13px;color:rgb(51,51,51)">HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps\DumpType</code><span style="color:rgb(51,51,51);font-family:georgia,"bitstream charter",serif;font-size:16px"> and setting it to 1 (for mini dumps) or 2 (for full dumps). This will create a dump file in </span><code style="background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial;border:0px;margin:0px;padding:0px;vertical-align:baseline;font-family:monaco,consolas,"andale mono","dejavu sans mono",monospace;font-size:13px;color:rgb(51,51,51)">%LOCALAPPDATA%\CrashDumps</code><span style="color:rgb(51,51,51);font-family:georgia,"bitstream charter",serif;font-size:16px"> when your program crashes which you can import into Visual Studio. This is particularly useful when you are testing on someone else’s machine where you can’t debug directly.</span><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Sep 14, 2016 at 2:02 PM, Joaquim Luis <span dir="ltr"><<a href="mailto:jluis@ualg.pt" target="_blank">jluis@ualg.pt</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><div>Yes, but (that I know) we don't get long stack traces in VS.</div><div><br></div><div>Exception thrown at 0x00007FFF88F87788 in osmcoastline.exe: Microsoft C++ exception: gdalcpp::gdal_error at memory location 0x000000CD6E33E090.<br>Unhandled exception at 0x00007FFF88F87788 in osmcoastline.exe: Microsoft C++ exception: gdalcpp::gdal_error at memory location 0x000000CD6E33E090.</div><div>
The program '[37264] osmcoastline.exe' has exited with code 0 (0x0).
</div><div><br></div><div><br></div><div>I can see why it crashes but why it happens. To start with the code is completely mysterious for me</div><div><br></div><div> class Driver : private init_library {<br><br>gdal_driver_type* m_driver;<br><br></div><div> public:<br><br> Driver(const std::string& driver_name) :<br> init_library(),<br>#if GDAL_VERSION_MAJOR >= 2<br> m_driver(GetGDALDriverManager()->GetDriverByName(driver_name.c_str())) {<br>#else<br> m_driver(OGRSFDriverRegistrar::GetRegistrar()->GetDriverByName(driver_name.c_str())) {<br>#endif<br> if (!m_driver) {<br> throw gdal_error(std::string("unknown driver: '") + driver_name + "'", OGRERR_NONE, driver_name);<br> }<br> }<br></div><div><br></div><div>m_driver is defined as a function, which is than tested to be NULL (and it is) and a crash follows.<br></div><div><div class="h5"><div><br></div><div><br></div><blockquote style="margin:0 0 0.80ex;border-left:#0000ff 2px solid;padding-left:1ex"><div dir="ltr">A stack trace would give others a chance to possibly spot what the crash is.</div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Sep 14, 2016 at 11:31 AM, Joaquim Luis <span dir="ltr"><<a href="mailto:jluis@ualg.pt" target="_blank">jluis@ualg.pt</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">OK, clean & rebuilt (as I (thought) did before) and I can see the SQLite driver now.<br>
However, the osmcoastline still crashes. Unfortunately, it's too damn C++ for me to debugg.<div><div><br>
<br>
<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Le mercredi 14 septembre 2016 19:43:22, Joaquim Luis a écrit :<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Sorry, my bad. When I thought I was using gisinternals I was actually<br>
using my build. Gisinternals does show the SQLite driver.<br>
<br>
But one of my points still holds. If the Walker shows me that sqlite3.dll<br>
is a dependency than why the SQLite driver is not available?<br>
</blockquote>
<br>
You mentionned that you "(re)build" GDAL with sqlite, so I assume you added it<br>
after a first build. So I suspect that some files didn't get recompiled. The<br>
safest way if not already done is to clean and rebuild.<br>
<br>
Otherwise, mostly for a quick check, you may just 'touch'<br>
ogr/ogrsf_frmts/generic/ogrregisterall.cpp but you'll probably miss a few files<br>
that will benefit from sqlite being now available. So the clean & rebuild path<br>
is the safest ultimately.<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
> Hmm, several (weird) things.<br>
><br>
> 1. I'm using GnuWin ports for unix commands. And:<br>
> - this works<br>
><br>
> gdalinfo --formats | sort<br>
><br>
> - this not (output is empty)<br>
><br>
> ogfinfo --formats | sort<br>
><br>
> Same thing for 'grep'<br>
><br>
> 2. To check I'm using gisinternals and same thing as my build.<br>
><br>
> ogrinfo --formats shows no SQLite driver<br>
><br>
> 3. The program I'm trying to build/run crashes at this line<br>
><br>
> <a href="https://github.com/osmcode/osmcoastline/blob/master/include/gdalcpp.hp" rel="noreferrer" target="_blank">https://github.com/osmcode/osmcoastline/blob/master/include/gdalcpp.hp</a><br>
> p#L132 (no idea why it crashes) apparently because it doesn't find the<br>
><br>
> SQLite driver (driver_name == 'SQLite')<br>
><br>
>> ogrinfo --formats | grep -i lite<br>
>><br>
>> SQLite -vector- (rw+v): SQLite / Spatialite<br>
>><br>
>> On Wed, Sep 14, 2016 at 9:32 AM, Joaquim Luis <<a href="mailto:jluis@ualg.pt" target="_blank">jluis@ualg.pt</a>> wrote:<br>
>>> Sorry Even that you are bombed with so many questions.<br>
>>><br>
>>> I have (re)build GDAL with sqlite and can confirm with The<br>
>>> (Dependency) Walker that the sqlite3.dll is a gdal.dll dependency.<br>
>>> However,<br>
>>><br>
>>> gdalinfo --formats<br>
>>><br>
>>> ...<br>
>>><br>
>>> Rasterlite -raster- (rws): Rasterlite<br>
>>> SAFE -raster- (rov): Sentinel-1 SAR SAFE Product<br>
>>> SAR_CEOS -raster- (rov): CEOS SAR Image<br>
>>> SDTS -raster- (rov): SDTS Raster<br>
>>> SENTINEL2 -raster- (rovs): Sentinel 2<br>
>>> SGI -raster- (rw+): SGI Image File Format 1.0<br>
>>> SRTMHGT -raster- (rwv): SRTMHGT File Format<br>
>>> TIL -raster- (rov): EarthWatch .TIL<br>
>>><br>
>>> ...<br>
>>><br>
>>> does not show the SQLite driver and indeed a program that I'm building<br>
>>> that needs to link with GDAL (osmcoastline) crashes when it doesn't<br>
>>> find >>>that driver.<br>
>>><br>
>>> ?<br>
>>><br>
>>> Joaquim<br>
>>> _______________________________________________<br>
>>> gdal-dev mailing list<br>
>>> <a href="mailto:gdal-dev@lists.osgeo.org" target="_blank">gdal-dev@lists.osgeo.org</a><br>
>>> <a href="http://lists.osgeo.org/mailman/listinfo/gdal-dev" rel="noreferrer" target="_blank">http://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br>
>><br>
>> ----<br>
>> <a href="http://schwehr.org" rel="noreferrer" target="_blank">http://schwehr.org</a><br>
</blockquote></blockquote>
_______________________________________________<br>
gdal-dev mailing list<br>
<a href="mailto:gdal-dev@lists.osgeo.org" target="_blank">gdal-dev@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/gdal-dev" rel="noreferrer" target="_blank">http://lists.osgeo.org/mailman/listinfo/gdal-dev</a></div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div data-smartmail="gmail_signature">--<div><a href="http://schwehr.org" target="_blank">http://schwehr.org</a></div></div>
</div>
</blockquote><br><br><br></div></div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">--<div><a href="http://schwehr.org" target="_blank">http://schwehr.org</a></div></div>
</div>
</blockquote><br><br><br></body></html>