Menu

How to log freezes

Rafał
2009-08-09
2012-11-13
  • Rafał

    Rafał - 2009-08-09

    Since few builds at least, N++ is freezing every now and then without any apparent reason.

    Thus, I would like to know how I can log N++ freezes so that they could be fixed?

    Is there some special tool for that? In Opera, I use Inspector IIXII, it could be useful here too. It will show EIP at least. What's proffered method?

     
    • Rafał

      Rafał - 2009-08-12

      I have installed VS, compiled debug version and been using it under debugger.

      When I paused program I was at PowerEditor\src\Misc\PluginsManager\PluginsManager.h on line:

          void notify(SCNotification *notification) {
              for (size_t i = 0 ; i < _pluginInfos.size() ; i++)
              {
                  // To avoid the plugin change the data in SCNotification
                  // Each notification to pass to a plugin is a copy of SCNotification instance
                  SCNotification scNotif = *notification;
      ------>            _pluginInfos[i]->_pBeNotified(&scNotif);
              }
          };

      scNotif structure was:

          scNotif    {nmhdr={...} position=881516 ch=4652412 ...}    SCNotification
              nmhdr    {hwndFrom=0x000808ca idFrom=154584280 code=1008 }    NotifyHeader
              position    881516    int
              ch    4652412    int
              modifiers    883412    int
              modificationType    -86547003    int
              text    0x000d7408 "`t
      "    const char *
              length    4657716    int
              linesAdded    -1    int
              message    881544    int
              wParam    4652412    unsigned long
              lParam    883440    long
              line    -86547167    int
              foldLevelNow    -86561999    int
              foldLevelPrev    4657716    int
              margin    883456    int
              listType    -86547151    int
              x    -86562047    int
              y    4657716    int
              token    940636    int
              annotationLinesAdded    14352488    int

      and when I stepped once I went into ChangeMarker code:

      >    NppPlugin_ChangeMarker.dll!61703593()    
           [Frames below may be incorrect and/or missing, no symbols loaded for NppPlugin_ChangeMarker.dll]   
           NppPlugin_ChangeMarker.dll!61704fed()    
           NppPlugin_ChangeMarker.dll!6170144a()    
           notepadPlus_Debug.exe!PluginsManager::notify(SCNotification * notification=0x000d3d34)  Line 105 + 0x1a bytes    C++
           notepadPlus_Debug.exe!Notepad_plus::doSave(Buffer * id=0x0936c4d8, const wchar_t * filename=0x0936c56a, bool isCopy=false)  Line 902    C++
           notepadPlus_Debug.exe!Notepad_plus::fileSave(Buffer * id=0x00000000)  Line 1186 + 0x1a bytes    C++
           notepadPlus_Debug.exe!Notepad_plus::command(int id=41006)  Line 3145    C++
           notepadPlus_Debug.exe!Notepad_plus::runProc(HWND__ * hwnd=0x000808ca, unsigned int Message=273, unsigned int wParam=41006, long lParam=0)  Line 7804    C++
           notepadPlus_Debug.exe!Notepad_plus::Notepad_plus_Proc(HWND__ * hwnd=0x000808ca, unsigned int Message=273, unsigned int wParam=41006, long lParam=0)  Line 9119    C++

       
      • Thell Fowler

        Thell Fowler - 2009-08-13

        Thank you for reporting this.  Is there anything you can tell us to help isolate it?  I haven't experienced this, yet would really like to be able to fix it if it is the Change Marker dll?

        Is this a huge file or something?  Where you doing massive amounts of changes via find/replace?  Perhaps an extremely long session?

        Thell

         
    • Rafał

      Rafał - 2009-08-12

      Of course I paused debugger Npp when freeze happened.

       
      • Jocelyn Legault

        Jocelyn Legault - 2009-08-13

        rchl:
        Do you have reliable reproduction steps you could share so I would get the hang as well and hopefully fix it?

        thanks,

        joce.

         
    • Rafał

      Rafał - 2009-08-13

      It can happen with almost every file. Last time it was file about 300 lines long.

      Can be related to long sessions but I'm not sure if "extremely long" is good word. Maybe half an hour or a bit more of editing. Even more likely it's related as it happens after some editing and not immediately after opening file.

      I can't reproduce it on demand unfortunately.

      I don't know NPP internals but that scNotify structure looks a bit weird to me:
      position 881516 int
      length 4657716 int

      Quite a big values. Not sure what they mean but file was not big at all (about 5kB).

       
      • Pablo Sande

        Pablo Sande - 2009-08-13

        It happens exactly the same for me. I open a file, and the marker on the left is all yellow, if a edit the file, NPP hangs. I can close the file and open it again and its ok, but sometimes I have to reopen the file many times before it opens it without the yellow markers.

         
        • Thell Fowler

          Thell Fowler - 2009-08-13

          When you _open_ the file there are markers indicating changed lines?  That is _not_ supposed to happen.

          I will definitely try to get some time to look at it today or tomorrow, until then you can disable the plugin right from the plugins menu.

          Please, please try to provide some reproducible steps if you can.

          Thanks

           
    • Pablo Sande

      Pablo Sande - 2009-08-13

      I cant reproduce the error, but it happens two or three times a day. It's exactly as I said, I open a file and the markers are all yellow, if I press any key, NPP crash. But I can close if I dont press any key, and try to reopen the file, but take two o three tries to get ir right.
      Sometimes I open another file, and the reopen the "bad file", to get it right.
      If you tell how can I debug it, or something, I can help you.
      By the way, I use Windows 7 64bits, but in Vista 64 I had the same problem.

       
      • Thell Fowler

        Thell Fowler - 2009-08-13

        The next time you open a file and there are yellow marks _when_ you open it, try going into the Plugins Change Marker menu and selecting disable for this doc, if that doesn't help with that doc, then try disable plugin, and if that doesn't help for that doc then that might be a doc we can use for testing (assuming it isn't confidential).

        And I never did do any testing with 64bit as I don't have access to a machine for that.  I wonder if that might be part of the issue...

         
        • Pablo Sande

          Pablo Sande - 2009-08-13

          OK! I'll send the file when it happens again. But it is not a problem with the file, because after some retries I can open it. Anyway I'll send it to you. I dont know if it is important, but I encode the file with UTF8 without BOM.
          Thanks again!

           
    • Thell Fowler

      Thell Fowler - 2009-08-13

      Rafał,
      Two things.  One can you reproduce well enough to provide the steps, and a file?

      If not, would you be willing to DL the source of nppiface lib and build/use a debug version of that?

      I'm really curious as to what the scn looks like that is getting processed within the CM code during the save routine.

      Thanks again.

       
      • Rafał

        Rafał - 2009-08-13

        I'll try to find reliable reproduce way although it might be hard as it was happening since a long time and I still haven't figured out when it happens.

        I can try to build nppiface in few hours. Hopefully it will as straightforward as compiling NPP.
        But can you provide some link to nppiface?

         
        • Thell Fowler

          Thell Fowler - 2009-08-13

          Sure, the nppifacelib source is available in the nppifacelib git repo (_Not_ the svn repo, that was obliterated for testing some other stuff) or on GitHub at github.com/almostautomated

          If you have access to IRC, we have a support channel on Freenode at #notepad++

          I should be there most of the day, as well as the others, and perhaps we can isolate this.

          BTW - Are you on a 64bit system as well?

           
          • Rafał

            Rafał - 2009-08-13

            I'm NOT on 64bit.

             
    • Thell Fowler

      Thell Fowler - 2009-08-13

      An update...

      Rafał has joined us in #notepad++ on Freenode and has setup to run N++ with the ChangeMarker plugin in debug mode.  If it happens again he should be able to see what's going on.

       
      • Rafał

        Rafał - 2009-08-13

        So far can't make it freeze but will be trying more.

        @Pablo Sande: do you use FTP_Sync plugin when it freezes for you?

         
    • Pablo Sande

      Pablo Sande - 2009-08-13

      Hi again! Ive been away. Today it happened again, I can send you the file, but I dont think the problem is the file.
      How can I install de marker in debug mode? I use npp ALL LONG DAY, so I can be useful.
      By the way, I dont use FTPSync, I used to, but no now.

      Thanks!

       
      • Rafał

        Rafał - 2009-08-14

        To run in debug mode you have to do quite a lot.

        * Download and install Visual Studio 2008 Trial
        * Download N++ source: http://sourceforge.net/projects/notepad-plus/files/notepad%2B%2B%20releases%20source/npp%205.4.5%20src/npp.5.4.5.src.7z/download
        * Download source of NppIfaceLib: http://github.com/almostautomated/nppifacelib_mob/tree/master
        * Find and download source of boost library

        Extract them to same directory and open vc_9.0_sln\Npp_Plugins.sln  in VS and compile in specific order. But that is only overview of what has to be done. There will be some problems so go into IRC if you have problems. Someone will hopefully help you like they did help me.

         
        • Pablo Sande

          Pablo Sande - 2009-08-14

          Thanks! I'll install it this weekend, and I'll let you know if something goes wrong.