Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Something wrong with the log #126

Closed
lishuhuakai opened this issue Jul 15, 2021 · 8 comments
Closed

Something wrong with the log #126

lishuhuakai opened this issue Jul 15, 2021 · 8 comments
Assignees
Labels
bug Something isn't working

Comments

@lishuhuakai
Copy link

shell had a very long print, just like:

   []               []                []    []         []        false         0                []                []        {}           {}          []         {}                    false       []                      []                      {}           []         false             []        []          {forwarding="true", port_aggregation_forwarding="true", port_loop_protection_forwarding="true"} {}              {}              0         [7-7]      []             []                    []          []                    false          []                     []   {}          {}              []                  []                  []                         {}                      {}                  []                []                 []  []                []           []                    []      bridge_normal {}                 []                 []             {}              []               []           {}             []              []            {}           []             []               []        []           []  {}                 {}         []           []            {}             []             []                  []          {}                []          []               []               []          []          []           []           {}             {}             []        {}              {}         {}     0       []        0         []   []            {}                  {}                  []          []       []                   []        {}           []       []                 []          []                 {}               []                  

and I set word wrap to false.
log:

[2021-07-15 11:24:10]     []               []                []    []         []        false         0                []                []        {}           {}          []         {}                    false 
[2021-07-15 11:24:10]       []                      []                      {}           []         false             []        []          {forwarding="true", port_aggregation_forwarding="true", port_loop_protecti
[2021-07-15 11:24:10] on_forwarding="true"} {}              {}              0         [7-7]      []             []                    []          []                    false          []                     []   {} 
[2021-07-15 11:24:10]          {}              []                  []                  []                         {}                      {}                  []                []                 []  []             
[2021-07-15 11:24:10]    []           []                    []      bridge_normal {}                 []                 []             {}              []               []           {}             []              []
[2021-07-15 11:24:10]             {}           []             []               []        []           []  {}                 {}         []           []            {}             []             []                  [
[2021-07-15 11:24:10] ]          {}                []          []               []               []          []          []           []           {}             {}             []        {}              {}         
[2021-07-15 11:24:10] {}     0       []        0         []   []            {}                  {}                  []          []       []                   []        {}           []       []                 []   
[2021-07-15 11:24:10]        []                 {}               []  

I think log should like this:

[2021-07-15 11:24:10]   []               []                []    []         []        false         0                []                []        {}           {}          []         {}                    false       []                      []                      {}           []         false             []        []          {forwarding="true", port_aggregation_forwarding="true", port_loop_protection_forwarding="true"} {}              {}              0         [7-7]      []             []                    []          []                    false          []                     []   {}          {}              []                  []                  []                         {}                      {}                  []                []                 []  []                []           []                    []      bridge_normal {}                 []                 []             {}              []               []           {}             []              []            {}           []             []               []        []           []  {}                 {}         []           []            {}             []             []                  []          {}                []          []               []               []          []          []           []           {}             {}             []        {}              {}         {}     0       []        0         []   []            {}                  {}                  []          []       []                   []        {}           []       []                 []          []                 {}               []  
@kingToolbox
Copy link
Owner

The log only records the received text truthfully without any format and content changes. So if the text displayed in WindTerm is like this, then the log will be recorded like this.

Although you set Word Wrap to false, this is just to set how WindTerm displays the text. The actual text wrapping is set by the server according to the number of window columns. For example, if you set the number of window columns to 80, the server will try to wrap text at the 80th column. So you can try to set the number of columns Session Property Dialog - Shell - Window - Columns to be large enough, such as 2000, to see if you can get the results you want.

@kingToolbox
Copy link
Owner

By the way, after setting Window Columns, you need to open a new session or reopen the session to take effect.

@lishuhuakai
Copy link
Author

I set columns to 2000, the log still wrap.
I found a bug, if you set the column or rows to a very large number(like 24000), and save it, next time, you try to open the session, Windterm will crash.

@kingToolbox
Copy link
Owner

What a surprise! Such bugs are difficult to find, because no one usually uses terminal like this.

Of course, the boundary conditions have been considered during development, so the maximum value of 65535 has been self-tested and passed. I also tested it again just now, set the number of columns to 25000 and 65535 respectively, and printed 100000 consecutive characters without Word Wrap, but no problems were found. So is there anything else I have overlooked? Also, is there a crash report generated? Thank you.

@lishuhuakai
Copy link
Author

lishuhuakai commented Jul 15, 2021

no dump file,
set columns to 20000
set rows to 24000
image
try again !
I tested it in 3 computers, everytime I open the session, windterm wil crash.

Microsoft Visual C++ Runtime Library
Runtime Error!

abnormal program termination.

@lishuhuakai
Copy link
Author

lishuhuakai commented Jul 15, 2021

  1. set columns to 20000
    image
  2. input a useless command that is long enough, and open log:
    image
  3. log looks like below:
    image
    as you can see, command being wraped.
  4. Securecrt donot have this problem, below is the log generated by securecrt.
    image
    xshell donot have this problem too !
    image

I think that not-wrapped-log is convenient for those who use log frequently.
In some cases like printing the database table, the log that windterm recorded is not easy to read.

@kingToolbox kingToolbox self-assigned this Jul 16, 2021
@kingToolbox kingToolbox added the bug Something isn't working label Jul 16, 2021
@kingToolbox
Copy link
Owner

Hello, WindTerm_2.1.0 has been released and this issue has been fixed, you can download and check it now, thank you.

For the first question, when setting the number of columns and rows of the windows to large numbers, WindTerm will crash because it cannot allocate enough memory. The memory required by the terminal window is pre-allocated, and the allocated size is columns * rows * 16 (a cell size). So for example, when setting columns to 20000 and rows to 24000, the required memory is as high as 20k * 24k * 16 = 7.68gb, obviously it will cause WindTerm to crash.

There are many ways to fix it. The best is to dynamically allocate memory based on the actual needs of the window. In addition, WindTerm can catch the std::bad_alloc exception, so that WindTerm does not crash when it cannot allocate memory. But these will reduce performance and increase runtime overhead. In actual use, almost no one sets such a large number, and a large number has almost no practical meaning. So the simplest and most effective way is to reduce the upper limit of the number of columns and rows. Now the upper limit of the number of columns is 9999 and the upper limit of the number of rows is 999.

For the second question, I totally agree with you, now the line text is no longer wrapped. Hope this will satisfy you.

@kingToolbox
Copy link
Owner

The issue should have been fixed in the new WindTerm_2.1.0. Please reopen this issue if it is still valid. Thank you.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants