Menu

#269 Threads were not terminated by the application

Invalid
wont-fix
None
Bug Report
7
2024-03-25
2024-03-24
No

I was able to build WCM 24.02 from its sources in Linux Mint 21.3.

There were over 1000 warnings in the build log.

WCM will now run, but when it terminates, the following error is displayed in the terminal:

Debug: 3 threads were not terminated by the application.

After running WCM again, the error changes to :

Debug: 5 threads were not terminated by the application.

All I did was run ./WebChangeMonitor and then click its close button. I did not perform any actions or change any settings within WCM.

Discussion

  • Gitoffthelawn

    Gitoffthelawn - 2024-03-24

    Possibly helpful:

    Threads were not terminated by the application - wxWidgets Discussion Forum
    https://forums.wxwidgets.org/viewtopic.php?t=23033

     
  • Morten MacFly

    Morten MacFly - 2024-03-24

    I've finally installed LinuxMint and compiled / tried myself. I don't see any error, to be honest.

    As I have written here:
    https://sourceforge.net/p/webchangemon/forum/general_help/thread/17b7b095e9/?limit=25#2cad/102b/db6c

    ...I seriously don't think that's a big deal. in addition to the information from the forum I can add here, that all threads will be terminated properly to stop any operation safely, event if running detached. If you look into the code (void WebChangeMonitorFrame::UnInitialise()) you will find that all threads receive the "PrepareShutDown" call which essentially means that they immediately stop doing any operation.

    If you don't like detached threads, you can change the build to joinable threads by replacing the define THREAD_MODEL_DETACHED with THREAD_MODEL_JOINABLE. Careful: You need to do a re- build in that case.

    Is there are particular reason you file this as a bug? What exactly is the bug, what does not work for you?

     
    • Gitoffthelawn

      Gitoffthelawn - 2024-03-24

      It's real odd that you are not receiving this error. Are you running ./WebChangeMonitor directly from the terminal without any parameters and without any WCM configuration files?

      If so, why would there be any difference? Have you configured any non-default compiler options or taken other steps that would explain the difference?

      I filed this as a bug simply because of the concerning debug message claiming that threads were not terminating upon application termination. This message was sufficiently indicative of a bug to post a bug report to help the project. There is also this post that there could be a memory leak caused by the "non-terminated" threads: https://forums.wxwidgets.org/viewtopic.php?p=98632#p98632. Is a memory leak possible in this situation?

       
      • Morten MacFly

        Morten MacFly - 2024-03-24

        If so, why would there be any difference?

        For threads, timing is always different which makes a big difference. Lets assume I have a faster computer/CPU than you do, than within the same time-frame a lot more operations might be done which could lead to different behaviour easily.

        However, it turns out its NOT the threads of WCM that cause the debug message. I've implemented a thread tracker (in SVN) that keeps track of the threads and would wait a few extra milli-seconds on shutdown to ensure all threads are terminated / destroyed properly. While testing, all (detached) threads of WCM were successfully cleaned-up but I also got a debug message about one thread being left open. The amount of threads also differs in you log, so it cannot be WCM threads but it must be different ones. Now this can be anything: Threads from a library (XML, JSON, CURL or wxWidgets), threads from the underlying widgets (GTK) or any other.

        Is a memory leak possible in this situation?

        No, nothing to worry about and there is also not much I can do about. However, you can be sure that whatever thread is left will not lead to a serious bug / misbehaviour of WCM. And since we talk about the shutdown of a process (WCM) whatever related process memory/resources are left, will be destroyed by the OS anyway.

        I'll wait a little if you have something to add before closing this issue...

         

        Last edit: Morten MacFly 2024-03-24
        • Gitoffthelawn

          Gitoffthelawn - 2024-03-24

          Thank you for your explanation and reassurances. This issue can be closed.

           
  • Morten MacFly

    Morten MacFly - 2024-03-25
    • status: open --> wont-fix
    • Group: Next_Release --> Invalid
     

Log in to post a comment.

MongoDB Logo MongoDB