Qt Application throws an Access violation exception during startup - qt

I have a Qt Application that works in Debug mode without any problems. Since two days I'm trying to make it work in Release mode. After some Project property modification I managed to compile without errors. But unfortunalty the application crashes before even reaching the main method.
That's my environment:
MS VS 2010
Qt 4.8.4
Qwt 6.0.0
I don't know if this is relevant, but I also installed the Qt plugin for VS and used Qt Designer to create my GUI.
As I said in Debug mode there is no problem. Starting the release version from the Visual Studio produces the following error:
Unhandled exception at 0x77c415de in Application.exe: 0xC0000005: Access violation reading location 0x0000000c.
The last function I can "debug" is the the "WinMain" method called inside the method "__declspec(noinline) int __tmainCRTStartup", which is located in crtexe.c (honestly I have no idea what this is). The call stack looks like this:
ntdll.dll!77c415de()
[Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll]
ntdll.dll!77c415de()
ntdll.dll!77c3014e()
msvcr100.dll!718f0269()
msvcr100.dll!718f233b()
msvcr100.dll!718f233b()
msvcr100.dll!718f233b()
QtCore4.dll!5b2cfc49()
QtGui4.dll!57bf54ea()
Application.exe!__tmainCRTStartup() Line 547 + 0x1c bytes C
kernel32.dll!754633aa()
ntdll.dll!77c59ef2()
ntdll.dll!77c59ec5()
In the moment I'm totaly lost with this problem. No idea what to try further...
I've tried to reduce the program and commented out the complete main function. But the result was the same behaviour. As I said the error occurs even before the main function is called. I also turned off all optimization and recompiled... didn't changed anything.
What completly puzzles me, is the fact that it "works" when I call "Application.exe" from the command prompt (ok it also crashes but much later during execution). Weird, isn't it? What is the difference between starting from command prompt and starting from Visual Studio application?

AnatolyS and npiau thanks for you tips. Meanwhile I continued digging in my code. More or less I started from the very beginning and finally got the place the error occurs. I suppose npiau is right, it has nothing to do with Qt.
It's still (for me) a strange problem. I posted it in a new thread (because it has little to do with this thread): C++ Creation of a Singleton object in initializer list causes an Access Violation (only Release Mode)

The problem is not in QT but in your source code. "0xC0000005: Access violation reading location 0x0000000c" means that you try to access a wrong memory location.
Check out your arrays, ans pointers.

Related

Xamarin's Forms Chip Error on launch of app

I am getting the following error in Xamrain forms and their is no more detail I can give until you ask me as unfamiliar with the error never had it before.
Severity Code Description Project File Line Suppression State
Error error: CGViewProvider_1 is not abstract and does not override
abstract method checkView(View,int) in ChipItemViewProvider public
class
CGViewProvider_1 THEHOCKEYLAB.Android D:\GitMaster\thehockeylabl.mobile\THEHOCKEYLAB\THEHOCKEYLAB.Android\obj\Debug\110\android\src\crc640a67887a4134e062\CGViewProvider_1.java 4
It seems to be something to do with their conversation code that converts the code into real time java, I see no obv way of getting to what the error is from here it happens on launch and cancels the build..
Its making a referring to ChipItemViewProdiver I have not changed processers or any part of my pc this application works.
If you let me no how to get extra debug info to diagnose this I would be greatfull
Edit 2
It would be appear to do with having fast debug on and the linker at the same time I am trailing it here and see if it works.
This was caused by having the linker and fast debug switched on your settings for Android should be like this. To avoid the error.
BTW I didnt change this manually folks this was after VS Update

What is causing intermittent "Object reference not set to an instance of an object" at compile time in VS 2010?

I am sorry if this is not really a coding question (it depends on if its my code causing the problem I suppose).
I have seen this question: Tracking down intermittent 'Object reference not set to an instance of an object.' error on build
However, it has not been of much help (although if you read the comments, you will see that I thought it did help for a while there).
When I try publish my website, occasionally, I will get an error with no file or line reference:
Pre-compiling Web Site
Building directory '/App_Code/'.
Building directory '/'.: Publication (web): Object reference not set to an instance of an object.
Pre-compilation Complete
------ Skipped Publish: Project X:\, Configuration: Debug Any CPU ------
I know the usual causes of "Object reference not set to an instance of an object" but this seems a bit different, isn't it supposed to be a runtime error? Not a build error?
What is weird is that it happens, seemingly at random (about 25%-33% of the time). I can try to publish it and have it fail. Then try again straight after, without changing anything and it works fine.
I started getting this error after moving some of my functions (VB.net btw) to a new file in the App_Code folder so they can be accessed by all pages of the site.
If you need any more info, please let me know.
Thanks,
EDIT: After further investigation, it seems to only happen if I try to publish the website within a few seconds of saving changes to any file within it. What could cause this?
The same error occurred for me to, I deleted the dlls of the custom controls in the web site that are already in the bin, then i published the web site, and succeeded
IF you have any custom/usercontrols in your project, they are actually running at design time and can give object ref errors. This can occur during builds too. In that case, a property is being referenced that is NOTHING and throws the error.
I had a similar problem with a Windows Form project.
Wherever I try to move a custom control on the windows form, and then try to save the form, VS2010 comes back with "Object not set to an instance of an object".
I suspected the error was deep down in the layers of abstraction in my inherited code, but couldn't work out how deep to go, without reviewing every line of code.
My solution to this problem is this.
Open up another instance of Visual Studio 2010
Menu: Debug | Attach to Process..
Search for "devenv.exe xxx YourApplicationName..." and select it
Click "Attach"
Menu: Debug | Exceptions..
Tick all the boxes in the thrown column, then "OK"
Your second instance of VS2010 is not debugging your first instance, including all the custom controls.
Return to the first instance of VS2010, and repeat the actions that caused the error in the first place, the second instance of VS2010 will break at the line of code that has the error.
You may want to look at this link there is a bug in vs2012
https://connect.microsoft.com/VisualStudio/feedback/details/749901/error-when-i-click-publish-object-reference-not-set-to-an-instance-of-an-object

Flex SDK missing fundamental things

alt text http://img710.imageshack.us/img710/4107/flashbuildershite.jpg
All of a sudden Flash Builder 4 is missing all kinds of fundamental things and is generating incorrect errors. I've had the same issue yesterday, where I fixed it by downloading a new Flex SDK and importing that into FB. I did this again, but this time it fixed nothing.
I don't think it's something I did, like removing critical references from the build path. The errors also appeared on projects I was not working on at the time. It occurs for ActionScript, Flex and Flex Library projects alike.
Update 3: Well, i've singled the problem down to a single piece of code, though a very simple one. I can make a new workspace in FB and things work ok, then screw the workspace up forever by adding this code to a project. All projects will have errors and closing or even removing the faulty project does not change this. Making another new workspace (without the faulty code) makes my projects compile again.
Link: http://www.the3rdage.net/files/2745/Main.as
(i've uploaded the file in case an odd character or encoding error causes the error)
Update 2: I've tried manual compiling with mxmlc, the same errors occur. It appears to be an SDK problem, not Flash Builder.
Update: I find this stack trace in the Flash Builder error log:
!ENTRY com.adobe.flexbuilder.project 4 43 2010-05-11 11:55:47.495
!MESSAGE Uncaught exception in compiler
!STACK 0
java.lang.NullPointerException
at macromedia.asc.semantics.ConstantEvaluator.evaluate(ConstantEvaluator.java:2592)
at macromedia.asc.parser.VariableBindingNode.evaluate(VariableBindingNode.java:64)
at macromedia.asc.semantics.ConstantEvaluator.evaluate(ConstantEvaluator.java:2233)
at macromedia.asc.parser.ListNode.evaluate(ListNode.java:44)
at macromedia.asc.semantics.ConstantEvaluator.evaluate(ConstantEvaluator.java:2578)
at macromedia.asc.parser.VariableDefinitionNode.evaluate(VariableDefinitionNode.java:48)
at macromedia.asc.semantics.ConstantEvaluator.evaluate(ConstantEvaluator.java:2310)
at macromedia.asc.parser.StatementListNode.evaluate(StatementListNode.java:60)
at macromedia.asc.semantics.ConstantEvaluator.evaluate(ConstantEvaluator.java:2503)
at macromedia.asc.parser.WithStatementNode.evaluate(WithStatementNode.java:44)
at macromedia.asc.semantics.ConstantEvaluator.evaluate(ConstantEvaluator.java:2310)
at macromedia.asc.parser.StatementListNode.evaluate(StatementListNode.java:60)
at macromedia.asc.semantics.ConstantEvaluator.evaluate(ConstantEvaluator.java:2891)
at macromedia.asc.parser.FunctionCommonNode.evaluate(FunctionCommonNode.java:106)
at macromedia.asc.semantics.ConstantEvaluator.evaluate(ConstantEvaluator.java:2905)
at macromedia.asc.parser.FunctionCommonNode.evaluate(FunctionCommonNode.java:106)
at macromedia.asc.semantics.ConstantEvaluator.evaluate(ConstantEvaluator.java:3643)
at macromedia.asc.parser.ClassDefinitionNode.evaluate(ClassDefinitionNode.java:106)
at macromedia.asc.semantics.ConstantEvaluator.evaluate(ConstantEvaluator.java:3371)
at macromedia.asc.parser.ProgramNode.evaluate(ProgramNode.java:80)
at flex2.compiler.as3.As3Compiler.analyze4(As3Compiler.java:709)
at flex2.compiler.CompilerAPI.analyze(CompilerAPI.java:3089)
at flex2.compiler.CompilerAPI.analyze(CompilerAPI.java:2977)
at flex2.compiler.CompilerAPI.batch2(CompilerAPI.java:528)
at flex2.compiler.CompilerAPI.batch(CompilerAPI.java:1274)
at flex2.compiler.CompilerAPI.compile(CompilerAPI.java:1496)
at flex2.tools.oem.Application.compile(Application.java:1188)
at flex2.tools.oem.Application.recompile(Application.java:1133)
at flex2.tools.oem.Application.compile(Application.java:819)
at flex2.tools.flexbuilder.BuilderApplication.compile(BuilderApplication.java:344)
at com.adobe.flexbuilder.multisdk.compiler.internal.ASApplicationBuilder$MyBuilder.mybuild(ASApplicationBuilder.java:276)
at com.adobe.flexbuilder.multisdk.compiler.internal.ASApplicationBuilder.build(ASApplicationBuilder.java:127)
at com.adobe.flexbuilder.multisdk.compiler.internal.ASBuilder.build(ASBuilder.java:190)
at com.adobe.flexbuilder.multisdk.compiler.internal.ASItemBuilder.build(ASItemBuilder.java:74)
at com.adobe.flexbuilder.project.compiler.internal.FlexProjectBuilder.buildItem(FlexProjectBuilder.java:480)
at com.adobe.flexbuilder.project.compiler.internal.FlexProjectBuilder.build(FlexProjectBuilder.java:306)
at com.adobe.flexbuilder.project.compiler.internal.FlexIncrementalBuilder.build(FlexIncrementalBuilder.java:157)
at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:627)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:170)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:201)
at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:253)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:256)
at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:309)
at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:341)
at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:140)
at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:238)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Did you get a chance to list this issue in their bugs list. I have not yet tried Flex 4. did you try to refresh your project and re open your flash builder.
Update:
What about a simple project. I think you are trying to load something which its not able to get.
mxmlc - verify-digests
Try this.
Problems I've had that were somewhat similar, once I had FB running under the wrong version of Java. Another time I had done some edits to the flex-config.xml file in order to make it work with a Maven plugin we had written in house. After that we made the plugin look at a copy of the original xml file, so that problem went away.
hth.
Might i recommend HFCD? The HellFire Compile Daemon is an out of process flex compiler that speeds up compile times immensely, and almost more importantly runs in a separate process from FlashBuidler. I have had some absolutely horrendous errors with Flash Builder due to the complexity and size of our project, where HFCD has helped tremendously here.

How to debug a WER minidump of an "ngen"ed image

When ngen is executed on a .NET managed application at installation time, and a crash dump is retrieved from Windows Error Reporting for the app, how can you use it to see a stack trace, variables, etc.?
Here's some background related to the question: We have a .NET app that gets ngened at installation. When it crashes due to an unhandled .NET exception, the crash is bucketted in Windows Error Reporting, and from that I was able to download the minidump.mdmp file from winqual.microsoft.com.
I put minidump.mdmp in a folder containing the .dbg files for the build of the app that crashed, and double-clicked minidump.mdmp to open it in a new instance of VS2008 SP1. My stack trace looks like this:
kernel32.dll!RaiseException() + 0x3d bytes
mscorwks.dll!RaiseTheExceptionInternalOnly() + 0x295 bytes
mscorwks.dll!JIT_Throw() + 0x130 bytes
MyApp.ni.exe!000007feee74c84c()
[Frames below may be incorrect and/or missing, no symbols loaded for MyApp.ni.exe]
0000000070000d5e()
MyApp.ni.exe!000007feee611000()
000000000300bf78()
000000000300bf60()
The Modules window indicates that symbols are loaded for the OS and .NET DLLs, but for the application modules, I get this:
MyApp.exe -> No native symbols in symbol file.
MyApp.ni.exe -> No matching binary found.
MyAppsLibrary.ni.dll -> No matching binary found.
The easiest way to debug those dumps is with the Windows Debuggers (Windbg, cdb, or ntsd) and to load the SOS debugger extension (you can search for SOS for more details).
As far as I remember, the NGEN'ed part of thing shouldn't matter for SOS as long as you have the original EXE and the symbols (Since it's your app, I'd expect you have the non ngen'ed exe and symbols).
"Debugging Tools for Windows" (specifically, WinDBG) has limited support for managed apps. Provided with PDBs, you should be able to see the call stack, including source line references. To see variable values, you'll need to use the SOS plugin, which is more difficult that just opening the call stack window.
If you're able to request the clients to run your app again, ask them to run it with the following environment variable set: COMPLUS_ZapDisable=1
This way CLR won't load the native images when running your app and you'll see your usual modules with symbols on the stack.
http://referencesource.microsoft.com/faq.aspx
Is this of any help for you:
Symbol issue when debugging C# code
The guy seems to be able to load some symbols to debug his application from the crash dump, had a problem loading the correct symbols but someone answered his question.
Since this is managed code, you may need to set the _NT_EXECUTABLE_IMAGE_PATH environment variable to point to the folders where your executables live. In this case, you'll need to locate the folder in the NativeImage cache that points to your assemblies. The debugger needs the images in order to load the assembly.

Exception that goes away with Clean/Rebuild. How to diagnose/prevent?

Pre-Problem: our office was hit by a worm due to a corporate patching oversight, and the boys in the lab repaved my machine. I needed to re-install all my development tools (Visual Studio 2005, SP1, and the Web Application Project Setup patch) again. The following problem did not occur before this event.
I've been working on an ASP.NET web application project for several months now. I've been editing, debugging, etc without a problem. Then, I added a single line of code, ran it in Debug and got this error:
System.Web.HttpUnhandledException:
Exception of type 'System.Web.HttpUnhandledException'
was thrown.
System.IO.FileLoadException: The given assembly name
or codebase was invalid. (Exception from HRESULT: 0x80131047)
I uncommented the new code, built the project and ran in debug again, but got the same error.
New Code:
Me.frm.btnSubmitChanges.Attributes.Add("onclick", "javascript:return validateSubmit();")
The only way I've been able to fix this is to Clean, then Rebuild the project. I haven't been able to trap where it's happening using breakpoints.
It's happened a couple times in the last few days. What should I be looking at to fix this?
Thank you!
Have you tried to enable Fusion Logger to see if it's an assembly that is failing to load? In C# you can tell the debugger to break at any exception (There's a command you can add by customizing the tool bar called Exceptions). I'm not sure if VB has this but I would assume they do. Can you tell it break on FileLoadException and that might help you understand what's going on.
The line of code you added is pretty innocuous. When you add the code it breaks, have you then done a clean build with that line of code still in and does it work or not?
I did run the Fusion Logger, but did not get any results when the exception occurred. I tried all 4 settings.
The new line of code runs fine after a clean/rebuild.
I haven't used the break on all exceptions before; I'll see if I can find it.

Resources