[gdal-dev] Building with SEH

Tamas Szekeres szekerest at gmail.com
Wed Mar 12 12:27:08 EDT 2008


I'm a bit hesitant to think that the SEH and the C++ exception
handling may work together properly eg. when crossing the boundaries
of the GDAL C API. I consider the exceptions should be caught in the
same environment where it have been thrown, definitely. For example if
you catch a C++ exception raised by a C++ function exported by a dll
using the __try/__except SEH mechanism, the C++ exception won't
properly be unwinded by the C++ exception handler because the SEH
handler won't propagate the exception code correctly to the C++
handler.

BTW we are using the /EHsc option for msvc by default. This tells the
compiler to assume that extern C functions never throw a C++ exception

Best regards,

Tamas



2008/3/12, Frank Warmerdam <warmerdam at pobox.com>:
> Chris Howell wrote:
>  > Hi Martin,
>  >
>  > Thanks for your suggestion. You raise an a good point and I suspect that
>  > it is indeed a null pointer. However my issue is with an application
>  > built on top of GDAL if this is an issue now. I can fix this one off
>  > issue in the OGR commit my changes back and all is well. However the
>  > users of my company's application aren't going to understand that the
>  > file is corrupted and the file driving engine, developed by a third
>  > party, they're going to see a crash as something wrong with software.
>  > They may or may not comment on every file they can't open or every crash
>  > that happens. My experience is they will not. Fixing this one issue is
>  > good and I am all to happy to do it. However in general it's not as
>  > robust of an error handling scheme as we need to have in our
>  > application. Therefore I still think it's better to make use of
>  > Structured Exception Handling. Which allows us my company the most
>  > robust error handling scheme that we can provide and saves our face when
>  > our users are using the software.
>
>
> Chris,
>
>  It is clearly desirable to offer robust error recovery for GDAL.  But I'm
>  not at all clear on the terms you are using.  Is SEH just normal C++
>  exceptions?  Does this term mean something special?  Is this some special
>  way of handling things that would normally trigger crashes, like accessing
>  through a NULL pointer?
>
>  Best regards,
>
> --
>  ---------------------------------------+--------------------------------------
>  I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
>  light and sound - activate the windows | http://pobox.com/~warmerdam
>  and watch the world go round - Rush    | President OSGeo, http://osgeo.org
>
>
>  _______________________________________________
>  gdal-dev mailing list
>  gdal-dev at lists.osgeo.org
>  http://lists.osgeo.org/mailman/listinfo/gdal-dev
>


More information about the gdal-dev mailing list