Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Spacebar Crashes CKAN #2562

Closed
7ranceaddic7 opened this issue Nov 1, 2018 · 9 comments
Closed

Spacebar Crashes CKAN #2562

7ranceaddic7 opened this issue Nov 1, 2018 · 9 comments

Comments

@7ranceaddic7
Copy link

7ranceaddic7 commented Nov 1, 2018

Background

CKAN Version:
1.25.3

KSP Version:
1.4.5

Operating System:
Linux Jupiter 4.18.0-11-generic # 12-Ubuntu SMP Tue Oct 23 19:22:37 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

Problem

CKAN crashes after hitting spacebar.

What steps did you take in CKAN?
Steps to Replicate:

  1. Launch CKAN.
  2. Highlight desired instance.
  3. Click 'Select' and put your hands on your head.
    1. (Seriously, put'em on your head.)

screenshot from 2018-11-01 15-37-38

  1. CKAN updates repositories and then displays MainWindow, as shown here:
    screenshot from 2018-11-01 15-29-20

  2. At this point, your hands should still be on your head. Don't touch your mouse. Don't click anything. Don't Arrow or Tab anywhere. ABSOLUTELY NOTHING.

  3. Now, you have permission to hit Spacebar.

  4. CTD. Don't profit.

What did you expect to happen?
tick state change on/off of highlighted (this will alway be first) mod listed

What happened instead?
CTD

System.InvalidOperationException: No editing control defined
  at System.Windows.Forms.DataGridViewCell.InitializeEditingControl (System.Int32 rowIndex, System.Object initialFormattedValue, System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle) [0x00015] in <50f22134ee3a4d3ab382d1d406dc2ad0>:0 
  at System.Windows.Forms.DataGridView.RefreshEdit () [0x0002f] in <50f22134ee3a4d3ab382d1d406dc2ad0>:0 
  at (wrapper remoting-invoke-with-check) System.Windows.Forms.DataGridView.RefreshEdit()
  at CKAN.GUIMod.SetInstallChecked (System.Windows.Forms.DataGridViewRow row, System.Nullable`1[T] set_value_to) [0x0006f] in <169e907a3d5d4e97b627ad74b10bb7f4>:0 
  at CKAN.Main._MarkModForInstall (System.String identifier, System.Boolean uninstall) [0x0004b] in <169e907a3d5d4e97b627ad74b10bb7f4>:0 
  at CKAN.Main+<>c__DisplayClass232_0.<MarkModForInstall>b__0 () [0x00000] in <169e907a3d5d4e97b627ad74b10bb7f4>:0 
  at CKAN.Util.Invoke[T] (T obj, System.Action action) [0x00026] in <169e907a3d5d4e97b627ad74b10bb7f4>:0 
  at CKAN.Main.MarkModForInstall (System.String identifier, System.Boolean uncheck) [0x0001b] in <169e907a3d5d4e97b627ad74b10bb7f4>:0 
  at CKAN.Main.ModList_KeyPress (System.Object sender, System.Windows.Forms.KeyPressEventArgs e) [0x00058] in <169e907a3d5d4e97b627ad74b10bb7f4>:0 
  at System.Windows.Forms.Control.OnKeyPress (System.Windows.Forms.KeyPressEventArgs e) [0x00019] in <50f22134ee3a4d3ab382d1d406dc2ad0>:0 
  at System.Windows.Forms.DataGridView.OnKeyPress (System.Windows.Forms.KeyPressEventArgs e) [0x00000] in <50f22134ee3a4d3ab382d1d406dc2ad0>:0 
  at System.Windows.Forms.Control.ProcessKeyEventArgs (System.Windows.Forms.Message& m) [0x000ac] in <50f22134ee3a4d3ab382d1d406dc2ad0>:0 
  at System.Windows.Forms.DataGridView.ProcessKeyEventArgs (System.Windows.Forms.Message& m) [0x00078] in <50f22134ee3a4d3ab382d1d406dc2ad0>:0 
  at System.Windows.Forms.Control.ProcessKeyMessage (System.Windows.Forms.Message& m) [0x00018] in <50f22134ee3a4d3ab382d1d406dc2ad0>:0 
  at System.Windows.Forms.Control.WmKeys (System.Windows.Forms.Message& m) [0x00000] in <50f22134ee3a4d3ab382d1d406dc2ad0>:0 
  at System.Windows.Forms.Control.WndProc (System.Windows.Forms.Message& m) [0x00244] in <50f22134ee3a4d3ab382d1d406dc2ad0>:0 
  at System.Windows.Forms.DataGridView.WndProc (System.Windows.Forms.Message& m) [0x00000] in <50f22134ee3a4d3ab382d1d406dc2ad0>:0 
  at System.Windows.Forms.Control+ControlWindowTarget.OnMessage (System.Windows.Forms.Message& m) [0x00000] in <50f22134ee3a4d3ab382d1d406dc2ad0>:0 
  at System.Windows.Forms.Control+ControlNativeWindow.WndProc (System.Windows.Forms.Message& m) [0x0000b] in <50f22134ee3a4d3ab382d1d406dc2ad0>:0 
  at System.Windows.Forms.NativeWindow.WndProc (System.IntPtr hWnd, System.Windows.Forms.Msg msg, System.IntPtr wParam, System.IntPtr lParam) [0x00085] in <50f22134ee3a4d3ab382d1d406dc2ad0>:0 

SUGGESTION:

Maybe, don't provide highlighting until action is taken by user.

@HebaruSan
Copy link
Member

No exception / stack trace?

@7ranceaddic7
Copy link
Author

7ranceaddic7 commented Nov 2, 2018

scott@Jupiter:~$ mono --version
Mono JIT compiler version 5.16.0.179 (tarball Thu Oct 4 10:20:38 UTC 2018)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
TLS: __thread
SIGSEGV: altstack
Notifications: epoll
Architecture: amd64
Disabled: none
Misc: softdebug
Interpreter: yes
LLVM: yes(3.6.0svn-mono-/)
GC: sgen (concurrent by default)

You mean something like this?

scott@Jupiter:~$ sudo gdb -p 13064
GNU gdb (Ubuntu 8.2-0ubuntu1) 8.2
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word".
Attaching to process 13064
Reading symbols from /bin/dash...(no debugging symbols found)...done.
Reading symbols from /lib/x86_64-linux-gnu/libc.so.6...Reading symbols from /usr/lib/debug//lib/x86_64-linux-gnu/libc-2.28.so...done.
done.
Reading symbols from /lib64/ld-linux-x86-64.so.2...Reading symbols from /usr/lib/debug//lib/x86_64-linux-gnu/ld-2.28.so...done.
done.
0x00007f5bee12046a in wait4 () at ../sysdeps/unix/syscall-template.S:78
78	../sysdeps/unix/syscall-template.S: No such file or directory.

### JUST PRIOR TO HITTING SPACEBAR ###
(gdb) bt
0  0x00007f5bee12046a in wait4 () at ../sysdeps/unix/syscall-template.S:78
1  0x000055ead33b88a0 in ?? ()
2  0x000055ead33ba09d in ?? ()
3  0x000055ead33b46d8 in ?? ()
4  0x000055ead33b349e in ?? ()
5  0x000055ead33b349e in ?? ()
6  0x000055ead33b349e in ?? ()
7  0x000055ead33ba66e in ?? ()
8  0x000055ead33b19de in ?? ()
9  0x00007f5bee06609b in __libc_start_main (main=0x55ead33b1850, argc=2, argv=0x7ffda1d3e178, 
    init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7ffda1d3e168)
    at ../csu/libc-start.c:308
10 0x000055ead33b1a4a in ?? ()

### AFTER CTD ###
(gdb) bt
0  0x00007f5bee12046a in wait4 () at ../sysdeps/unix/syscall-template.S:78
1  0x000055ead33b88a0 in ?? ()
2  0x000055ead33ba09d in ?? ()
3  0x000055ead33b46d8 in ?? ()
4  0x000055ead33b349e in ?? ()
5  0x000055ead33b349e in ?? ()
6  0x000055ead33b349e in ?? ()
7  0x000055ead33ba66e in ?? ()
8  0x000055ead33b19de in ?? ()
9  0x00007f5bee06609b in __libc_start_main (main=0x55ead33b1850, argc=2, argv=0x7ffda1d3e178, 
    init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7ffda1d3e168)
    at ../csu/libc-start.c:308
10 0x000055ead33b1a4a in ?? ()
(gdb) 

@HebaruSan
Copy link
Member

No, a stack trace showing C# calls, like in #2545. CKAN normally prints them out if there's a problem in the CKAN code.

@7ranceaddic7
Copy link
Author

Ah, I used the .deb installer, so where would these be located?

@HebaruSan
Copy link
Member

Try running ckan from a terminal. The stack trace might be printed out there when it closes.

@7ranceaddic7
Copy link
Author

7ranceaddic7 commented Nov 2, 2018

Got it. (Silly me, all I had to do was locate.)
scott@Jupiter:/usr/lib/ckan$ mono ckan.exe gui

System.InvalidOperationException: No editing control defined
  at System.Windows.Forms.DataGridViewCell.InitializeEditingControl (System.Int32 rowIndex, System.Object initialFormattedValue, System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle) [0x00015] in <50f22134ee3a4d3ab382d1d406dc2ad0>:0 
  at System.Windows.Forms.DataGridView.RefreshEdit () [0x0002f] in <50f22134ee3a4d3ab382d1d406dc2ad0>:0 
  at (wrapper remoting-invoke-with-check) System.Windows.Forms.DataGridView.RefreshEdit()
  at CKAN.GUIMod.SetInstallChecked (System.Windows.Forms.DataGridViewRow row, System.Nullable`1[T] set_value_to) [0x0006f] in <169e907a3d5d4e97b627ad74b10bb7f4>:0 
  at CKAN.Main._MarkModForInstall (System.String identifier, System.Boolean uninstall) [0x0004b] in <169e907a3d5d4e97b627ad74b10bb7f4>:0 
  at CKAN.Main+<>c__DisplayClass232_0.<MarkModForInstall>b__0 () [0x00000] in <169e907a3d5d4e97b627ad74b10bb7f4>:0 
  at CKAN.Util.Invoke[T] (T obj, System.Action action) [0x00026] in <169e907a3d5d4e97b627ad74b10bb7f4>:0 
  at CKAN.Main.MarkModForInstall (System.String identifier, System.Boolean uncheck) [0x0001b] in <169e907a3d5d4e97b627ad74b10bb7f4>:0 
  at CKAN.Main.ModList_KeyPress (System.Object sender, System.Windows.Forms.KeyPressEventArgs e) [0x00058] in <169e907a3d5d4e97b627ad74b10bb7f4>:0 
  at System.Windows.Forms.Control.OnKeyPress (System.Windows.Forms.KeyPressEventArgs e) [0x00019] in <50f22134ee3a4d3ab382d1d406dc2ad0>:0 
  at System.Windows.Forms.DataGridView.OnKeyPress (System.Windows.Forms.KeyPressEventArgs e) [0x00000] in <50f22134ee3a4d3ab382d1d406dc2ad0>:0 
  at System.Windows.Forms.Control.ProcessKeyEventArgs (System.Windows.Forms.Message& m) [0x000ac] in <50f22134ee3a4d3ab382d1d406dc2ad0>:0 
  at System.Windows.Forms.DataGridView.ProcessKeyEventArgs (System.Windows.Forms.Message& m) [0x00078] in <50f22134ee3a4d3ab382d1d406dc2ad0>:0 
  at System.Windows.Forms.Control.ProcessKeyMessage (System.Windows.Forms.Message& m) [0x00018] in <50f22134ee3a4d3ab382d1d406dc2ad0>:0 
  at System.Windows.Forms.Control.WmKeys (System.Windows.Forms.Message& m) [0x00000] in <50f22134ee3a4d3ab382d1d406dc2ad0>:0 
  at System.Windows.Forms.Control.WndProc (System.Windows.Forms.Message& m) [0x00244] in <50f22134ee3a4d3ab382d1d406dc2ad0>:0 
  at System.Windows.Forms.DataGridView.WndProc (System.Windows.Forms.Message& m) [0x00000] in <50f22134ee3a4d3ab382d1d406dc2ad0>:0 
  at System.Windows.Forms.Control+ControlWindowTarget.OnMessage (System.Windows.Forms.Message& m) [0x00000] in <50f22134ee3a4d3ab382d1d406dc2ad0>:0 
  at System.Windows.Forms.Control+ControlNativeWindow.WndProc (System.Windows.Forms.Message& m) [0x0000b] in <50f22134ee3a4d3ab382d1d406dc2ad0>:0 
  at System.Windows.Forms.NativeWindow.WndProc (System.IntPtr hWnd, System.Windows.Forms.Msg msg, System.IntPtr wParam, System.IntPtr lParam) [0x00085] in <50f22134ee3a4d3ab382d1d406dc2ad0>:0 

@HebaruSan
Copy link
Member

Thanks! That confirms that this was (probably) fixed; as of #2543, ModList_KeyPress no longer handles the space bar, and the code that does handle the space bar doesn't call MarkModForInstall / SetInstallChecked / RefreshEdit anymore. So the codepath that's causing the problem is completely changed.

Would you mind testing it in the bleeding edge test build? I would expect this to be solved, but a real test never hurts.

@7ranceaddic7
Copy link
Author

7ranceaddic7 commented Nov 2, 2018

WizBang! Yeppers, that got it.

However, the runtime (time from click to window) is markedly slower.
v1.25.4
Time to InstanceSelectionWindow: ~ 2s
Time to ModSelectionWindow: ~42

v1.25.3
Time to InstanceSelectionWindow: ~ 2s
Time to ModSelectionWindow: ~12

@HebaruSan
Copy link
Member

Cool, thanks for checking that out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants