[Botan-devel] Catching 'Botan::Decoding_Error'

Jack Lloyd lloyd at randombit.net
Wed Nov 3 15:52:35 EDT 2010


Ah, OK. I don't think the different runtimes would be a problem, then,
as far as I know this only affects VC++ (or perhaps also Intel C++ on
Windows, I'm not sure about that).

I assume you built libbotan.a also with MinGW? Which GCC version are
you using? I've seen a couple of blog posts suggesting using
-fexceptions, which I would have thought was the default already, but
perhaps not with MinGW?

On Wed, Nov 03, 2010 at 08:19:50PM +0100, Gregor Schrrrgle wrote:
> Dear Jack,
> 
> thanks for your super fast answer!
> 
> Here are a few more details to my problem:
> 
> - Yes, you are correct, I am running on Windows.
> - I tried catching the Botan::Decoding_Error exception explicitly already.
> It showed the same result: termination of the entire program.
> - I am using the MinGW GCC Compiler with a static Botan library (libbotan.a)
> built from the Botan-1.8.9 sources
> 
> I will try to check the runtime settings as you suggested (the settings used
> for the library and the one used in my executable).
> Could you give me a hint where I need to check these settings - are they
> applicable if I am not using Visual C++?
> 
> Thank you very much and best regards,
> Gregor
> 
> -----Ursprüngliche Nachricht-----
> Von: botan-devel-bounces at randombit.net
> [mailto:botan-devel-bounces at randombit.net] Im Auftrag von Jack Lloyd
> Gesendet: Mittwoch, 3. November 2010 19:52
> An: Botan development list
> Betreff: Re: [Botan-devel] Catching 'Botan::Decoding_Error'
> 
> On Wed, Nov 03, 2010 at 06:38:28PM +0100, Gregor Schrrrgle wrote:
> > 
> > and I am not able to catch the exception with a catch statement (e.g.
> catch
> > (std::exception& e) ).
> > 
> 
> Hi Gregor,
> 
> I find this quite strange; Decoding_Error is derived from
> std::exception, so a catch for a std::exception& should capture
> it. Can you try adding an explicit catch clause for Decoding_Error,
> just to see if it makes any different? I'm afraid nothing obvious is
> coming to mind; certainly this seems like it should work as-is.
> 
> I would assume from the error text that you are running on Windows.
> Which compiler are you using? Is this with a shared or static library?
> Are you sure that you used the exact same runtime setting as the
> library? (/MD is the default; it seems like any deviation among any
> libraries and the application will cause problems, though they
> _usually_ show up as link-time errors).
> 
> -Jack
> _______________________________________________
> botan-devel mailing list
> botan-devel at randombit.net
> http://lists.randombit.net/mailman/listinfo/botan-devel
> 
> _______________________________________________
> botan-devel mailing list
> botan-devel at randombit.net
> http://lists.randombit.net/mailman/listinfo/botan-devel



More information about the botan-devel mailing list