QT KernelBase!RaiseException at 0x759fc41f - c++

A comment more than a question:
The following describes an issue I had this evening and what I did to "correct" it. These events required a few hours of time to resolve. As this site is one of my favorite sources of information, thought this post might benefit someone else. Any constructive comments on diagnosing QT Creator run-time exceptions would be welcome. The exception seems to have been the result of corruption in the symbol file for QCored.
Exception (QtCreator debugger KernelBase Exception)
Exception at 0x759fc41f, code: 0x406d1388: Startup complete, flags-0x0 (first chance) in KernelBase!RaiseException
Windows: QtCreator 3.0:
Configuration Build: build-QMRC-Qt_5_2_0_msvc2010_opengl-Debug
Application Output Window displayed exception with a valid build.
Corrective Action:
Deleted Windows subdirectories:
c:\users\\appdata\local\temp\
Run qmake
rebuild debug mode

Related

Debug a Qt assert in Visual Studio

I am getting an assert that generates a dialog from Qt to abort, retry, or ignore. Unfortunately, when I retry, it always just goes to app.exec() so I cannot see where the error is coming from, or what inputs may be contributing.
When I debug, I can see all my code and moc code, and all variables and pointers are set appropriately. But when I step into Qt code, I get Qt5Cored.pdb not loaded. I cannot seem to locate the PDB files in my Qt installation either.
The error happens after emitting a signal and all (my) slots have completed successfully.
The error from Qt is so deep in the weeds, it is not helpful:
Debug Error!
Program: Qt5Cored.dll
Module: 5.14.2
File: painting\qoutlinemapper.cpp
Line: 105
ASSERT: '!path.isEmpty()' in file painting\qoutlinemapper.cpp, line 105
(Press Retry to debug the process)
I inspected the source code for the error, but that wasn't terribly helpful, and the debugger will not provide the caller.
I don't know what is the problem since I can't debug, so I can't provide a minimal working example either. All of my code is working as expected, but I am sure I am providing Qt with something inappropriate, but I just do not know what. Any help on how to better debug this issue so I can determine what is causing it would be appreciated.
Interestingly, if I run in release and the assert is bypassed, the applications works exactly as expected with no obvious side effects (I do realize that could just be luck).

Qt Creator and MSVC - Ignoring specific exception types on debugging?

I'm currently using Qt Creator 4.4.1 with Qt 5.9.2 and the MSVC 2015 32/64 Bit compilers to create a DLL on Windows 7.
In Qt Creator under
Projects -> Build & Run -> Desktop Qt 5.9.2 MSVC2015 xxbit -> Run -> Executable
I've specified the host application, that loads my DLL, so when I hit F5 this app gets executed and loads my DLL without a flaw.
However, on loading, the main app raises an exception which I have no hands-on, making Qt Creator showing up a message box with the following content:
The inferior stopped because it triggered an exception.
Stopped in thread 0 by: Exception at 0x60251637, code 0xc0000005: write access violation at: 0x1, flags=0x0 (first chance).
I now have to close the message box and hit F5 again to proceed.
Because I have to do this for every test run, again and again, it becomes really annoying. So, is there a simplest way to tell CDB from Qt Creator to ignore only that specific type of exception?
Look at the call stack, find the relevant code and see what it does. You should find a try ... catch ... around that line. See whether you can avoid the exception in some way, typically by introducing an if ... else ....
If you cannot avoid it, and you made sure it's really safe to ignore it, start CDB with command line argument -c "sxn c0000005" or the equivalent -c "sxn av", where AV is short for "access violation". You can use sx to see all exception settings.
I encountered the same problem, the problem may be caused by the variable is not initialized, for example:
QLable *lable;
If you forget to allocate memory for this variable, it will cause this error.
lable = new QLable(this);
I think you should check your variables.

SFML 2.2 Unhandled exception at 0x00007FFA622C21F9(sfml-system-2.dll)

I'm trying to build a game in sfml under windows 10.It shows successful at the time of building.whenever i debug the solution it shows the error message like:
Unhandled exception at 0x00007FFA622C21F9 (sfml-system-2.dll) in picpuz2.exe: 0xC0000005: Access violation reading location 0x0000000000000019.
Under call stack the program stopped at the code:
window.create(sf::VideoMode(300, 300, 32), "PICPUZ");
This is my code:
Please follow the tutorials closely. If you are doing a debug build, you should link with the dlls that end in -d for debug.
For example sfml-system-d-2.dll
Linking release and/or debug to the wrong configuration (release to debug or debug to release) will result in unpredictable crashes.

C++ Application crash where to start looking? MSVCR90.dll

This is a very open ended question and I am really just looking for how to approach locating the issue.
The application runs for a day or so and then will crash while being used. The point in the application that it crashes is not the same each time. The memory that the application is using is not increasing.
C++ is not my standard dev language so any pointers would be appreciated.
The run time error I am given is detailed below. Having googled this I can see that 40000015 is a generic I don't know what has happened style error. Is there anyway I can use the additional information (1-4) to assist in locating the issue?
Any help is much appreciated!
Thanks
Problem signature:
Problem Event Name: APPCRASH
Application Name: Main.exe
Application Version: 1.1.10.0
Application Timestamp: 5278d640
Fault Module Name: MSVCR90.dll
Fault Module Version: 9.0.30729.4940
Fault Module Timestamp: 4ca2ef57
Exception Code: 40000015
Exception Offset: 0005beae
OS Version: 6.1.7601.2.1.0.256.48
Locale ID: 2057
Additional Information 1: 3793
Additional Information 2: 379382cf89267e4a4b730ab2a7cc6828
Additional Information 3: f05b
Additional Information 4: f05b042c097ccdb870355bd0f539be8d
Read our privacy statement online:
http://go.microsoft.com/fwlink/?linkid=104288&clcid=0x0409
If the online privacy statement is not available, please read our privacy statement offline:
C:\Windows\system32\en-US\erofflps.txt
I would start by running it under debugger and leave it running for a day. Remember to enable all exceptions to catch - in my VS 2005 its in Debug->Exceptions, add handler for 40000015 exception.
If you cannot run it under debugger, ie. it happens only on client PC (still you can use remote debugging), then you can implement exception hanlder using : AddVectoredExceptionHandler, then use StackWalk64 to log call stack. If you can compile with symbols, then such stack will contain full path to the source of exception. It will be inside MSVCR90.dll, but will originate probably somewhere in your code. If you cannot include symbols then you can always use .map files or windbg with locally stored .pdb files. Of course this is a lot of work especially if C++ is not your main language, so the first suggestion is the best for you.
Ok, you can also use MiniDumpWriteDump and then use windbg instead of StackWalk64.

Is there a simpler Windows C++ Subversion API or an example .vcproj for minimal_client.c?

Following on the tails of my previous (answered) question...
SharpSvn makes calling the Subversion client API simple:
SvnClient client = new SvnClient();
client.Authentication.DefaultCredentials = new NetworkCredential(username, password);
client.CheckOut(new Uri("http://xxx.yyy.zzz.aaa/svn/repository"), workingCopyDir);
On the other hand, calling the client API from C/C++, as shown in minimal_client.c requires coding "closer to the metal", as it were, on Subversion.
Are there Windows libraries for C++ in Visual Studio 2003 that present a simpler interface than what minimal_client uses?
If there are not, is there a VS2003 C++ project (a .vcproj file) that demonstrates getting minimal_client to run? I'm able to compile minimal_client.c and link it using the following libraries:
libsvn_client-1.lib libsvn_delta-1.lib libsvn_diff-1.lib libsvn_fs-1.lib libsvn_fs_base-1.lib libsvn_fs_fs-1.lib libsvn_ra-1.lib libsvn_ra_local-1.lib libsvn_ra_svn-1.lib libsvn_repos-1.lib libsvn_subr-1.lib libsvn_wc-1.lib libapr-1.lib libaprutil-1.lib xml.lib libneon.lib
but when I run my application (in the debugger or start the release build without debugging), it runs for about 20 seconds without hitting the first line of main() and then throws this exception:
An unhandled exception of type
'System.TypeLoadException' occurred in
Unknown Module.
Additional information: Could not load
type apr_pool_t from assembly
minimal_client,
Version=1.0.3477.16033,
Culture=neutral, PublicKeyToken=null.
I've tried various combination of libsvn_.lib and svn_.lib to no avail.
Any thoughts on what I'm doing wrong?
EDIT: I started fresh with a "Win32 Console Project" (still in VS2003) and I am now able to debug the first few lines of my app. But now, on this line:
if (svn_cmdline_init ("minimal_client", stderr) != EXIT_SUCCESS)
I get a different exception (in the debugger or start the release build without debugging):
Unhandled exception at 0x7c91b21a in
Win32ConsoleProject_minimal_client.exe:
0xC0000005: Access violation writing
location 0x00000010.
EDIT: This thread explains that this error is a CRT mismatch between svn and stderr in my app. If I don't want to build Svn so they match (I don't want to), I can pass NULL instead of stderr (provided I'm willing to do without messages that would go to stderr) When I did this, my app ran all the way through correctly.
It seems that C++ wrappers are not overflowing the 'net. However, you may want to try SVNCPP, which can be yoinked from RapidSVN.
See http://rapidsvn.tigris.org/ for details (note: I've not tried it).
Can you upgrade to Visual C++ 2005 ? If so, you could just go using SharpSvn with C++/CLI.
Or even maybe stick to VC2003 and go SharpSvn with Managed C++ ? (not that I have any knowledge on the how od even the if)
edit: oh well, SharpSvn's homepage explicitely states that VC++ 2005 SP1 is required...