bugGNU Octave - Bugs: bug #59237, Crash when pasting 64 commands

 
 

bug #59237: Crash when pasting 64 commands

Submitted by:  T Knauss <tknauss>
Submitted on:  Thu 08 Oct 2020 09:16:19 PM UTC  
 
Category:  GUI Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Unexpected Error or Warning
Status:  None Assigned to:  None
Originator Name:  Open/Closed:  Open
Release:  5.2.0 Operating System:  Microsoft Windows

Add a New Comment (Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

( Jump to the original submission)

Sun 18 Oct 2020 08:08:10 PM UTC, comment #11: 

I can confirm the behavior on Linux. Changing the buffer size of the GUI terminal does not have significant influence.

I tend to chose the "Won't" fix option since the terminal of the GUI should be replaced by a platform independent solution on the long run

Torsten Lilge <ttl>
Project Member
Sat 17 Oct 2020 05:42:33 PM UTC, comment #10: 

All of this is a stress test on Octave 7.0.0 on Linux. It is not representative of a normal user's behavior.

How to do the test:
1. Save attached file folsd.m and open in a text editor.

2. Copy whatever number of lines you are comfortable with copying, and paste them at Octave's command prompt. For CLI invoked from the terminal, I tested Ctrl-Shift-V and also right-click + Paste. For the GUI I tested right-click + Paste.

3. Plot the vector "a", which will indicate time performance.

4. For calibration, also invoke the file folsd.m as a script from the Octave prompt to see how long it takes.

Results:

For the CLI, there is absolutely no problem pasting all 10000 lines. It takes less than a second to paste everything and the time behavior is very much linear.

For the GUI, I can paste up to approximately 511 to 530 lines. That takes about 3 seconds on my machine, and there are a couple of time skips as shown (Figure attached). This is repeatable behavior.

Pasting more than about 530 lines in the GUI simply doesn't work for me. It doesn't crash but it completely stops responding. The number of lines that can be pasted in the GUI is reduced by a lot if the lines are longer.

No doubt there is some internal limit to how much can be copy-pasted at the GUI prompt, and it is much lower and much slower than the CLI's limits. BUT this is easily worked around by saving everything as a script file and executing that. Even with the GUI that takes less than a second.

Close this bug as Won't Fix because of an easy workaround?

(file #50001,

Anonymous
Sat 10 Oct 2020 06:39:33 PM UTC, comment #9: 

The slow performance while pasting things into the GUI window is the core problem. It gets escalated to a crash when external packages like SymPy are also being called during that time. A 35-minute response time is as bad as it becoming frozen and unresponsive.

Attached two files safeToPaste.txt (16 lines of data) and unsafeToPaste.txt (17 lines). Pasting 16 lines of content or fewer in the GUI works without any surprises. Pasting more than 16 lines causes a freeze on Linux for version 7.0, and a long wait on Windows for version 5.2.

Workarounds to this problem: avoid pasting more than 16 lines into the GUI until the problem is resolved. Either save as a .m script and call that, or use the CLI to paste things.

(file #49960, file #49961)

Anonymous
Fri 09 Oct 2020 08:52:51 PM UTC, comment #8: 

The pasting in the CLI completed after about 35 minutes. Size of the array is 28x256.
It looks like the time for pasting a line is related to the number of lines left. This would explain why it continuously becomes faster. The last lines took approx 16, 10, 4 and 2 sec.

But as there is no permanent freezing and no crash, it's not related to my problem.

T Knauss <tknauss>
Fri 09 Oct 2020 08:28:51 PM UTC, comment #7: 

confirmation revoked!
It just seems to freeze. After about some minutes the first line appears in the command window (exact time unknown in GUI, no interest to repeat the test, 2.5 min in CLI). It's just really slow, but it finally works. And it definitely becomes continuously faster towards the end.
My CPU is Intel i7-8550U.

T Knauss <tknauss>
Fri 09 Oct 2020 08:11:30 PM UTC, comment #6: 

confirmed.
GUI freezed. CPU load 12.5% (=100% on one CPU core) @ conhost.exe (sub-process of octave-gui.exe).

But this seems to be a different problem though, it does not crash the GUI.

T Knauss <tknauss>
Fri 09 Oct 2020 07:35:33 PM UTC, comment #5: 

File didn't attach. Here it is. Trying again.

(file #49956)

Anonymous
Fri 09 Oct 2020 07:33:15 PM UTC, comment #4: 

1. Bug is specific to copy-pasting into GUI window, not on CLI and not when scripted.

2. Bug is seen by OP on Windows. Unable to see that specific bug in Linux.

3. Related pasting-related bug can be seen on GUI in Linux. Open the attached file (foo.txt) in a text editor and paste the contents in Octave GUI. It basically freezes with long lines. (Linux)

Anonymous
Fri 09 Oct 2020 02:11:40 PM UTC, comment #3: 

I just tried pasting into the CLI instead of the GUI, and I was NOT able to reproduce it there. Seems like this is indeed related to the GUI. Maybe a timing issue when invoking methods.

To answer your the questions:
1. No, it does not crash when invoked from a script.
2. I don't want to do experiments with my business computer. It works when I paste in blocks of 16, which is acceptable for me. Therefore I will not test with different versions of Python.

During further tests, I found more "bugs":
When pasting the 7 "preparation" lines multiple times, Octave at the 2nd pasting either
- works as expected without errors
- crashes without notice, no errors in diary
- shows error messages like: (empty lines removed by me)
(...)

>> syms alpha m_x m_y s_x s_y x y

error: if: undefined value used in conditional expression
(...)

>> TR = [[cos(alpha) -sin(alpha) 0]; [sin(alpha) cos(alpha) 0]; [0 0 1]]

TR = (sym 3x3 matrix)
  [cos(alpha)  -sin(alpha)  0]
  [                          ]
  [sin(alpha)  cos(alpha)   0]
  [                          ]
  [    0            0       1]

>> error: parse error

error: called from
    size at line 132 column 5
    ismember at line 125 column 5
    syms at line 102 column 5

>>


(...)

>> syms alpha m_x m_y s_x s_y x y

error: 'valid_sym_assumptions' undefined near line 82 column 9
error: called from
    size at line 84 column 3
    syms
(...)

>>


And I noticed that the calculation becomes really slow after many crashes. But no high CPU usage in Process Explorer.

T Knauss <tknauss>
Fri 09 Oct 2020 12:06:38 PM UTC, comment #2: 

Today I found that there is a command "diary on". I indeed actively searched for some logging functionality, because I noticed that there was an error message just before the Octave window disappeared.

Here's the relevant part of the log:

(... other output ...)

>> T_S=TS

T_S = (sym 3x3 matrix)

  [s_x   0   0]
  [           ]
  [ 0   s_y  0]
  [           ]
  [ 0    0   1]

>> T_SM=TM*TS

error: called from
    _makeinfo_ at line 141 column 22
    print_usage>get_usage_texinfo at line 131 column 20
    print_usage at line 61 column 30
    size at line 62 column 15
    compare_versions at line 137 column 25
    python_ipc_driver at line 36 column 5
    pycall_sympy__ at line 163 column 11
    mtimes at line 63 column 5
error: 'python_ipc_popen2' undefined near line 62 column 17

>> T_SMO=TO*TM*TS

error: called from
    print_usage at line 61 column 30
    size at line 62 column 15
    compare_versions at line 137 column 25
    python_ipc_driver at line 36 column 5
    pycall_sympy__ at line 163 column 11
    mtimes at line 63 column 5
error: 'TO' undefined near line 1 column 7

>> T_SMOR=TR*TO*TM*TS

error: called from
    print_usage at line 61 column 30
    size at line 62 column 15
    compare_versions at line 137 column 25
    python_ipc_driver at line 36 column 5
    pycall_sympy__ at line 163 column 11
    mtimes at line 63 column 5
error: 'TR' undefined near line 1 column 8

>> T_SMR=TR*TM*TS

error: called from
    print_usage at line 61 column 30
    size at line 62 column 15
    compare_versions at line 137 column 25
    python_ipc_driver at line 36 column 5
    pycall_sympy__ at line 163 column 11
    mtimes at line 63 column 5
error: 'TR' undefined near line 1 column 7

(... other output ...)

T Knauss <tknauss>
Fri 09 Oct 2020 01:57:11 AM UTC, comment #1: 

Two questions:

1. If all your commands are saved in a script and then invoked, does it still crash, or does it crash only when pasting?

2. Python 3.9.0 is extremely new. Does this crash happen with the more tested 3.8.xx?

Anonymous
Thu 08 Oct 2020 09:16:19 PM UTC, original submission:  

I am using "symbolic" package 2.9.0 and I have installed python 3.9 with sympy 1.5.1 (sympy 1.6.2 fails to work) on Win 10 Enterprise 1809 x64.

The commands to execute before pasting:

pkg load symbolic
setenv PYTHON python
syms alpha m_x m_y s_x s_y x y
TM = [[1 m_x 0]; [m_y 1 0]; [0 0 1]]
TO = [[1 0 x]; [0 1 y]; [0 0 1]]
TS = [[s_x 0 0]; [0 s_y 0]; [0 0 1]]
TR = [[cos(alpha) -sin(alpha) 0]; [sin(alpha) cos(alpha) 0]; [0 0 1]]

The commands to paste (all 64 lines at once):
T_M=TM
T_MO=TO*TM
T_MOR=TR*TO*TM
T_MORS=TS*TR*TO*TM
T_MOS=TS*TO*TM
T_MOSR=TR*TS*TO*TM
T_MR=TR*TM
T_MRO=TO*TR*TM
T_MROS=TS*TO*TR*TM
T_MRS=TS*TR*TM
T_MRSO=TO*TS*TR*TM
T_MS=TS*TM
T_MSO=TO*TS*TM
T_MSOR=TR*TO*TS*TM
T_MSR=TR*TS*TM
T_MSRO=TO*TR*TS*TM
T_O=TO
T_OM=TM*TO
T_OMR=TR*TM*TO
T_OMRS=TS*TR*TM*TO
T_OMS=TS*TM*TO
T_OMSR=TR*TS*TM*TO
T_OR=TR*TO
T_ORM=TM*TR*TO
T_ORMS=TS*TM*TR*TO
T_ORS=TS*TR*TO
T_ORSM=TM*TS*TR*TO
T_OS=TS*TO
T_OSM=TM*TS*TO
T_OSMR=TR*TM*TS*TO
T_OSR=TR*TS*TO
T_OSRM=TM*TR*TS*TO
T_R=TR
T_RM=TM*TR
T_RMO=TO*TM*TR
T_RMOS=TS*TO*TM*TR
T_RMS=TS*TM*TR
T_RMSO=TO*TS*TM*TR
T_RO=TO*TR
T_ROM=TM*TO*TR
T_ROMS=TS*TM*TO*TR
T_ROS=TS*TO*TR
T_ROSM=TM*TS*TO*TR
T_RS=TS*TR
T_RSM=TM*TS*TR
T_RSMO=TO*TM*TS*TR
T_RSO=TO*TS*TR
T_RSOM=TM*TO*TS*TR
T_S=TS
T_SM=TM*TS
T_SMO=TO*TM*TS
T_SMOR=TR*TO*TM*TS
T_SMR=TR*TM*TS
T_SMRO=TO*TR*TM*TS
T_SO=TO*TS
T_SOM=TM*TO*TS
T_SOMR=TR*TM*TO*TS
T_SOR=TR*TO*TS
T_SORM=TM*TR*TO*TS
T_SR=TR*TS
T_SRM=TM*TR*TS
T_SRMO=TO*TM*TR*TS
T_SRO=TO*TR*TS
T_SROM=TM*TO*TR*TS

It crashes somewhere between T_RO and T_RS: Octave just quits without notice.

T Knauss <tknauss>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #50001:  folsd.m added by None (223KiB - text/x-objcsrc)
file #50002:  copy-paste-performance.png added by None (88KiB - image/png)
file #49960:  safeToPaste.txt added by None (23KiB - text/plain)
file #49961:  unsafeToPaste.txt added by None (25KiB - text/plain)
file #49956:  foo.txt added by None (41KiB - text/plain)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by ttl (Posted a comment)
  • -email is unavailable- added by tknauss (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

     

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-10-17 None Attached File- => Added folsd.m, #50001
        Attached File- => Added copy-paste-performance.png, #50002
    2020-10-10 None Attached File- => Added safeToPaste.txt, #49960
        Attached File- => Added unsafeToPaste.txt, #49961
    2020-10-09 None Attached File- => Added foo.txt, #49956

    Back to the top


    Powered by Savane 3.5