|
List Info
Thread: QCA unhandled exception at termination in windows
|
|
| QCA unhandled exception at termination
in windows |
  Switzerland |
2008-03-03 02:08:28 |
|
Hi,
I have successfully installed qca-2.2.0 exactly
after the INSTALL instructions in this environment:
MS Windows XP home SP2
Visual Studio 2005 SP1
Qt 4.3.4 Commercial
Qt Visual Studio Integration 1.3.3
Installation/compiling the libs went smooth without any
hickups.
Compiling and testing the example md5crypt, everything works
perfectly up to the point where where the program terminates, e.g. destroys the
stack allocated objects.
I get this message:
Unhandled exception at 0x1002d94d(qcad2.dll) in
QCATest.exe:
0xC0000005: Access violation reading location 0xfeeefef2
Here is the call stack:
qcad2.dll!QCA::Botan::MemoryRegion<unsigned
char>::deallocate(unsigned char * p=0x009700e8, unsigned int n=7) Line
114 + 0x1d bytes C++
qcad2.dll!QCA::Botan::MemoryRegion<unsigned
char>::~MemoryRegion<unsigned char>() Line 98 + 0x1c bytes C++
qcad2.dll!QCA::Botan::SecureVector<unsigned
char>::~SecureVector<unsigned char>() + 0xf bytes C++
qcad2.dll!QCA::Botan::SecureVector<unsigned
char>::`scalar deleting destructor'() + 0xf bytes C++
qcad2.dll!QCA::ai_delete(QCA::alloc_info *
ai=0x003de9f4) Line 377 + 0x1f bytes C++
qcad2.dll!QCA::MemoryRegion::Private::~Private() Line
411 + 0xc bytes C++
qcad2.dll!QCA::MemoryRegion::Private::`scalar deleting
destructor'() + 0xf bytes C++
qcad2.dll!QSharedDataPointer<QCA::MemoryRegion::Private>::~QSharedDataPointer<QCA::MemoryRegion::Private>()
Line 65 + 0x40 bytes C++
qcad2.dll!QCA::MemoryRegion::~MemoryRegion() Line 455
+ 0xb bytes C++
qcad2.dll!QCA::SecureArray::~SecureArray() Line 636 +
0x8 bytes C++
QCATest.exe!main(int argc=3, char * * argv=0x003d3c10)
Line 216 + 0x21 bytes C++
QCATest.exe!__tmainCRTStartup() Line 597 + 0x19 bytes C
QCATest.exe!mainCRTStartup() Line 414 C
kernel32.dll!7c816fd7()
[Frames below may be incorrect and/or missing, no symbols
loaded for kernel32.dll]
Is this a known issue?
Cheers, Acenes
|
| Re: QCA unhandled exception at
termination in windows |

|
2008-03-03 11:12:08 |
On Monday 03 March 2008 12:08 am, Acenes wrote:
> qcad2.dll!QCA::Botan::MemoryRegion<unsigned
char>::deallocate(unsigned char
> * p=0x009700e8, unsigned int n=7) Line 114 + 0x1d
bytes C++
>
> qcad2.dll!QCA::Botan::MemoryRegion<unsigned
char>::~MemoryRegion<unsigned
> char>() Line 98 + 0x1c bytes C++
>
> qcad2.dll!QCA::Botan::SecureVector<unsigned
char>::~SecureVector<unsigned
> char>() + 0xf bytes C++
>
> qcad2.dll!QCA::Botan::SecureVector<unsigned
char>::`scalar deleting
> destructor'() + 0xf bytes C++
>
> qcad2.dll!QCA::ai_delete(QCA::alloc_info *
ai=0x003de9f4) Line 377 + 0x1f
> bytes C++
>
> qcad2.dll!QCA::MemoryRegion::Private::~Private() Line
411 + 0xc bytes
> C++
>
> qcad2.dll!QCA::MemoryRegion::Private::`scalar deleting
destructor'() + 0xf
> bytes C++
>
>
qcad2.dll!QSharedDataPointer<QCA::MemoryRegion::Private&g
t;::~QSharedDataPoint
>e r<QCA::MemoryRegion::Private>() Line 65 + 0x40
bytes C++
>
> qcad2.dll!QCA::MemoryRegion::~MemoryRegion() Line 455
+ 0xb bytes
> C++
>
> qcad2.dll!QCA::SecureArray::~SecureArray() Line 636 +
0x8 bytes
> C++
>
> QCATest.exe!main(int argc=3, char * * argv=0x003d3c10)
Line 216 + 0x21
> bytes C++
>
> QCATest.exe!__tmainCRTStartup() Line 597 + 0x19 bytes
C
>
> QCATest.exe!mainCRTStartup() Line 414 C
>
> kernel32.dll!7c816fd7()
>
> [Frames below may be incorrect and/or missing, no
symbols loaded for
> kernel32.dll]
>
>
>
> Is this a known issue?
Hi,
This should not happen.
Can you share the source code to QCATest.exe ?
-Justin
_______________________________________________
Delta mailing list
Delta lists.affinix.com
http://lists.affinix.com/listinfo.cgi/delta-affinix.com
a>
|
|
| Re: QCA unhandled exception at
termination in windows |

|
2008-03-04 00:47:06 |
On Monday 03 March 2008 9:38 pm, Acenes wrote:
> > This should not happen.
> > Can you share the source code to QCATest.exe ?
> > -Justin
>
> The source code is completely in the tar archive of
qca-2.0.0:
>
> examples/md5crypt/md5crypt.cpp
Okay, I've figured it out. md5crypt.cpp is wrong. So much
for setting a good
example to follow.
Actually, this is a really obscure aspect of QCA to know
about. This code:
QCA::Initializer init;
QCA::SecureArray password, salt;
QCoreApplication app ( argc, argv );
should be written like this instead:
QCA::Initializer init;
QCoreApplication app ( argc, argv );
QCA::SecureArray password, salt;
QCA uses qAddPostRoutine() to deinitialize QCA. This means
that when
QCoreApplication destructs, QCA is deinitialized
(QCA::Initializer object
destruction then becomes a no-op). As you can see, the way
md5crypt.cpp is
written, those SecureArray will be deleted *after* QCA
deinitializes. Best
fix is to do nothing between Initializer and
QCoreApplication construction.
Sorry about that!
-Justin
_______________________________________________
Delta mailing list
Delta lists.affinix.com
http://lists.affinix.com/listinfo.cgi/delta-affinix.com
a>
|
|
| Re: QCA unhandled exception at
termination in windows |
  Switzerland |
2008-03-03 23:38:49 |
> This should not happen.
> Can you share the source code to QCATest.exe ?
> -Justin
The source code is completely in the tar archive of
qca-2.0.0:
examples/md5crypt/md5crypt.cpp
What I did exactly was:
- Create a new "Qt Console Application" project
named QCATest with the Qt
Visual Studio Integration.
- Copy/paste of the sample source code from md5crypt.cpp
into main.cpp of my
new project.
- Add the qca include path and the library name (debug
version: qcad2.lib)
to the project settings.
- Build the exe with otherwise default compiler and linker
settings.
Do you think the problem might be from some special compile
or link switches
that are required by qca?
Below is the build log where you can see what settings
exactly were used for
compiling and linking.
Acenes
BUILDLOG:
Creating temporary file "c:Visual Studio
2005ProjectsQCATestQCATestDebugRSP00000518682436.rsp&qu
ot; with contents
[
/Od /I ".GeneratedFilesDebug" /I
"C:Qtqca-2.0.0include" /I
"C:Qtqca-2.0.0includeQtCrypto" /I
"C:Qt4.3.4include" /I
"C:Qt4.3.4includeQtCore" /D
"UNICODE" /D "WIN32" /D
"QT_THREAD_SUPPORT"
/D "QT_CORE_LIB" /FD /EHsc /MDd /Zc:wchar_t-
/Fo"Debug\"
/Fd"Debugvc80.pdb" /c /Zi /TP
".main.cpp"
]
Creating command line "cl.exe "c:Visual Studio
2005ProjectsQCATestQCATestDebugRSP00000518682436.rsp&qu
ot; /nologo
/errorReport:prompt"
Creating temporary file "c:Visual Studio
2005ProjectsQCATestQCATestDebugRSP00000618682436.rsp&qu
ot; with contents
[
/OUT:"C:Visual Studio
2005ProjectsQCATestDebugQCATest.exe"
/LIBPATH:"C:Qt4.3.4lib" /MANIFEST
/MANIFESTFILE:"DebugQCATest.exe.intermediate.manifest&
quot; /DEBUG
/PDB:"c:Visual Studio
2005ProjectsQCATestdebugQCATest.pdb"
/SUBSYSTEM:CONSOLE qcad2.lib qtmaind.lib QtCored4.lib
kernel32.lib
user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib
shell32.lib
ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib
".Debugmain.obj"
]
Creating command line "link.exe "c:Visual Studio
2005ProjectsQCATestQCATestDebugRSP00000618682436.rsp&qu
ot; /NOLOGO
/ERRORREPORT:PROMPT"
Creating temporary file "c:Visual Studio
2005ProjectsQCATestQCATestDebugRSP00000718682436.rsp&qu
ot; with contents
[
/outputresource:"..debugQCATest.exe;#1"
/manifest
".DebugQCATest.exe.intermediate.manifest"
]
Creating command line "mt.exe "c:Visual Studio
2005ProjectsQCATestQCATestDebugRSP00000718682436.rsp&qu
ot; /nologo"
Creating temporary file "c:Visual Studio
2005ProjectsQCATestQCATestDebugBAT00000818682436.bat&qu
ot; with contents
[
echo
Manifest resource last updated at %TIME% on %DATE% >
".Debugmt.dep"
]
Creating command line """c:Visual Studio
2005ProjectsQCATestQCATestDebugBAT00000818682436.bat&qu
ot;""
_______________________________________________
Delta mailing list
Delta lists.affinix.com
http://lists.affinix.com/listinfo.cgi/delta-affinix.com
a>
|
|
| Re: QCA unhandled exception at
termination in windows |

|
2008-03-04 11:39:14 |
On Tuesday 04 March 2008 1:08 am, Acenes wrote:
> some examples also have QCoreApplication before
QCA::Initializer which
> seems also to work and looks more familiar to me.
Yes, this will also work. However, it is generally
recommended that
QCA::Initializer be the first thing you do in main(), for
high security on
unix. On Windows, I don't think the ordering matters
(yet?), but it is good
to be portable.
-Justin
_______________________________________________
Delta mailing list
Delta lists.affinix.com
http://lists.affinix.com/listinfo.cgi/delta-affinix.com
a>
|
|
[1-5]
|
|
|
about | contact Other archives ( Real Estate discussion Medical topics )
|