Re: Issue using encryption in Debug/Release mode ??

From: Brian Gladman (fake_at_nowhere.org)
Date: 10/01/03


Date: Wed, 1 Oct 2003 10:02:47 +0100

katiki@kodak.com wrote:

> Actually, my library using AES (named KEM.dll) works fine on our
> machines.
>
> But, on our dev machines, KEM.dll is in Debug mode...that's normal.
> Therefore, we have encrypted files with the DEBUG version of KEM.dll
>
> Therefore, when testing those encrypted files on our release machine
> (using the release version of KEM.dll )
> I didn't retrieve the original plaintext file.
>
> Is this is a known issue ?
> Have you already heard about this kind of issue ?

I have seen situations in which the Microsoft optimiser, which is not
invoked in debug mode, introduces code errors. Hence one thing to try is to
see if compiling in release mode with optimisation turned off gives the same
answers as debug mode. If it does you can then look for where the problem
lies by using pragmas to turn optimisation on and off for parts of your
code. I had to turn optimisation off with one version of Microsoft C
although this was a long time ago and all of the current compiler versions
are ok as far as I am aware.

Another subtle issue is that it is very easy to set different compiler
switches in debug and release mode without realising it and this can result
in incompatible versions. For example, if the compiler is set to compile in
C in debug mode and C++ in release mode the two versions will each work with
themselves but will not necessarily work with each other unless the code has
been designed with this in mind. Although this particular problem should be
picked up at link time, similar problems can cause run time errors.

   Brian Gladman



Relevant Pages

  • Re: Execution time debug vs. release
    ... debugging features that have been added in VS2005 C++ compiler. ... but when compiled in debug mode takes almost 40 seconds with 100% CPU ... speed with Task Manager showing 0% CPU time. ...
    (microsoft.public.vc.mfc)
  • Re: How do i debug in Release mode
    ... You can turn debugging on or ... down compiler bugs or subtleties that don't appear when in Debug mode. ...
    (comp.lang.cpp)
  • Re: Debug library crashes when linked with Release build
    ... In debug mode the classes ... compiled the classes memory footprint is smaller thanm in debug mode ... compiler or library implementation. ...
    (microsoft.public.dotnet.languages.vc)
  • Re: .PDB contains less information in RELEASE than in DEBUG?!
    ... only that asserts would be thrown out in debug and some other things. ... > been internally optimized by the compiler and things such as a "line of ... >> project in debug mode and regenerate the error. ... >> how can I force release PDB to behave like debug PDB? ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: debugging in release mode
    ... I have no doubt that it's a problem of mine and not of the compiler. ... I don't really need optimization ... for the sake of memory space or execution speed. ... shows the differences between the default debug mode and the default release ...
    (microsoft.public.vc.mfc)