Community
    • Login

    Notepad++ lost track of open files / why?

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    23 Posts 7 Posters 4.5k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Fabian SantiagoF
      Fabian Santiago @pnedev
      last edited by

      @pnedev sorry my reply took so long. here you are. it won’t let me upload / attach the log file here so this is the content (there was nothing sensitive in it so this is fully intact):

      2022-07-25 11:08:22 WM_QUERYENDSESSION =====================================
      2022-07-25 11:08:24 C:\Users\fabian\AppData\Roaming\Notepad++\config.xml is opened.
      2022-07-25 11:08:24 C:\Users\fabian\AppData\Roaming\Notepad++\config.xml 8015/8015 bytes are written.
      2022-07-25 11:08:24 C:\Users\fabian\AppData\Roaming\Notepad++\config.xml is closed.
      2022-07-25 11:08:24 C:\Users\fabian\AppData\Roaming\Notepad++\session.xml is opened.
      2022-07-25 11:08:24 C:\Users\fabian\AppData\Roaming\Notepad++\session.xml 3683/3683 bytes are written.
      2022-07-25 11:08:24 C:\Users\fabian\AppData\Roaming\Notepad++\session.xml is closed.
      2022-07-25 11:08:24 WM_ENDSESSION
      2022-07-25 11:08:24 WM_DESTROY
      2022-08-19 10:43:58 WM_QUERYENDSESSION =====================================
      2022-08-19 10:43:58 C:\Users\fabian\AppData\Roaming\Notepad++\config.xml is opened.
      2022-08-19 10:43:58 C:\Users\fabian\AppData\Roaming\Notepad++\config.xml 8256/8256 bytes are written.
      2022-08-19 10:43:58 C:\Users\fabian\AppData\Roaming\Notepad++\config.xml is closed.
      2022-08-19 10:43:58 C:\Users\fabian\AppData\Roaming\Notepad++\session.xml is opened.
      2022-08-19 10:43:58 C:\Users\fabian\AppData\Roaming\Notepad++\session.xml 6047/6047 bytes are written.
      2022-08-19 10:43:58 C:\Users\fabian\AppData\Roaming\Notepad++\session.xml is closed.
      2022-08-19 10:43:58 WM_ENDSESSION
      2022-08-19 10:43:58 WM_DESTROY
      2022-08-23 12:10:06 WM_QUERYENDSESSION =====================================
      2022-08-23 12:10:07 C:\Users\fabian\AppData\Roaming\Notepad++\config.xml is opened.
      2022-08-23 12:10:07 C:\Users\fabian\AppData\Roaming\Notepad++\config.xml 8256/8256 bytes are written.
      2022-08-23 12:10:07 C:\Users\fabian\AppData\Roaming\Notepad++\config.xml is closed.
      2022-08-23 12:10:07 C:\Users\fabian\AppData\Roaming\Notepad++\session.xml is opened.
      2022-08-23 12:10:07 C:\Users\fabian\AppData\Roaming\Notepad++\session.xml 5434/5434 bytes are written.
      2022-08-23 12:10:07 C:\Users\fabian\AppData\Roaming\Notepad++\session.xml is closed.
      2022-08-23 12:10:07 WM_ENDSESSION
      2022-08-23 12:10:07 WM_DESTROY
      2022-08-23 23:44:57 WM_QUERYENDSESSION =====================================
      2022-08-23 23:44:58 C:\Users\fabian\AppData\Roaming\Notepad++\config.xml is opened.
      2022-08-23 23:44:58 C:\Users\fabian\AppData\Roaming\Notepad++\config.xml 8256/8256 bytes are written.
      2022-08-23 23:44:58 C:\Users\fabian\AppData\Roaming\Notepad++\config.xml is closed.
      2022-08-23 23:44:58 C:\Users\fabian\AppData\Roaming\Notepad++\session.xml is opened.
      2022-08-23 23:44:58 C:\Users\fabian\AppData\Roaming\Notepad++\session.xml 5430/5430 bytes are written.
      2022-08-23 23:44:58 C:\Users\fabian\AppData\Roaming\Notepad++\session.xml is closed.
      2022-08-23 23:44:58 WM_ENDSESSION
      2022-08-23 23:44:58 WM_DESTROY
      2022-09-12 14:54:17 WM_QUERYENDSESSION =====================================
      2022-09-12 14:54:17 C:\Users\fabian\AppData\Roaming\Notepad++\config.xml is opened.
      2022-09-12 14:54:17 C:\Users\fabian\AppData\Roaming\Notepad++\config.xml 8352/8352 bytes are written.
      2022-09-12 14:54:17 C:\Users\fabian\AppData\Roaming\Notepad++\config.xml is closed.
      2022-09-12 14:54:17 C:\Users\fabian\AppData\Roaming\Notepad++\session.xml is opened.
      2022-09-12 14:54:17 C:\Users\fabian\AppData\Roaming\Notepad++\session.xml 3707/3707 bytes are written.
      2022-09-12 14:54:17 C:\Users\fabian\AppData\Roaming\Notepad++\session.xml is closed.
      2022-09-12 14:54:17 WM_ENDSESSION
      2022-09-12 14:54:17 WM_DESTROY
      2022-09-14 01:23:48 WM_QUERYENDSESSION =====================================
      2022-09-14 01:23:48 C:\Users\fabian\AppData\Roaming\Notepad++\config.xml is opened.
      2022-09-14 01:23:48 C:\Users\fabian\AppData\Roaming\Notepad++\config.xml 8366/8366 bytes are written.
      2022-09-14 01:23:48 C:\Users\fabian\AppData\Roaming\Notepad++\config.xml is closed.
      2022-09-14 01:23:48 C:\Users\fabian\AppData\Roaming\Notepad++\session.xml is opened.
      2022-09-14 01:23:48 C:\Users\fabian\AppData\Roaming\Notepad++\session.xml 3709/3709 bytes are written.
      2022-09-14 01:23:48 C:\Users\fabian\AppData\Roaming\Notepad++\session.xml is closed.
      2022-09-14 01:23:48 WM_QUERYENDSESSION =====================================
      2022-09-14 01:23:48 C:\Users\fabian\AppData\Roaming\Notepad++\config.xml is opened.
      2022-09-14 01:23:48 C:\Users\fabian\AppData\Roaming\Notepad++\config.xml 9398/9398 bytes are written.
      2022-09-14 01:23:48 C:\Users\fabian\AppData\Roaming\Notepad++\config.xml is closed.
      2022-09-14 01:23:48 C:\Users\fabian\AppData\Roaming\Notepad++\session.xml is opened.
      2022-09-14 01:23:48 C:\Users\fabian\AppData\Roaming\Notepad++\session.xml 193/193 bytes are written.
      2022-09-14 01:23:48 C:\Users\fabian\AppData\Roaming\Notepad++\session.xml is closed.
      2022-09-14 01:23:48 WM_ENDSESSION
      2022-09-14 01:23:48 WM_DESTROY

      pnedevP 1 Reply Last reply Reply Quote 2
      • pnedevP
        pnedev @Fabian Santiago
        last edited by

        @Fabian-Santiago ,
        Thank you. I hope it will be useful and give some insight on the cause of the problem.

        BR

        xomxX 1 Reply Last reply Reply Quote 0
        • xomxX
          xomx @pnedev
          last edited by

          @Fabian-Santiago

          Thanks for the log!

          Do you have your N++ autoupdate set ON? (Preferences -> MISC. -> Enable Notepad++ auto-updater checked)

          @pnedev

          This is the same pattern as in here.

          The relevant thing is the last surprising duplicate of the WM_QUERYENDSESSION log, where the session.xml file evidently gets emptied (“2022-09-14 01:23:48 C:\Users\fabian\AppData\Roaming\Notepad++\session.xml 193/193 bytes are written.”)

          So we are getting a little bit closer - now let’s discuss how this could happen.

          If there were slightly different times in the duplicate log items at the end, I could suspect some N++ multi-instancing problem or N++ zombie/crashed process behind, but we have the same log-time everywhere. So I do not think so.

          If it was a racing condition, the last two WM_QUERYENDSESSION items would probably be mixed together. So I do not think so.

          I’m wondering if it cannot be a coincidence with the N++ autoupdating.

          Any other thoughts?

          Andi KiisselA Fabian SantiagoF 2 Replies Last reply Reply Quote 2
          • Andi KiisselA
            Andi Kiissel @xomx
            last edited by

            @xomx
            At the same time config.xml gets 1032 bytes bigger. Quite a big difference.

            xomxX 1 Reply Last reply Reply Quote 1
            • Fabian SantiagoF
              Fabian Santiago @xomx
              last edited by

              @xomx yes i do:

              Screen Shot 2022-09-19 at 9.02.17 AM.png

              1 Reply Last reply Reply Quote 1
              • xomxX
                xomx @Andi Kiissel
                last edited by

                @Andi-Kiissel

                Maybe it could be interesting to see the content of such config.xml too.

                Now about something else - I have just checked the relevant N++ shutdown source code and I have the following crazy idea (I have not tested/debugged that yet):

                • the WM_QUERYENDSESSION and WM_CLOSE messages share the same code part
                • at the standard (user initiated closing of the N++ app) N++ shutdown, the N++ receives only the WM_CLOSE one from these two
                • when a Windows restart occurs, while the N++ is still opened, the N++ receives both of them, WM_QUERYENDSESSION 1st and the N++ executes the same code part as the WM_CLOSE, then returns TRUE (when an user did not cancelled the Windows restart/shutdown)
                • when an app sent TRUE to the Windows OS as a response to the WM_QUERYENDSESSION, that app shutdown continues, so the app should obtain the WM_CLOSE sometime later!
                • and I think that this “double-execution” of the same code part can be the culprit

                Look at this part - I think that during the 1st execution all the opened files are closed, so at the 2nd execution the session has not any opened files to store!

                If I am right, the solution is to handle the WM_QUERYENDSESSION and WM_CLOSE separately.

                pnedevP 1 Reply Last reply Reply Quote 4
                • pnedevP
                  pnedev @xomx
                  last edited by pnedev

                  @xomx said in Notepad++ lost track of open files / why?:

                  If I am right, the solution is to handle the WM_QUERYENDSESSION and WM_CLOSE separately.

                  I haven’t looked at the code myself yet but that is a very good assumption @xomx .

                  @Fabian-Santiago ,

                  Could you also share your Backup settings tab?
                  Thank you once again for the debug input.

                  Fabian SantiagoF 1 Reply Last reply Reply Quote 1
                  • Fabian SantiagoF
                    Fabian Santiago @pnedev
                    last edited by

                    @pnedev yes:

                    Screen Shot 2022-09-19 at 11.37.12 PM.png

                    1 Reply Last reply Reply Quote 2
                    • pnedevP
                      pnedev
                      last edited by

                      @xomx , All,

                      I suspect that on occasions the periodic session backup might be triggered while in the process of WM_QUERYENDSESSION but that needs further investigation.

                      BR

                      xomxX 1 Reply Last reply Reply Quote 1
                      • xomxX
                        xomx @pnedev
                        last edited by xomx

                        @pnedev

                        There is also report mentioning a possible coincidence with a pending N++ auto-update.

                        User has periodic backups enabled too.

                        1 Reply Last reply Reply Quote 1
                        • First post
                          Last post
                        The Community of users of the Notepad++ text editor.
                        Powered by NodeBB | Contributors