Results 1 to 6 of 6

Thread: QtCore4.dll_unloaded exception when usin external Wait function (LabVIEW)

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Sep 2017
    Location
    Russia
    Posts
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QtCore4.dll_unloaded exception when usin external Wait function (LabVIEW)

    Quote Originally Posted by d_stranz View Post
    This is almost certainly a LabView problem, not a Qt problem.
    Maybe you're right. But I don't use Qt in my program in any ways. The vendor-provided library does, so I could conclude that something's wrong with it. I tend to believe that this is threading issues, e.g. when the library is already unloaded but some thread is still alive and tries to reach some space inside that DLL. It might be confirmed indirectly by this issue - the users were having that QtCore4.dll_unloaded crash and the developer had to change the work with threads. That fixed the crash.

    I could confirm or refute my guess by rewriting the same algorithm in another IDE (MSVC, Delphi etc). It would take some time but it would be clear, if it's related to LabVIEW or not.

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,348
    Qt products
    Qt5
    Platforms
    Windows
    Thanks
    318
    Thanked 872 Times in 859 Posts

    Default Re: QtCore4.dll_unloaded exception when usin external Wait function (LabVIEW)

    But I don't use Qt in my program in any ways.
    I think the LabView GUI is Qt-based. However, if you say that when your developer modified the code, the crash went away, it sounds to me like the problem is the relationship between the developer's threading code and the LabView internals. Likely there was either a timing issue over resource cleanup or the threading code was causing memory corruption that was not revealed until the app went through its exit shutdown.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

  3. #3
    Join Date
    Sep 2017
    Location
    Russia
    Posts
    3
    Qt products
    Qt4
    Platforms
    Windows

    Lightbulb Re: QtCore4.dll_unloaded exception when usin external Wait function (LabVIEW)

    Quote Originally Posted by d_stranz View Post
    I think the LabView GUI is Qt-based.
    I used to think the same way, but the experts on NI forums told me that Qt is used only in a few toolkits, which I don't use currently. The rest of LV graphics is written in the core without external components.
    Quote Originally Posted by d_stranz View Post
    if you say that when your developer modified the code, the crash went away
    Well, it was just an example of similar issue and there it was really linked to the threading issues. So my issue also might deal with it or not. But I checked out all the toolkit code and every block seems to be correct and properly configured. I have also compared the code with C examples from SICK and it matches. That's why I don't think that my code or toolkit code is the reason, but it's likely a bug in SICK's C wrapper.

    Meanwhile I have found a workaround to the problem. I placed LoadLibrary( /* path to ICON library here */ ) call right before the camera(s) init. In the end of the code I'm not doing FreeLibrary. That makes LabVIEW to retain the DLL (and Qt lib's tied to it) from unloading on VI's close so it unloads only on process (exe) exit. No crash yet.

    There is another workaround but it's kinda "nasty" - call ExitProcess(0) at the end, so all the threads receive their signals and finish normally. But it doesn't allow LabVIEW to do clean up work and is suitable only in exe variant (because I don't want to see LabVIEW closing when my program is stopped).

    I'm not going to dig deeper because it takes a lot of free time and the things become more and more complex. On good terms the ICON C wrapper should be carefully debugged and rewritten if it's needed.

    Thanks for the help.

Similar Threads

  1. metaObject() function retrieves exception
    By ClintEastwood in forum Qt Programming
    Replies: 2
    Last Post: 23rd April 2013, 13:07
  2. Exception handling in external library - good or bad idea
    By kornicameister in forum Qt Programming
    Replies: 0
    Last Post: 20th February 2012, 15:25
  3. Replies: 1
    Last Post: 2nd June 2010, 17:14
  4. QWaitCondition function wait() error
    By freekill in forum Qt Programming
    Replies: 2
    Last Post: 10th January 2010, 02:54
  5. Wait for a function to finish
    By fitzy in forum General Programming
    Replies: 3
    Last Post: 26th October 2009, 19:20

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.