bugGNU Screen - Bugs: bug #66614, screen 5.0.0 display garbled code...

 
 

bug #66614: screen 5.0.0 display garbled code under defencoding GBK

Submitter:  zixijian <zixijian>
Submitted:  Sun 29 Dec 2024 07:57:17 AM UTC
   
 
Category:  encoding Severity:  3 - Normal
Priority:  * 5 - Normal Status:  Need Investigation
Privacy:  Public Assigned to:  None
Open/Closed:  Open Release:  None
Fixed Release:  None Planned Release:  None
Work Required:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Tue 04 Feb 2025 06:58:04 AM UTC, comment #13: 
zixijian <zixijian>
Thu 23 Jan 2025 01:41:59 AM UTC, comment #12: 

I build the newest screen-v5 branch.Then debug with valgrind.

Use "echo" output any Chinese are displayed "NEWS os.h TODO", this should be the name of the three source files, directly input any Chinese execution, Outputs the file name of the NEWS.

Here is test result(???? is 中文):

12tp:~/screen/src# valgrind ./screen

12tp:~/screen/src# echo ????                                                                     NEWS os.h TODO
12tp:~/screen/src# ????                                                                          NEWS: command not found

[screen is terminating]
==23034==
==23034== HEAP SUMMARY:
==23034==     in use at exit: 64,932 bytes in 579 blocks
==23034==   total heap usage: 1,871 allocs, 1,292 frees, 653,474 bytes allocated
==23034==
==23034== LEAK SUMMARY:
==23034==    definitely lost: 8 bytes in 2 blocks
==23034==    indirectly lost: 0 bytes in 0 blocks
==23034==      possibly lost: 406 bytes in 6 blocks
==23034==    still reachable: 64,518 bytes in 571 blocks
==23034==         suppressed: 0 bytes in 0 blocks
==23034== Rerun with --leak-check=full to see details of leaked memory
==23034==
==23034== For lists of detected and suppressed errors, rerun with: -s
==23034== ERROR SUMMARY: 276 errors from 6 contexts (suppressed: 0 from 0)
==23033==
==23033== HEAP SUMMARY:
==23033==     in use at exit: 261 bytes in 15 blocks
==23033==   total heap usage: 61 allocs, 46 frees, 21,803 bytes allocated
==23033==
==23033== LEAK SUMMARY:
==23033==    definitely lost: 0 bytes in 0 blocks
==23033==    indirectly lost: 0 bytes in 0 blocks                                                ==23033==      possibly lost: 0 bytes in 0 blocks
==23033==    still reachable: 261 bytes in 15 blocks
==23033==         suppressed: 0 bytes in 0 blocks
==23033== Rerun with --leak-check=full to see details of leaked memory
==23033==
==23033== For lists of detected and suppressed errors, rerun with: -s
==23033== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)

zixijian <zixijian>
Wed 22 Jan 2025 09:15:52 PM UTC, comment #11: 


comment #10:

> I think V.5.0.0 is a completely different branch from v.4.9.1.


Yes, it is.

It would be nice if you can find the point where there is no problem with encoding you're using. It will help to understand why this encoding is broken now.

comment #10:

> It is inappropriate to rush to release and destroy the long-term usage.

Agree. That's exactly the point why I always asking for help to test the coming version two or three weeks before the release ;-)

Alexander Naumov <anaumov>
Group administrator
Mon 20 Jan 2025 04:52:55 AM UTC, comment #10: 

I tried to parse the origin/screen-v5 branch using dichotomy and compile each commit until Aug 2023,still could not support GBK encoding.
I think V.5.0.0 is a completely different branch from v.4.9.1. It is inappropriate to rush to release and destroy the long-term usage.

zixijian <zixijian>
Fri 17 Jan 2025 12:56:30 PM UTC, comment #9: 

I see that the GBK encoding must use the encoding table to convert to utf-8. Does this have anything to do with garbled?

zixijian <zixijian>
Tue 07 Jan 2025 03:06:06 AM UTC, comment #8: 

comment #7:

> As I said, screen-v4 and screen-v5 were already separate branches when the fixes were done in screen-v4. If the branches have not diverged too much in 10 years (!), the fixes could be applied to screen-v5 by cherry-picking.


Oh,I'm very sorry. I made a mistake in the order of comparison.

zixijian <zixijian>
Tue 07 Jan 2025 02:17:23 AM UTC, comment #7: 

commentaire #6 :

> I don't think this is a normal situation:http & https changing and changing again,add a space or change a letter.
>
> Maybe it's more important to figure out why this happens first.


As I said, screen-v4 and screen-v5 were already separate branches when the fixes were done in screen-v4. If the branches have not diverged too much in 10 years (!), the fixes could be applied to screen-v5 by cherry-picking.

For instance, the following one

> -SOCKDIR. Personally, I favour a user's home directory and recommend the the
> +SOCKDIR. Personally, I favour a users home directory and recommend the the(There's an extra space here)


(the first line being in the fixed screen-v4 and the second line being in the unfixed screen-v5) was fixed in

commit c5d53d69c08eeb69416af5bef8408d121f6c47ba
Author: René Genz <liebundartig@freenet.de>
Date:   2022-01-28 14:47:09 +0100

    [PATCH] fix typing errors

for screen-v4.

Vincent Lefèvre <vinc17>
Tue 07 Jan 2025 01:16:53 AM UTC, comment #6: 


comment #5:

>
> comment #4:
> >
> > there was still some typo
> >
>
> In that case provide a patch please (git syntax, with PATH, etc.).


I don't think this is a normal situation:http & https changing and changing again,add a space or change a letter.

Maybe it's more important to figure out why this happens first.

-<https://www.gnu.org/licenses/why-not-lgpl.html>.
+<http://www.gnu.org/philosophy/why-not-lgpl.html>.

-SOCKDIR. Personally, I favour a user's home directory and recommend the the
+SOCKDIR. Personally, I favour a users home directory and recommend the the(There's an extra space here)

-# See machine dependent config.h for more configuration options.
+# See machine dependant config.h for more configuration options.



zixijian <zixijian>
Mon 06 Jan 2025 11:43:04 AM UTC, comment #5: 


comment #4:

>
> there was still some typo
>


In that case provide a patch please (git syntax, with PATH, etc.).

Alexander Naumov <anaumov>
Group administrator
Mon 06 Jan 2025 10:54:24 AM UTC, comment #4: 


comment #3:

> commentaire #2 :
> > when i use "git diff 8a4124d" to compare the version differences,I found lot typo or Spelling mistakes,Or is this not English?
>
> 8a4124d is v.4.9.1 / screen-v4, which is not an ancestor of screen-v5, which only has v.4.2.1 and below as ancestors.
>
> There were fixes done in screen-v4 since branching was done more than 10 years ago!
>
> But some typos have already been fixed in screen-v5. For instance, "lage scrollback" was fixed in commit 5f0e640acbd61f5393fcabb38aa34cfe11d23517 a few days ago.


Oh,I made the comparison in tag v.5.0.0.When I switched to the latest mainline there was still some typo shit.

The point is that I haven't found the reason for the encoding error yet. I'm not good at code.

zixijian <zixijian>
Mon 06 Jan 2025 10:12:15 AM UTC, comment #3: 

commentaire #2 :

> when i use "git diff 8a4124d" to compare the version differences,I found lot typo or Spelling mistakes,Or is this not English?


8a4124d is v.4.9.1 / screen-v4, which is not an ancestor of screen-v5, which only has v.4.2.1 and below as ancestors.

There were fixes done in screen-v4 since branching was done more than 10 years ago!

But some typos have already been fixed in screen-v5. For instance, "lage scrollback" was fixed in commit 5f0e640acbd61f5393fcabb38aa34cfe11d23517 a few days ago.

Vincent Lefèvre <vinc17>
Mon 06 Jan 2025 06:32:10 AM UTC, comment #2: 

when i use "git diff 8a4124d" to compare the version differences,I found lot typo or Spelling mistakes,Or is this not English?

I've just picked a few random ones here:

-# in my .cshrc I may use this for a wonderful tcsh-prompt:
+# in my .cshrc I may use this for a wonderfull tcsh-prompt:

-  get allocated. This is very useful if you have a large scrollback.
+  get allocated. This is very useful if you have a lage scrollback.

-* New terminal capabilitise CS/CE for cursorkey control.
+* New terminal capabiliteise CS/CE for cursorkey control.

-  either on screen or in another register.
+  either on screen or in anouther register.

-* new encoding: Chinese GBK
+* new encoding: chinese GBK

-    scrolling up text into the history buffer. (Wayne Davison)
+    scolling up text into the history buffer. (Wayne Davison)


zixijian <zixijian>
Fri 03 Jan 2025 09:36:56 AM UTC, comment #1: 

Problem description
I use screen to convert GBK encoding for tintin++,This was normal in the previous version,but exceptions in version 5.0.0.

What steps will reproduce the bug?
echo "defencoding GBK" > ~/.screenrc
screen bash
echo 中文测试

What is the expected behavior?
Unable to convert GBK encoding for tintin++.

The problem is reproducible on Desktop distributions too.(Tested by robertkirkman@github)

GNU/Linux Screen 5+ package tested: Gentoo's screen-9999

(incorrect symbols appear arbitrarily - varies depending on whether the command is populated via clipboard, or bash history)

~ $ screen --version
Screen version 5.0.0 (build on 2024-12-21 14:12:05)
~ $ uname -o
GNU/Linux
~ $ echo "defencoding GBK" > ~/.screenrc
~ $ screen bash
~ $ echo -KÕ
-KÕ
~ $ echo _ 4-/
_ 4-/

control: GNU/Linux Screen 4 package tested: Debian bookworm's screen 4.9.0-4

~ $ screen --version
Screen version 4.09.00 (GNU) 30-Jan-22
~ $ uname -o
GNU/Linux
~ $ echo "defencoding GBK" > ~/.screenrc
~ $ screen bash
~ $ echo 中文测试
中文测试
~ $ echo 中文测试
中文测试

zixijian <zixijian>
Sun 29 Dec 2024 07:57:17 AM UTC, original submission:  
zixijian <zixijian>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by vinc17 (Posted a comment)
  • -email is unavailable- added by anaumov (Updated the item)
  • -email is unavailable- added by zixijian (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2025-01-22 anaumov StatusNone Need Investigation
    2025-01-03 anaumov CategoryNone encoding

    Back to the top

    Powered by Savane 3.14-573e.
    Corresponding source code