Menu

Unhandled exception under Wine in Linux

NppExec
MM
2015-11-02
2016-05-06
  • MM

    MM - 2015-11-02

    There is an issue with NppExec when Notepad++ is used under Wine in Linux: When one double-clicks on a line in the NppExec console which contains a file and line number to be opened (as detected using "Console Output Filters"), the file and line get opened in Notepad++, but Notepad++ crashes immediately afterwards due to an "unhandled exception".

    The detailed issue description and backtrace dumps (as attachments) can be found in https://bugs.winehq.org/show_bug.cgi?id=39293 .

    Could this be an issue related to some non-standard API or DLL handling by NppExec?

    Notepad++ itself works fine under Wine. The only issue with it I personally have come across is "Notepad++ freezes if native application changes a file it has open" reported in https://bugs.winehq.org/show_bug.cgi?id=11595 , but there is a workaround described in https://bugs.winehq.org/show_bug.cgi?id=11595#c32 . A general compatibility overview can be found in https://appdb.winehq.org/objectManager.php?sClass=version&iId=25722 .

     

    Last edit: MM 2016-04-22
  • DV

    DV - 2015-11-02

    Please enable NppExec's file logging and paste or attach the lines you'll see under the line "; Console's line double-clicked" here. It will help to localize the error.
    To enable NppExec's file logging, refer to the file "Notepad++\plugins\doc\NppExec_TechInfo.txt", the description of "LogsDir".

     
    • MM

      MM - 2016-04-22

      Sorry for the late reply. I just never got any response notification. Unfortunately, the "; Console's line double-clicked" line does not exist in the log. Here is what is in the log:

      • Notepad++ gets started:
      Log start >>
      ; CNppExec::ReadOptions - start
      ; CNppExec::ReadOptions - end
      ; NPPN_READY - start
      ; NPPN_READY - end
      
      • The command to read in the file content gets executed:
      ; @Input Command: cmd /c type C:\NppExec\output.txt
      ; CScriptEngine::Run - start
      ; command info
      Current command item:  p = 0xEBC168
      {
         _item  = "cmd /c type C:\NppExec\output.txt"
         _prev  = 0x0
         _next  = 0x0
         _owner = 0xE9C604
      }
      ; executing ModifyCommandLine
      ModifyCommandLine()
      {
         [in]  "cmd /c type C:\NppExec\output.txt"
         GetCmdType()
         {
            [in]  "cmd /c type C:\NppExec\output.txt"
            CheckCmdAliases()
            {
               ; command aliases enabled
               [in]  "cmd /c type C:\NppExec\output.txt"
               [out] "cmd /c type C:\NppExec\output.txt"
            }
            [ret] 0x0 (unknown)
         }
         CheckCmdArgs()
         {
            [in]  "cmd /c type C:\NppExec\output.txt"
            [out] "cmd /c type C:\NppExec\output.txt"
         }
         CheckNppMacroVars()
         {
            [in]  "cmd /c type C:\NppExec\output.txt"
            [out] "cmd /c type C:\NppExec\output.txt"
         }
         CheckPluginMacroVars()
         {
            [in]  "cmd /c type C:\NppExec\output.txt"
            [out] "cmd /c type C:\NppExec\output.txt"
         }
         CheckUserMacroVars()
         {
            [in]  "cmd /c type C:\NppExec\output.txt"
            [out] "cmd /c type C:\NppExec\output.txt"
         }
         CheckEmptyMacroVars()
         {
            [in]  "cmd /c type C:\NppExec\output.txt"
            ; the function is enabled
            [out] "cmd /c type C:\NppExec\output.txt"
         }
         ; command argument(s):
         [out] "cmd /c type C:\NppExec\output.txt"
         ; command type:
         [ret] 0x0
      }
      ; starting child process "cmd /c type C:\NppExec\output.txt"
      <MSG> cmd /c type C:\NppExec\output.txt
      <MSG> Process started >>>
      <OUT> C:\NppExec\test.txt:2: whatever
      <MSG> <<< Process finished. (Exit code 0)
      ; child process finished
      ; CScriptEngine::Run - end
      <MSG> ================ READY ================
      
      • The "C:\NppExec\test.txt:2: whatever" line gets double-clicked - the "C:\NppExec\test.txt" file gets opened correctly on line 2 in Notepad++, but Notepad++ crashes immediately (an "unhandled exception" crash notification appears):
      nppConvertToFullPathName()
      {
         [in]  "C:\NppExec\test.txt"
         ; already full path
      }
      ; CNppExec::SaveOptions - start
      ; CNppExec::SaveOptions - end
      Log exit.
      

      That's all there is in the log. Does this help in any way, or could I check something else?

      P.S.: This is with the current Notepad++ v6.9.1 and NppExec_053_dll_Unicode.zip. It asks if one wants to save a dump file, which I did - see attached. (It can be opened in a hex viewer.)

       

      Last edit: MM 2016-04-22
  • DV

    DV - 2016-04-22

    Do I understand correctly that you don't have strings "; Console\'s line double-clicked" and "; WarningAnalyzer info" in the log?
    If so, could you type inside NppExec's Console:

    npe_debug 1
    

    and then double-click any line in the Console? I'm wondering whether you'll be able to see "; Console\'s line double-clicked" in that case.

     
  • DV

    DV - 2016-04-22

    This is what expected to be seen in the Console in that case:

    npe_debug 1
    NPE_DEBUGLOG: 1
    Debug Log is On (1)
    ; CScriptEngine::Run - end
    ================ READY ================
    
    ; Console's line double-clicked
    ; WarningAnalyzer info
    ; {
    ;    Input line: "Debug Log is On (1)"
    ;    Match result: true
    ;    Active filter: "%FILE%(%LINE%)*"
    ;    * Parsed File Name: "Debug Log is On"
    ;    * Parsed Line Number: 1
    ;    * Parsed Char Position: <none>
    ; }
    nppConvertToFullPathName()
    {
       [in]  "Debug Log is On"
    }
    
     
    • MM

      MM - 2016-04-22

      Please see the response below (just in case you don't get thread update notifications, which is the case with me; although I don't know how it is with direct replies either) :)

       
  • MM

    MM - 2016-04-22

    Do I understand correctly that you don't have strings "; Console\'s line double-clicked" and "; WarningAnalyzer info" in the log?
    If so, could you type inside NppExec's Console:

    npe_debug 1

    and then double-click any line in the Console? I'm wondering whether you'll be able to see "; Console\'s line double-clicked" in that case.

    Yes, with "npe_debug 1" I now get following in the log file (and the console) when double-clicking on the line to open it in Notepad++:

    ; Console's line double-clicked
    ; WarningAnalyzer info
    ; {
    ;    Input line: "C:\NppExec\test.txt:2: whatever"
    ;    Match result: true
    ;    Active filter: "%FILE%:%LINE%:*"
    ;    * Parsed File Name: "C:\NppExec\test.txt"
    ;    * Parsed Line Number: 2
    ;    * Parsed Char Position: <none>
    ; }
    nppConvertToFullPathName()
    {
       [in]  "C:\NppExec\test.txt"
       ; already full path
    }
    

    And then following when one confirms/denies the Notepad++ dump creation before it closes:

    ; CNppExec::SaveOptions - start
    ; CNppExec::SaveOptions - end
    Log exit.
    

    Additionally, I now started Notepad++ from within a terminal (command line), to see what Wine reports executing it:

    • On start (with the NppExec console closed) (those "fixme" messages ususally have no effect, but show what's not yet implemented in Wine, I guess):
    username@pcname ~ $ wine '/home/username/.wine/dosdevices/c:/Program Files (x86)/Notepad++/notepad++.exe' 
    p11-kit: couldn't load module: /usr/lib/i386-linux-gnu/pkcs11/p11-kit-trust.so: /usr/lib/i386-linux-gnu/pkcs11/p11-kit-trust.so: cannot open shared object file: No such file or directory
    fixme:ver:GetCurrentPackageId (0x2d967c (nil)): stub
    fixme:win:LockWindowUpdate (0x10052), partial stub!
    fixme:win:LockWindowUpdate ((nil)), partial stub!
    fixme:msg:ChangeWindowMessageFilterEx 0x10052 4a 1 (nil)
    fixme:imm:ImmReleaseContext (0x100e0, 0xbb7380): stub
    
    • On opening the NppExec console:
    fixme:richedit:ME_HandleMessage EM_GETLANGOPTIONS: stub
    
    • When the issue occurs (double-clicking on the console line to open it in Notepad++):
    an/.wine/dosdevices/c:/Program Files (x86)/Notepad++/notepad++.exe: caret.c:231: ME_GetCursorCoordinates: Assertion `~para->member.para.nFlags & 0x01' failed.
    
    • And then there is the dump/backtrace (like the one attached to the above Wine bug) after one clicks through all the crash windows:
    wine: Unhandled page fault on read access to 0x00e2ab00 at address 0xe2ab00 (thread 0009), starting debugger...
    Unhandled exception: page fault on read access to 0x00e2ab00 in 32-bit code (0x00e2ab00).
    Register dump:
     CS:0023 SS:002b DS:002b ES:002b FS:0063 GS:006b
     EIP:00e2ab00 ESP:002dabbc EBP:002dabe8 EFLAGS:00010202(  R- --  I   - - - )
     EAX:00e2ab00 EBX:7ea85000 ECX:00000000 EDX:00000001
     ESI:002dacb8 EDI:00010052
    Stack dump:
    0x002dabbc:  7ea45d9a 00010052 000007f4 00000001
    0x002dabcc:  000301e6 7eac48c0 00000000 7e9b3745
    0x002dabdc:  7ea85000 002dacb8 00010052 002dac38
    0x002dabec:  7ea464d6 00e2ab00 00010052 000007f4
    0x002dabfc:  00000001 000301e6 7ea85000 002dac38
    0x002dac0c:  7ea33e80 00010052 00010052 7e9b39cd
    000c: sel=0067 base=00000000 limit=00000000 32-bit r-x
    Backtrace:
    =>0 0x00e2ab00 (0x002dabe8)
      1 0x7ea464d6 in user32 (+0xa64d5) (0x002dac38)
      2 0x7ea48c13 in user32 (+0xa8c12) (0x002dac88)
      3 0x7ea069bd in user32 (+0x669bc) (0x002dace8)
      4 0x7ea0e326 in user32 (+0x6e325) (0x002dad58)
      5 0x7ea0e599 SendMessageW+0x58() in user32 (0x002dada8)
      6 0x004b63ae in notepad++ (+0xb63ad) (0x002dadec)
      7 0x004d78ea in notepad++ (+0xd78e9) (0x0032fe14)
      8 0x004e34a9 in notepad++ (+0xe34a8) (0x0032fe60)
      9 0x7b861e8c call_process_entry+0xb() in kernel32 (0x0032fe78)
      10 0x7b862f63 in kernel32 (+0x52f62) (0x0032feb8)
      11 0x7bc84470 call_thread_func_wrapper+0xb() in ntdll (0x0032fed8)
      12 0x7bc8763d call_thread_func+0x7c() in ntdll (0x0032ffa8)
      13 0x7bc8444e RtlRaiseException+0x21() in ntdll (0x0032ffc8)
      14 0x7bc564ce call_dll_entry_point+0x3fd() in ntdll (0x0032ffe8)
      15 0xf755b61d wine_call_on_stack+0x1c() in libwine.so.1 (0x00000000)
      16 0xf755b6db wine_switch_to_stack+0x2a() in libwine.so.1 (0xffa054f8)
      17 0x7bc5c809 LdrInitializeThunk+0x238() in ntdll (0xffa05538)
      18 0x7b869853 __wine_kernel_init+0xa12() in kernel32 (0xffa06658)
      19 0x7bc5d733 __wine_process_init+0x192() in ntdll (0xffa066e8)
      20 0xf7558d80 wine_init+0x30f() in libwine.so.1 (0xffa06748)
      21 0x7bf0100c main+0xfb() in <wine-loader> (0xffa06b98)
      22 0xf737ca83 __libc_start_main+0xf2() in libc.so.6 (0x00000000)
    0x00e2ab00: addb    %al,0x0(%eax)
    Modules:
    Module  Address         Debug info  Name (95 modules)
    PE    400000-  61b000   Export          notepad++
    PE  10000000-10105000   Deferred        scilexer
    ELF 7b800000-7ba6a000   Dwarf           kernel32<elf>
      \-PE  7b810000-7ba6a000   \               kernel32
    ELF 7bc00000-7bcf3000   Dwarf           ntdll<elf>
      \-PE  7bc10000-7bcf3000   \               ntdll
    ELF 7bf00000-7bf04000   Dwarf           <wine-loader>
    ELF 7d057000-7d0c0000   Deferred        dbghelp<elf>
      \-PE  7d060000-7d0c0000   \               dbghelp
    ELF 7d53e000-7d55b000   Deferred        libgcc_s.so.1
    ELF 7d55b000-7d59f000   Deferred        usp10<elf>
      \-PE  7d560000-7d59f000   \               usp10
    ELF 7d61c000-7d630000   Deferred        psapi<elf>
      \-PE  7d620000-7d630000   \               psapi
    ELF 7d630000-7d776000   Deferred        oleaut32<elf>
      \-PE  7d650000-7d776000   \               oleaut32
    ELF 7d94d000-7d956000   Deferred        librt.so.1
    ELF 7d956000-7d95d000   Deferred        libffi.so.6
    ELF 7d95d000-7d975000   Deferred        libresolv.so.2
    ELF 7d975000-7d9c0000   Deferred        libdbus-1.so.3
    ELF 7d9c0000-7d9fc000   Deferred        libp11-kit.so.0
    ELF 7d9fc000-7da10000   Deferred        libtasn1.so.6
    ELF 7da10000-7da97000   Deferred        libgcrypt.so.11
    ELF 7da97000-7daa3000   Deferred        libkrb5support.so.0
    ELF 7daa3000-7dad3000   Deferred        libk5crypto.so.3
    ELF 7dad3000-7db91000   Deferred        libkrb5.so.3
    ELF 7db91000-7dba3000   Deferred        libavahi-client.so.3
    ELF 7dba3000-7dc69000   Deferred        libgnutls.so.26
    ELF 7dc69000-7dcaf000   Deferred        libgssapi_krb5.so.2
    ELF 7dcaf000-7dd1c000   Deferred        libcups.so.2
    ELF 7dd27000-7dd3b000   Deferred        msimg32<elf>
      \-PE  7dd30000-7dd3b000   \               msimg32
    ELF 7dd3b000-7dd74000   Deferred        uxtheme<elf>
      \-PE  7dd40000-7dd74000   \               uxtheme
    ELF 7dd74000-7dd7a000   Deferred        libxfixes.so.3
    ELF 7dd7a000-7dd85000   Deferred        libxcursor.so.1
    ELF 7dd85000-7dd95000   Deferred        libxi.so.6
    ELF 7dd95000-7dd99000   Deferred        libxcomposite.so.1
    ELF 7dd99000-7dda4000   Deferred        libxrandr.so.2
    ELF 7dda4000-7ddaf000   Deferred        libxrender.so.1
    ELF 7ddaf000-7ddb5000   Deferred        libxxf86vm.so.1
    ELF 7ddb5000-7ddb9000   Deferred        libxinerama.so.1
    ELF 7ddb9000-7ddc0000   Deferred        libxdmcp.so.6
    ELF 7ddc0000-7ddc4000   Deferred        libxau.so.6
    ELF 7ddc4000-7dde6000   Deferred        libxcb.so.1
    ELF 7dde6000-7df1a000   Deferred        libx11.so.6
    ELF 7df1a000-7df2d000   Deferred        libxext.so.6
    ELF 7df2e000-7df33000   Deferred        libgpg-error.so.0
    ELF 7df33000-7df37000   Deferred        libkeyutils.so.1
    ELF 7df37000-7df3c000   Deferred        libcom_err.so.2
    ELF 7df3c000-7df4a000   Deferred        libavahi-common.so.3
    ELF 7df4c000-7dfe0000   Deferred        winex11<elf>
      \-PE  7df60000-7dfe0000   \               winex11
    ELF 7dfe0000-7e005000   Deferred        imm32<elf>
      \-PE  7dff0000-7e005000   \               imm32
    ELF 7e081000-7e0aa000   Deferred        libexpat.so.1
    ELF 7e0aa000-7e0e5000   Deferred        libfontconfig.so.1
    ELF 7e0e5000-7e10d000   Deferred        libpng12.so.0
    ELF 7e10d000-7e127000   Deferred        libz.so.1
    ELF 7e127000-7e1c7000   Deferred        libfreetype.so.6
    ELF 7e1c7000-7e1e9000   Deferred        libtinfo.so.5
    ELF 7e1e9000-7e20e000   Deferred        libncurses.so.5
    ELF 7e22d000-7e2b2000   Deferred        rpcrt4<elf>
      \-PE  7e240000-7e2b2000   \               rpcrt4
    ELF 7e2b2000-7e3f7000   Deferred        ole32<elf>
      \-PE  7e2d0000-7e3f7000   \               ole32
    ELF 7e3f7000-7e43a000   Deferred        winspool<elf>
      \-PE  7e400000-7e43a000   \               winspool
    ELF 7e43a000-7e52a000   Deferred        comdlg32<elf>
      \-PE  7e440000-7e52a000   \               comdlg32
    ELF 7e52a000-7e778000   Deferred        shell32<elf>
      \-PE  7e540000-7e778000   \               shell32
    ELF 7e778000-7e7f3000   Deferred        shlwapi<elf>
      \-PE  7e790000-7e7f3000   \               shlwapi
    ELF 7e7f3000-7e86f000   Deferred        advapi32<elf>
      \-PE  7e800000-7e86f000   \               advapi32
    ELF 7e86f000-7e990000   Deferred        gdi32<elf>
      \-PE  7e880000-7e990000   \               gdi32
    ELF 7e990000-7eaed000   Dwarf           user32<elf>
      \-PE  7e9a0000-7eaed000   \               user32
    ELF 7eaed000-7ebf9000   Deferred        comctl32<elf>
      \-PE  7eaf0000-7ebf9000   \               comctl32
    ELF 7ef69000-7ef76000   Deferred        libnss_files.so.2
    ELF 7ef76000-7ef82000   Deferred        libnss_nis.so.2
    ELF 7ef82000-7ef9b000   Deferred        libnsl.so.1
    ELF 7ef9b000-7efe1000   Deferred        libm.so.6
    ELF 7efe6000-7f000000   Deferred        version<elf>
      \-PE  7eff0000-7f000000   \               version
    ELF f7363000-f7511000   Dwarf           libc.so.6
    ELF f7511000-f7516000   Deferred        libdl.so.2
    ELF f7517000-f7533000   Deferred        libpthread.so.0
    ELF f7537000-f7540000   Deferred        libnss_compat.so.2
    ELF f7552000-f7708000   Dwarf           libwine.so.1
    ELF f770a000-f772c000   Deferred        ld-linux.so.2
    ELF f772c000-f772d000   Deferred        [vdso].so
    Threads:
    process  tid      prio (all id:s are in hex)
    00000008 (D) C:\Program Files (x86)\Notepad++\notepad++.exe
        00000027    0
        00000026    0
        00000009    0 <==
    0000000e services.exe
        0000001e    0
        0000001d    0
        00000014    0
        00000010    0
        0000000f    0
    00000012 winedevice.exe
        0000001c    0
        00000019    0
        00000018    0
        00000013    0
    0000001a plugplay.exe
        00000020    0
        0000001f    0
        0000001b    0
    00000021 explorer.exe
        00000025    0
        00000024    0
        00000023    0
        00000022    0
    System information:
        Wine build: wine-1.8
        Platform: i386 (WOW64)
        Version: Windows 7
        Host system: Linux
        Host version: 3.13.0-37-generic
    

    Please note the bold point with the assertion failure above. It seems to be related to the issue.

    Please let me know if you need more details. Thanks!

    P.S.: Attaching a screenshot of the crash (without "npe_debug 1"). As can be seen, the "test.txt" gets opened on the line 2 correctly, after which the crash occurs. (The content of "output.txt" with its "whatever" on line 2 doesn't correspond to "test.txt", but it shouldn't matter - both were created manually for the test.)

     

    Last edit: MM 2016-04-22
  • DV

    DV - 2016-04-22

    This seems to come from Wine (at least, it's definitely not a part of NppExec or Notepad++):

    caret.c:231: ME_GetCursorCoordinates: Assertion `~para->member.para.nFlags & 0x01' failed.
    

    Why it could happen, I don't know.
    NppExec processes EN_MSGFILTER notification from RichEdit, and what it does for WM_LBUTTONDBLCLK is:
    1. opens a file in Scintilla (NPPM_DOOPEN)
    2. sets line and pos in Scintilla (SCI_GOTOLINE, SCI_GOTOPOS)
    3. sets focus to Scintilla via SetFocus()
    4. sets MSGFILTER.msg to 0 and returns 0
    Maybe the assertion fails because the focus goes from the RichEdit to Scintilla while processing EN_MSGFILTER from the RichEdit? It would be strange...
    Is there a way to debug NppExec under Wine? (I mean, are you aware if it is possible, and could you do it on your side? Because I don't have any Linux or Unix and know very little about it.)

     
    • MM

      MM - 2016-04-22

      Thank you very much for the feedback!

      Maybe the assertion fails because the focus goes from the RichEdit to Scintilla while processing EN_MSGFILTER from the RichEdit? It would be strange...

      I don't know anything about that. But I checked in the Wine sources and the assertion seems to be within Wine's RichEdit implementation, in https://github.com/wine-mirror/wine/blob/wine-1.8/dlls/riched20/caret.c#L231 , which is called in the same file in https://github.com/wine-mirror/wine/blob/wine-1.8/dlls/riched20/caret.c#L277 . While the flag it asserts against is defined in https://github.com/wine-mirror/wine/blob/wine-1.8/dlls/riched20/editstr.h#L143 as follows:

      /* this paragraph was already wrapped and hasn't changed, every change resets that flag */
      #define MEPF_REWRAP   0x01
      

      Does that ring a bell by any chance?

      On a side note, I tested and the issue occurs on the latest (unstable-branch) Wine 1.9.8 as well. That part didn't change ( https://github.com/wine-mirror/wine/blob/wine-1.9.8/dlls/riched20/caret.c#L230 ).

      Is there a way to debug NppExec under Wine? (I mean, are you aware if it is possible, and could you do it on your side? Because I don't have any Linux or Unix and know very little about it.)

      I don't know much about it either, actually. But there is, e.g., https://www.winehq.org/docs/winedev-guide/wine-debugger#AEN307 , which, according to its own help, accepts a "reasonable subset of the commands that gdb accepts". And there is quite a lot of documentation on Wine debugging. I could try that. Could you please point me at the affected part of the NppExec code? (I hope it's DLL contains all the symbols. And I've never debugged a PC program, just some embedded stuff ages ago, so I'll see how it goes. :) )
      Update: Never mind, I forgot that you already provided the execution steps. I found that in ConsoleDlg::GoToLineIfWarningAnalyzerMatch() in /NppExec_053_src/NppExec/src/DlgConsole.cpp. I'll check that.

      Thanks!

       

      Last edit: MM 2016-04-22
  • MM

    MM - 2016-04-23

    1. I haven't been able to debug Notepad++ or NppExec properly. I guess I would need to compile them to contain debugger symbols (cross-compiling them on Linux for Windows). That would need time and may go above my head.

    I logged a sort of a Wine "trace" with the Wine debugger though, from around the time right before the NppExec console double-click till some time after the appearance of the exception notification. It's a lot of data though - a lot of things are traced. I'm attaching the file. The assertion failure line:

    an/.wine/dosdevices/c:/Program Files (x86)/Notepad++/notepad++.exe: caret.c:231: ME_GetCursorCoordinates: Assertion `~para->member.para.nFlags & 0x01' failed.
    

    can be found there. As well as the SetFocus() calls some time before it. Although, the calls don't tell me anything, since I have no experience with Windows programming. Maybe someone familiar with it can make sense of it though.

    2. On the other hand, Notepad++ has built-in modules which open a file in it in a similar way:

    • "Find in Files" results pane
    • "Function List"
    • "Document Map" (which can be clicked somewhere and the current document will be scrolled to the affected area)

    The latter two don't switch focus to the main Notepad++ pane though, I guess by design - e.g. the keyboard keys can be used to jump to functions beginning with the respective letter. All of those work fine in Wine as far as file opening is concerned (although the "Document Map" doesn't show the minified file content in itself - just a white background).

    So, maybe the file opening used in those could be re-used in a plugin like NppExec? E.g., for the "Find in Files" results it seems to be done in Finder::GotoFoundLine() in https://github.com/notepad-plus-plus/notepad-plus-plus/blob/v6.9.1/PowerEditor/src/ScitillaComponent/FindReplaceDlg.cpp#L442 . That seems to also take care of wrapping problems (according to its comment in https://github.com/notepad-plus-plus/notepad-plus-plus/blob/v6.9.1/PowerEditor/src/ScitillaComponent/FindReplaceDlg.cpp#L193 ), which could be what the Wine exception is about (see the MEPF_REWRAP definition in my previous post).

     

    Last edit: MM 2016-04-23
    • MM

      MM - 2016-04-23

      P.S.: It looks like the "Document Map" was a bad example. It does show the minified file content in it, but it seems to be done after some trigger (tab switching works) instead of right on opening the "Document Map". But then the orange "current position" band disappears and its pane works just like a text pane, without the ability to switch file position by clicking on it. Anyway, it's a different topic and I've never used it.

      The "Find in Files" results pane works without problems though. I use it quite often. The search is just slow under Wine, compared to native tools. Which is exactly why I wanted to use NppExec: To use the native "grep" command line tool (ca. 10 times faster) for search, and process its output with NppExec, like one does, e.g., with a compiler output.

       

      Last edit: MM 2016-04-23
  • MM

    MM - 2016-04-24

    To the two points in my post above:

    To 1:

    I logged a sort of a Wine "trace" with the Wine debugger though, from around the time right before the NppExec console double-click till some time after the appearance of the exception notification. It's a lot of data though - a lot of things are traced. I'm attaching the file. The assertion failure line:

    an/.wine/dosdevices/c:/Program Files (x86)/Notepad++/notepad++.exe: caret.c:231: ME_GetCursorCoordinates: Assertion `~para->member.para.nFlags & 0x01' failed.
    

    can be found there. As well as the SetFocus() calls some time before it. Although, the calls don't tell me anything, since I have no experience with Windows programming. Maybe someone familiar with it can make sense of it though.

    I'm attaching another Wine trace log. While the previous one was created (using a pipe) with:

    WINEDEBUG=+relay,+snoop wine notepad++.exe
    

    this one logs all debug channels (i.e. including Richedit, etc.) as follows:

    WINEDEBUG=+all wine notepad++.exe
    

    To 2:
    This point is probably moot, because the failure seems to be due to a wrapping issue in Richedit, not in Scintilla.

     

    Last edit: MM 2016-04-24
  • DV

    DV - 2016-04-24

    Sorry for being non-replying, I'm in the process of migrating to a new hardware. I think I'll provide a debug version of NppExec for these experiments - maybe it will help to identify the exact call stack that corresponds to the issue. The Wine logs show a lot of WinAPI calls, but I don't understand what is the connection between these WinAPI calls and the code within NppExec.

     
  • DV

    DV - 2016-04-25

    Please find the debug version of NppExec attached.

     
  • MM

    MM - 2016-04-26

    No problem at all as far as reply time is concerned and thank you very much for the debug version!

    I've been able to log the exception stack trace containing the symbols (and affected file and line numbers) of both, Wine and NppExec (stack frames 14 and 30). Please find it attached. (Wine's files and line numbers refer to the current Wine 1.9.8 release.) Please let me know if you need more details.

    I other news, I've been pointed out a work-around in the above Wine bug report: There is a script called Winetricks, which can be used to replace Wine's implementation of Windows DLLs with original ones by Microsoft. So that, when that is done for RichEdit ("riched20"), the issue disappears.

    So, I don't know. Given the workaround, I would say that, if there could be a change to NppExec, which would fix this issue while improving NppExec's overall stability (also on Windows), then feel free to make it and I would be glad to test it. Otherwise, if the fix would be a "hack" you woudn't be happy about, then I could go with the workaround instead. (And wait for it to be fixed in Wine maybe.)

    Thanks!

     

    Last edit: MM 2016-04-26
  • DV

    DV - 2016-04-29

    Let's try whether the attached version has this problem.

     

    Last edit: DV 2016-04-29
  • MM

    MM - 2016-04-30

    Thanks for the test version!

    Yes, it still has. Although NppExec no longer appears in the stack trace. Please find it attached.

     
  • DV

    DV - 2016-05-05

    Hmm, it looks like the issue is related to RichEdit itself and not to NppExec then. Other plugins or the "Find In Files" results pane differ from NppExec by simply by that fact they do not use a RichEdit control. (NppExec includes a lot of code around RichEdit control that is a part of its Console window. Basically all the Console's window output and input is controlled by deep interaction with RichEdit control. I was weighing if it would be worth to try to replace RichEdit control in the Console window with Scintilla... but it will require a lot of changes - and I'm also not sure I would get the same level of control over Scintilla as I have with RichEdit. So I wouldn't consider such change.) I'm not sure if there can be any other "hacks" to do...

     
    • MM

      MM - 2016-05-06

      Thank you very much for the analysis and all the feedback. I would say that such a change (or search for other "hacks") for the sake of Wine is not worth it. Especially because there is an easy workaround available. We've been able to localize the issue in the Wine's RichEdit implementation - that has been a great support by you already!

      Thank you again for all that and for your work on the NppExec plugin! I truelly appreciate it and consider this thread closed.

       

Log in to post a comment.