Solved Invalid parameter passed to C runtime function.
-
Can please someone tell me what can cause this error ?
or how to find/debug it
edit :
i have this output when icompilerun my qt project, but i have no idea since when and why ..
thanks -
@lelev Can you post the exact error/warning message?
-
@jsulm hi
i have this in application output, when i run my program
Invalid parameter passed to C runtime function. -
@lelev I asked because you wrote "i have this output when i compile my qt project".
Well, with this amount of information it is impossible to say where exactly it happens. You can try to disable functionality in your app until it disappears, then analize what Qt functionality you're using in the part of your code causing this warning and then you would need to step into Qt code while debugging to find the exact location.
Alternative is to use strace/ltrace tools. -
thank you
@jsulm said in Invalid parameter passed to C runtime function.:you wrote "i have this output when i compile my qt project".
yes sorry, it was mistake, i edited
@jsulm can i assume it is on c++ side of my project or it also can be in qml ?
i will try strace/ltrace tools
-
@lelev It's for sure C++, somewhere in Qt - it is calling a function from C standard library with wrong parameter.
-
@jsulm i switched to debug mode expecting more details about the error, but no error is outputed in debug mode, can it help you to help me ?
-
Windows, Linux, OSX, other?
IDE, compiler, debugger?
Any warnings you get from Qt in the application output pane?
When and how does the problem manifest itself? Is it a window opening, a file being closed, something more esoteric?I don't know about creator but many (more like all) disassemblers allow you to attach a breakpoint on specific kernel calls (e.g. file open), so it's worth researching a bit in that regard. Can it be done in Creator and/or your debugger.
-
@kshegunov hi,
its on windows 7 pro 64bit
QtCreator last version
mingw73_64@kshegunov said in Invalid parameter passed to C runtime function.:
Any warnings you get from Qt in the application output pane?
the messages is printed to application output pane as soon i start the program (run button in qt creator)
thank you for yr help
-
@lelev @kshegunov
I have made the same experience. Suddenly this strange message appeared in the application pane. I was wondering how to track where it steams from.
I am on windows 10 64 bit, creator was 4.9.2 and IIRC Qt 5.12.3 64 bit.
Unfortunately I cannot reproduce at the moment. The update to creator 4.10.0 was interfered by AV and the current installation of that creator version is typically keeping one core completely busy. Therefore I have installed creator 4.9.2.IMHO it is a compiler/linker issue because it is seen in the application window. IIRC I have seen the warning in debug and release compilations.
@lelev said in Invalid parameter passed to C runtime function.:
the messages is printed to application output pane as soon i start the program (run button in qt creator)
Same for me. However, it appeared also lateron in "some kind of bursts" and not single events.
-
It may be something from the debugger (a different version is one thing to try) or Creator itself (another version is an option). It may be something from Qt, but I don't see what public API could trigger it if it appears before the
QCoreApplication
constructor. It may be some global init in Qt itself too, so another option is to try a bare application that doesn't load Qt at all ... -
Well that's a common enough warning, that I get regularly is some of my projects as well.
@koahnig
IIRC I traced it down the use usage of QSettings, but wasn't able to pinpoint it down more -
I have the same problem, Qt 5.12.6 mingw73_64 Creator 4.7.1 on Windows 7 Pro 64-bit. It only happens in release mode, even though there is no mode-dependent setting in my .pro file. I do not use QSettings explicitly, but when I fail to set the app's organisation/domain name I get a complaint from QSettings, so it does seem to be invoked behind the scenes.
I'm actually chasing the problem that the packaged (with windeployqt) application exits cleanly without doing anything whatsoever, while it works just fine (in debug and release mode) in Creator. Landed here because this error message is my only clue at this point...