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

Crash when right-clicking when running under WSL2 on Windows 10 #67

Closed
deadwood2 opened this issue May 3, 2022 · 31 comments
Closed

Crash when right-clicking when running under WSL2 on Windows 10 #67

deadwood2 opened this issue May 3, 2022 · 31 comments
Assignees
Labels
priority:default type:bug Something isn't working

Comments

@deadwood2
Copy link
Owner

"The segfaults can be easily reproduced:

  1. right-click with the mouse;
  2. an extra horizontal bar with the menu appears;
  3. move outside of the AROS application window frame."

https://ae.amigalife.org/index.php?topic=561.120.msg10512#msg10512

@deadwood2 deadwood2 added type:bug Something isn't working priority:default labels May 3, 2022
@cdimauro
Copy link

cdimauro commented May 3, 2022

Attached screenshot, and reported full log of WookieChat execution under GDB:

`cesare@Conan:/WookieChat$ gdb WookieChat
GNU gdb (Ubuntu 9.2-0ubuntu1
20.04.1) 9.2
Copyright (C) 2020 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"...
Reading symbols from WookieChat...
(gdb) r
Starting program: /home/cesare/WookieChat/WookieChat
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
<>: AxRT 41.2
<>: Using absolute paths.
<>: RUNTIME_ROOT: /usr/lib/x86_64-linux-gnu/axrt/4.0/
<>: AXRTSYS : ROOT:usr/lib/x86_64-linux-gnu/axrt/4.0/
<>: USERSYS : ROOT:home/cesare/.axrt/
[New Thread 0x7fffff3b0700 (LWP 817)]
[New Thread 0x7ffffe5d0700 (LWP 818)]
[New Thread 0x7ffffddc0700 (LWP 819)]
[New Thread 0x7ffffd5b0700 (LWP 820)]
[New Thread 0x7ffffcda0700 (LWP 821)]
[New Thread 0x7fffefff0700 (LWP 822)]
[New Thread 0x7fffef7e0700 (LWP 823)]
[New Thread 0x7fffeefd0700 (LWP 824)]
Xlib: extension "XFree86-VidModeExtension" missing on display "192.168.2.126:0".
[New Thread 0x7fffee7c0700 (LWP 825)]
[New Thread 0x7fffedfb0700 (LWP 826)]
[New Thread 0x7fffed7a0700 (LWP 827)]
[New Thread 0x7fffecf90700 (LWP 828)]
[New Thread 0x7fffcfff0700 (LWP 829)]
[Thread 0x7fffff3b0700 (LWP 817) exited]
[New Thread 0x7fffff3b0700 (LWP 830)]
[New Thread 0x7fffcf7e0700 (LWP 831)]
[New Thread 0x7fffcefd0700 (LWP 832)]
[Thread 0x7fffcfff0700 (LWP 829) exited]
[New Thread 0x7fffce7c0700 (LWP 833)]
[Thread 0x7fffcf7e0700 (LWP 831) exited]
[Thread 0x7fffedfb0700 (LWP 826) exited]
<>: CURRENT_DIR : ROOT:home/cesare/WookieChat/
<>: PROGRAM DIR : ROOT:home/cesare/WookieChat/
<>: PROGRAM NAME: WookieChat
AxRuntime does not support AllocAbs(nommu_AllocAbs)


wookiechat.c (55) main() - WookieChat - Transmission begins...
[New Thread 0x7fffcdfb0700 (LWP 834)]
[New Thread 0x7fffcd7a0700 (LWP 835)]
XError 3 (Major=15, Minor=0) task = Intuition menu handler
BadWindow (invalid Window parameter)

Thread 7 "Intuition menu " received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffefff0700 (LWP 822)]
_int_free (av=0x7ffff8000020, p=0x7ffff802c380, have_lock=) at malloc.c:4316
4316 malloc.c: No such file or directory.
(gdb)`

WookieChat Menu Issue on AxRuntime on WSL2

@deadwood2
Copy link
Owner Author

Can you run "bt" command once you get the crash in gdb? This should show full backtrace of the call.

Also this line might suggest an issue: Xlib: extension "XFree86-VidModeExtension" missing on display "192.168.2.126:0". Is this VidMode extension something you can "install" into WSL2?

@cdimauro
Copy link

cdimauro commented May 4, 2022

Sure:
`<>: CURRENT_DIR : ROOT:home/cesare/WookieChat/
<>: PROGRAM DIR : ROOT:home/cesare/WookieChat/
<>: PROGRAM NAME: WookieChat
AxRuntime does not support AllocAbs(nommu_AllocAbs)


wookiechat.c (55) main() - WookieChat - Transmission begins...
[New Thread 0x7fffcdfb0700 (LWP 140)]
[New Thread 0x7fffcd7a0700 (LWP 141)]
XError 3 (Major=15, Minor=0) task = Intuition menu handler
BadWindow (invalid Window parameter)

Thread 7 "Intuition menu " received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffefff0700 (LWP 128)]
_int_free (av=0x7ffff8000020, p=0x7ffff802c380, have_lock=) at malloc.c:4316
4316 malloc.c: No such file or directory.
(gdb) bt
#0 _int_free (av=0x7ffff8000020, p=0x7ffff802c380, have_lock=) at malloc.c:4316
#1 0x00007ffffe8616fd in XFree () from /lib/x86_64-linux-gnu/libX11.so.6
#2 0x00007ffffe9dd47c in ?? () from /usr/lib/x86_64-linux-gnu/axrt/4.0/Libs/intuition.library
#3 0x00007ffffe9ec499 in ?? () from /usr/lib/x86_64-linux-gnu/axrt/4.0/Libs/intuition.library
#4 0x00007ffffe9ec126 in ?? () from /usr/lib/x86_64-linux-gnu/axrt/4.0/Libs/intuition.library
#5 0x00007ffffeb8c888 in ?? () from /usr/lib/x86_64-linux-gnu/axrt/4.0/boot/runtimelinux/Libs/exec.library
#6 0x00007fffff545609 in start_thread (arg=) at pthread_create.c:477
#7 0x00007fffff67f163 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95`

@cdimauro
Copy link

cdimauro commented May 4, 2022

Also this line might suggest an issue: Xlib: extension "XFree86-VidModeExtension" missing on display "192.168.2.126:0". Is this VidMode extension something you can "install" into WSL2?

No, this is because I'm using an X11 server. Other applications work without problems.

@deadwood2
Copy link
Owner Author

If I'm reading this correctly you are missing debug symbols. Can you install this package https://www.axrt.org/download/axrt/4.0/packages/libaxrt-4.0-dbg_41.2-1_amd64.deb and re-run gdb trace?

@cdimauro
Copy link

cdimauro commented May 5, 2022

Sure:
`wookiechat.c (55) main() - WookieChat - Transmission begins...
[New Thread 0x7fffcdfb0700 (LWP 757)]
[New Thread 0x7fffcd7a0700 (LWP 758)]
XError 3 (Major=15, Minor=0) task = Intuition menu handler
BadWindow (invalid Window parameter)

Thread 7 "Intuition menu " received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffefff0700 (LWP 745)]
_int_free (av=0x7ffff8000020, p=0x7ffff802c380, have_lock=) at malloc.c:4316
4316 malloc.c: No such file or directory.
(gdb) bt
#0 _int_free (av=0x7ffff8000020, p=0x7ffff802c380, have_lock=) at malloc.c:4316
#1 0x00007ffffe8616fd in XFree () from /lib/x86_64-linux-gnu/libX11.so.6
#2 0x00007ffffe9dd47c in WhichLayer_X11 (li=0x7ffff8274780, x=335, y=207, IntuitionBase=0x7ffff8045160)
at /ssd/deadwood/repo-github-dd-alt-runtimelinux/AROS/rom/intuition/./inputhandler_support.c:1531
#3 0x00007ffffe9ec499 in HandleMouseMove (mhd=0x7fffe8000b60, IntuitionBase=0x7ffff8045160) at /ssd/deadwood/repo-github-dd-alt-runtimelinux/AROS/rom/intuition/./menutask.c:269
#4 0x00007ffffe9ec126 in DefaultMenuHandler (taskparams=0x7fffff3af8a0) at /ssd/deadwood/repo-github-dd-alt-runtimelinux/AROS/rom/intuition/./menutask.c:184
#5 0x00007ffffeb8c888 in __pthread_trampoline (ptr=0x7ffff8053230) at /ssd/deadwood/repo-github-dd-alt-runtimelinux/AROS/rom/exec/./newaddtask.c:311
#6 0x00007fffff545609 in start_thread (arg=) at pthread_create.c:477
#7 0x00007fffff67f163 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95`

@cdimauro
Copy link

cdimauro commented May 5, 2022

image

@deadwood2
Copy link
Owner Author

Ah, now it's much better, thank you. Let me review the code and I will get back to you. :)

@deadwood2
Copy link
Owner Author

Here is version with some debug: https://axrt.org/development/intuition.library.x86_64-axrt.01.zip

Please replace intuition.library which is located in /usr/lib/x86_64-linux-gnu/axrt/4.0/Libs with the one from zip file.

Do the following: run application, right-click once in the window, you should get two lines printed on linux console, right-click and drag off to get crash. Please paste the output of first click and the subsequent crash.

@cdimauro
Copy link

cdimauro commented May 5, 2022

After the first (right) click:

wookiechat.c (55) main() - WookieChat - Transmission begins... [New Thread 0x7fffcdfb0700 (LWP 888)] [New Thread 0x7fffcd7a0700 (LWP 889)] After XQueryPointer, root 205, child 3145775 After XQueryTree, children 0000000000000000 After XQueryPointer, root 205, child 3145775 After XQueryTree, children 0000000000000000 After XQueryPointer, root 205, child 3145775 After XQueryTree, children 0000000000000000

image

@cdimauro
Copy link

cdimauro commented May 5, 2022

After second (right) click and crash:
`After XQueryPointer, root 205, child 3145775
After XQueryTree, children 0000000000000000
After XQueryPointer, root 205, child 3145775
After XQueryTree, children 0000000000000000
After XQueryPointer, root 205, child 0
XError 3 (Major=15, Minor=0) task = Intuition menu handler
BadWindow (invalid Window parameter)
After XQueryTree, children 00007ffff802c390

Thread 7 "Intuition menu " received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffefff0700 (LWP 876)]
_int_free (av=0x7ffff8000020, p=0x7ffff802c380, have_lock=) at malloc.c:4316
4316 malloc.c: No such file or directory.
(gdb)
(gdb)
(gdb) bt
#0 _int_free (av=0x7ffff8000020, p=0x7ffff802c380, have_lock=) at malloc.c:4316
#1 0x00007ffffe8616fd in XFree () from /lib/x86_64-linux-gnu/libX11.so.6
#2 0x00007ffffe9dd4f0 in ?? () from /usr/lib/x86_64-linux-gnu/axrt/4.0/Libs/intuition.library
#3 0x00007ffffe9ec50d in ?? () from /usr/lib/x86_64-linux-gnu/axrt/4.0/Libs/intuition.library
#4 0x00007ffffe9ec19a in ?? () from /usr/lib/x86_64-linux-gnu/axrt/4.0/Libs/intuition.library
#5 0x00007ffffeb8c888 in __pthread_trampoline (ptr=0x7ffff8053230) at /ssd/deadwood/repo-github-dd-alt-runtimelinux/AROS/rom/exec/./newaddtask.c:311
#6 0x00007fffff545609 in start_thread (arg=) at pthread_create.c:477
#7 0x00007fffff67f163 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95`

image

@cdimauro
Copy link

cdimauro commented May 5, 2022

Here is version with some debug: https://axrt.org/development/intuition.library.x86_64-axrt.01.zip

Please replace intuition.library which is located in /usr/lib/x86_64-linux-gnu/axrt/4.0/Libs with the one from zip file.

There was a .dbg file inside: I haven't copied it on /Libs. Please, let me know if I should do it, and repeat the test.

@cdimauro
Copy link

cdimauro commented May 5, 2022

To be more precise on the second right click, there was a long list of this:
`After XQueryPointer, root 205, child 3145775

After XQueryTree, children 0000000000000000`
before the last part with the crash.

@deadwood2
Copy link
Owner Author

Here is version with some debug: https://axrt.org/development/intuition.library.x86_64-axrt.01.zip
Please replace intuition.library which is located in /usr/lib/x86_64-linux-gnu/axrt/4.0/Libs with the one from zip file.

There was a .dbg file inside: I haven't copied it on /Libs. Please, let me know if I should do it, and repeat the test.

No, that's fine. The .dbg would be needed for in-depth debugging only. With what you provided so far I can work out a new version for tests.

@deadwood2
Copy link
Owner Author

Here is new version, let me know it is still crashes: https://axrt.org/development/intuition.library.x86_64-axrt.02.zip

@deadwood2 deadwood2 self-assigned this May 6, 2022
@cdimauro
Copy link

cdimauro commented May 6, 2022

Fixed!!! :)

image

@cdimauro
Copy link

cdimauro commented May 6, 2022

Now there's another (different) bug: the Settings / MUI dialog windows doesn't appear. The console log reports this, when I select its menu:

After XQueryPointer, root 205, child 3145945
After XQueryTree, children 0000000000000000
[New Thread 0x7fffb6fd0700 (LWP 1010)]
[Thread 0x7fffb6fd0700 (LWP 1010) exited]

Something similar happens on the WookieChat / Save buffers as... do nothing: not event displaying something on the console log. And the same on Windows menu, with Incoming ..., Outgoing submenus.

Whereas it works with Windows / URL Grabber and Ignore list, and works also with Settings / Wookiechat.

But, as I've said, those are (at, look like) completely different issue. Unfortunately I've no time now to open a new issue or do more tests: I'll check this evening.

@deadwood2
Copy link
Owner Author

I checked WookieChat code and "Save buffers as", "Incoming.." and "Outgoing.." are simply not implemented. Not opening MUI setting is a bug - I created a report for it.

@deadwood2
Copy link
Owner Author

Glad it works. I'll start preparing for next release. Can you make a screen shot of having WookieChat on top of some native Windows application (Word? Excell? Paint?) or together with Windows menu start opened? Something similar to this https://axrt.org/media/axrt-desktop-20220404.jpg to add to axrt.org gallery as well as use for announcement?

@cdimauro
Copy link

cdimauro commented May 6, 2022

Sure! Attached.
AxRuntime example

@cdimauro
Copy link

cdimauro commented May 6, 2022

BTW, it works with multimonitor now: see attached screen. ;)

@deadwood2
Copy link
Owner Author

Thanks a lot! I'll build release debs and would like to ask you for a final test. I will paste links here.

@cdimauro
Copy link

cdimauro commented May 6, 2022

Sure, np!

@deadwood2
Copy link
Owner Author

Please try this release package: https://axrt.org/download/axrt/4.0/packages/libaxrt-4.0_41.3-1_amd64.deb

@cdimauro
Copy link

cdimauro commented May 7, 2022

Now the problem is that menus don't open.
When I right click, the (additional) bar with the menu appears, but if I go there and try to right or left-click, nothing happens: no menu is selected.
(right or left) clicking on "Project", for example, has no effect at all.

image

@deadwood2
Copy link
Owner Author

That's unexpected :/ How does it work if you replace with 02 intution.library? (https://axrt.org/development/intuition.library.x86_64-axrt.02.zip

@cdimauro
Copy link

cdimauro commented May 7, 2022

It works the same. Sorry, but I made a mistake: when I tested the previously I kept both monitors open, and the mentioned issue happens.
Everything works fine if I either turn off one monitor, or both monitors show the same (and only) framebuffer (so, they work in "Duplicate screen").

@deadwood2
Copy link
Owner Author

Ok, thanks. I'll add that information to documentation. I think the same issues would happen on Linux as well. I did not work on multi-monitor support.

So to sum up, the release works as expected granted single monitor or "duplicate screen" is used, correct?

@cdimauro
Copy link

cdimauro commented May 7, 2022

Yes, exactly! :)

@deadwood2
Copy link
Owner Author

Good, I'll proceed with making the release :)

@deadwood2
Copy link
Owner Author

Fixed in cab49fa

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority:default type:bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants