chrisant996 / clink

Bash's powerful command line editing in cmd.exe
https://chrisant996.github.io/clink/
GNU General Public License v3.0
3.58k stars 141 forks source link

invalid charset name #246

Closed davehorner closed 2 years ago

davehorner commented 2 years ago

I see there's lot of new cool coloring. Thank you for all the work you're doing!

ConEmu 210912 [64] Clink v1.3.8.c918a0

I am trying to use bat to page clink's readme.md.

# bat.exe README.md
invalid charset name

C:\Users\dhorner\work\clink-1
# bat.exe README.md
invalid charset name

C:\Users\dhorner\work\clink-1
# bat

───────┬─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
       │ STDIN
───────┼─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
   1   │

   2   │
^C
C:\Users\dhorner\work\clink-1
# bat.exe README.md
invalid charset name

I'm not certain this has anything to do with clink. In case you're not familiar with bat; https://github.com/sharkdp/bat/issues/260 the above issue makes reference to invalid charset and also points to the bat repo.

If it's not clink, apologies and thanks again!

PS: I have seen times when using clink (last version Clink v1.3.4.cf2dfb) the prompt will display strange characters. This visual defect is another issue I can log if I can nail it down. the defect/cmd process will continue to work for some time but can also result in a clink crash. If it continues, I will let you know.

chrisant996 commented 2 years ago

ConEmu 210912 [64] Clink v1.3.8.c918a0

I am trying to use bat to page clink's readme.md.

# bat.exe README.md
invalid charset name
...
C:\Users\dhorner\work\clink-1
# bat.exe README.md
invalid charset name

I'm not certain this has anything to do with clink.

Some kind of issue in bat, or some program used by bat, or in the configuration of bat on the computer. Markdown files do not need to specify a charset, and README.md does not. Maybe whatever bat is using internally doesn't support UTF8. 🤷‍♂️

PS: I have seen times when using clink (last version Clink v1.3.4.cf2dfb) the prompt will display strange characters. This visual defect is another issue I can log if I can nail it down. the defect/cmd process will continue to work for some time but can also result in a clink crash. If it continues, I will let you know.

Thanks. Crash dumps are always welcome.

Also, a screen shot of "display strange characters" would be useful for gaining some sense of the visual issue. I don't know if you're seeing green Matrix symbols tumbling down the screen, or a letter in the wrong spot, or something in between. 😉 I also don't know what codepage you're using, what locale the computer is set for, what else is being displayed in the prompt, etc. There are many things that could all affect how stuff gets displayed.

davehorner commented 2 years ago

I'm sure I have dump files on one or two machines. Where do I find those again and where would you like them submitted? Close the ticket; sorry to bother you with it. It was worth a shot though! :)

chrisant996 commented 2 years ago

I'm sure I have dump files on one or two machines. Where do I find those again and where would you like them submitted? Close the ticket; sorry to bother you with it. It was worth a shot though! :)

Clink writes dumps as clink.cmp to the Clink profile directory. They should be around 40-50kb usually.

You can email them to the address in my github profile. Or you can attach them to an issue in this repo, if you don't mind sharing them publicly. Or put them in some cloud storage with a password and/or an expiration date. Or however you like; I'm not picky about how they reach me. 🙃

They are "mini" dumps, so there is only very minimal information -- callstacks, some file paths, and register values (numbers).

I looked at one on my computer, and it contains my user name (chrisant), my user profile directory (c:\users\chrisant\AppData\Local\clink), my Windows directory (c:\windows), and my current directory (c:\repos\clink). As you can see, I am very comfortable sharing those bits of information, especially since my name is already public information and the rest of those strings are very simple to deduce from my name. But I recognize different people have different experiences and data and comfort levels, so do whatever you feel comfortable with.

chrisant996 commented 2 years ago

Oh, and it appears README.md contains only ASCII text, even! So definitely something amiss on the bat end of things.

chrisant996 commented 2 years ago

Thanks for sending the crash dumps (via direct email).

The crashes are in ConEmuHk64 in both dumps. Clink is trying to print some text (the dump doesn't include heap, so there's no way to know what it's trying to print). ConEmu crashes while intercepting and handling the request to print the text.

These appear to be some problem in ConEmu, or something interfering with ConEmu.

Are you are able to reproduce the crash somewhat reliably? If you can narrow down how to trigger it, then it will be possible to use "Time Travel Debugging" and capture a trace of the execution leading up to the crash.

However, since the crash is inside ConEmu, and I can't find any published PDB symbols for ConEmu, it will likely be very difficult to debug ConEmu. It may be best to contact Maximus5, the author of ConEmu. I see a couple other reports of recent crashes in ConEmuHk64, but there is no way to tell whether they may be related (it's the "hook" DLL, and contains a lot of code, and without PDB symbols there's no way to tell what ConEmu is doing at the time).

The lack of PDB symbols for ConEmu also ruins the debugger's ability to figure out the callstack. You can use dps rsp L800 to reverse engineer a (very, very) rough sense of the callstack, but there is no way to tell which addresses are "current" versus leftover stale addresses that are now in unused portions of the stack. That reveals (once you point the debugger at the matching Clink symbols) that Clink is indeed trying to print some text, and ConEmuHk64 intercepted the call (that's normal, it's how ConEmu takes over rendering of the console content), but then ConEmu crashed somewhere inside that.

mini_dump.dmp

This one shows that the loaded Clink is v0.4.9, so it's from before you upgraded.

    Timestamp:        Wed Dec 20 14:03:15 2017 (5A3ADE23)
    CheckSum:         00000000
    ImageSize:        0008F000
    File version:     0.4.9.45822
    Product version:  0.4.9.45822
    File flags:       0 (Mask 0)
    File OS:          0 Unknown Base
    File type:        0.0 Unknown
    File date:        00000000.00000000

(In WinDbg, use lm to list modules, then click on the clink_dll_x64 link.)

clink.dmp

This one shows that the loaded Clink is v1.3.4:

    Timestamp:        Fri Jan 28 01:25:44 2022 (61F3B698)
    CheckSum:         00000000
    ImageSize:        001A5000
    File version:     1.3.4.0
    Product version:  1.3.4.0
    File flags:       0 (Mask 0)
    File OS:          0 Unknown Base
    File type:        0.0 Unknown
    File date:        00000000.00000000
    Translations:     0409.04b0
    Information from resource tables:
        CompanyName:      Martin Ridgers, Christopher Antos
        ProductName:      Clink
        ProductVersion:   1.3.4.cf2dfb
        FileDescription:  Clink