I had same problem.  On x64 linux machine worked fine, on x86 windows in 
release mode worked fine but sometimes couldnt start. In debug mode program 
refused to execute with same problems:

> Invalid parameter passed to C runtime function.

In my case it was problems with stack. Try to move your objects to heap and 
catch exeptions on memory allocations.


Wed, 13 Jun 2012 16:25:59 -0400 от Josiah Bryan <josiahbr...@gmail.com>:
 
I'm attempting to debug an odd problem wherein my program 
(http://code.google.com/p/dviz/) crashes when displaying certain UTF-8 strings. 
That's not really why I'm emailing - the problem I'd like your help with is 
that I'm unable to run the program in "Debug" mode in Qt Creator on Windows 7. 

I've set the project in Qt Creator to the "Debug" build and tried to run it in 
the Debugger (F5). The program builds and launches - however, before the main 
UI can appear, an error dialog titled "Microsoft Visual C++ Runtime Library" 
appears giving the following error: "This application has requested the Runtime 
to terminate in an unusual way. Please contact the application's support team 
for more information."

Below the console output from Qt Creator. As you can guess, it does run 
correctly in "Release" mode in Qt Creator (just crashes when the user performs 
a certain UI action - hence why I want to run it in Debug mode. Note that it 
does not crash on linux in gdb or in release mode - so this is specific to 
Windows and the debugger in Qt Creator.)

You'll note there are comments in the console output below regarding 
constructing QApplication before QPaintDevice and other references to 
QApplication - well, I don't know why it's complaining about that, because 
QApplication is created on the second line of code to be executed in in main() 
- see http://code.google.com/p/dviz/source/browse/trunk/src/main.cpp#36 for 
proof.

In short, I can't run in the Debugger to trace the crash in Release, because 
the debugger crashes before the program even starts. (And the debugger doeesn't 
give a stack trace to indicate where the MSVC runtime freaks out at.)

Any thoughts on what I can do to fix this or at least track down the problem 
more accurately so I can get the program to execute in the debugger?

Console output:

Debugging starts 
SlideTemplateManager::loadOrCreate( 0 ): file: 
"C:/Users/JosiahBryan/DVizUserTemplates.dviz" 
QObject: Cannot create children for a parent that is in a different thread.
(Parent is NativeViewerPhonon(0x895c780), parent's thread is 
QThread(0x7065da0), current thread is QThread(0x990a7d8)
QCoreApplication::applicationFilePath: Please instantiate the QApplication 
object first
QObject: Cannot create children for a parent that is in a different thread.
(Parent is NativeViewerPhonon(0x895c780), parent's thread is 
QThread(0x7065da0), current thread is QThread(0x990a7d8)
QWidget: Must construct a QApplication before a QPaintDevice
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.


-- 
Josiah Bryan
765-215-0511
josiahbr...@gmail.com

    
----------------------------------------------------------------------
_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to