Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Editor can not be shown again after click close icon #400

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

Closed
Nokia808 opened this issue Aug 3, 2020 · 19 comments
Closed

Editor can not be shown again after click close icon #400

Nokia808 opened this issue Aug 3, 2020 · 19 comments
Assignees
Labels

Comments

@Nokia808
Copy link

Nokia808 commented Aug 3, 2020

Hi. I detect this error since 1st time you ship this cute application on FlatHub.

To reproduce it:

  1. launch ksnip,
  2. close editor from it's "close" icon that is located on upper right corner of editor UI (being of the shap x),
  3. then try the following:
    a- right click system try icon of ksnip, then click "show editor" from right click menu, it will never bring editor !
    b- take a screen-shot using hot keys. The screenshot tacked but editor never shown automatically. Try now right click system try icon of ksnip, then click "show editor" from right click menu, it will never bring editor !

The only way to restore it, is to exit ksnip application then re-launching it again !

I test this error after updating to last version of flatpak package that you just few hrs pushed.

I'm on Fedora Linux 32 X64 bit Cinnamon edition.

@DamirPorobic
Copy link
Member

This is only happening with the flatpak? Could ou test the appImage and see if it behaves differently?

@LyzardKing any idea?

@LyzardKing
Copy link
Contributor

It works fine for me in Ubuntu 20.04.
@Nokia808 What is the log if you run flatpak run org.ksnip.ksnip in a terminal, then try closing and reopening?

@Nokia808
Copy link
Author

Nokia808 commented Aug 4, 2020

@LyzardKing
The log is:

$ flatpak run org.ksnip.ksnip
Qt: Session management error: None of the authentication protocols specified are supported
Unable to find any translation files for ksnip.
Unable to find any translation files for kImageAnnotator.

@Nokia808
Copy link
Author

Nokia808 commented Aug 4, 2020

@LyzardKing
Try scenario (b): (take a screen-shot using hot keys. The screenshot tacked but editor never shown automatically. Try now right click system try icon of ksnip, then click "show editor" from right click menu, it will never bring editor !)
because scenario (a) not always reproduce the bug.

@Nokia808
Copy link
Author

Nokia808 commented Aug 4, 2020

@DamirPorobic
@LyzardKing

I detected now that this issue NOT happened if run ksnip from terminal ! It is only happened if run from launcher icon in application menu !

@Nokia808
Copy link
Author

Nokia808 commented Oct 1, 2020

@DamirPorobic
Hi. ksnip is now available in official Fedora repositories as .rpm package.
I removed flatpak package & installed .rpm package from my official Fedora repositories. I'm still able to reproduced his bug with .rpm package.

@DamirPorobic
Copy link
Member

Thanks for letting me know. I didn't have time yet to look into this. As soon as I find something I'll let you know.

@garymoon
Copy link

garymoon commented Oct 17, 2020

I am able to reproduce this issue on Ubuntu 18.04 with 0.7.3 deb plus latest flatpak and appimage. I identified file in /tmp it was reading immediately before the failure: qipc_sharedmemory_KsnipInstanceLock45e4a2c2f71278828d3.... After deleting it, I was able to use ksnip again. My best guess (which isn't worth much) is that my first instance wasn't cleanly terminated and ksnip/Qt aren't handling the dangling lock file.

Thanks Damir for ksnip, it's been marvelous! Hope this helps! 💙

@DamirPorobic
Copy link
Member

@garymoon thanks Gary, that is a huge help, didn't have the single instance lock on my radar at all :)

@garymoon
Copy link

garymoon commented Oct 18, 2020

@DamirPorobic Happy to help mate! 😃

I'm unable to repro with SIGKILL even though there are several references to ksnip remaining in /tmp afterward, so I doubt I'll be of much use to you in determining the cause or testing a fix. Even if I play around with removing some but not others, no glory. If you have any suggestions as to how I might cause it to happen again I'm happy to give it a go!

Based on the strace of the original failure (which I can share fully in private if you'd like) it looks like some part of what's happening with the lock files convinces ksnip the org.ksnip.singleInstanceServer socket is still alive and it attempts to use it but doesn't handle failure there. The only thing I can think of that happened last time that might have impacted this was a reboot, so I'll try rebooting without killing it tonight and see how I go will followup here when next I reboot.

Starting at the first reference to any of the lock files:

openat(AT_FDCWD, "/tmp/qipc_systemsem_KsnipInstanceLock45e4a2c2f71278828d34b44521bcc5f6326393f5", O_RDWR|O_CREAT|O_EXCL|O_CLOEXEC, 0640) = 17
fcntl(17, F_SETFD, FD_CLOEXEC)          = 0
close(17)                               = 0
stat("/tmp/qipc_systemsem_KsnipInstanceLock45e4a2c2f71278828d34b44521bcc5f6326393f5", {st_mode=S_IFREG|0640, st_size=0, ...}) = 0
semget(0x5101003b, 1, IPC_CREAT|IPC_EXCL|0600) = 48
semctl(48, 0, SETVAL, 0x1)              = 0
openat(AT_FDCWD, "/tmp/qipc_systemsem_KsnipInstanceLock45e4a2c2f71278828d34b44521bcc5f6326393f5", O_RDWR|O_CREAT|O_EXCL|O_CLOEXEC, 0640) = -1 EEXIST (File exists)
stat("/tmp/qipc_systemsem_KsnipInstanceLock45e4a2c2f71278828d34b44521bcc5f6326393f5", {st_mode=S_IFREG|0640, st_size=0, ...}) = 0
semget(0x5101003b, 1, IPC_CREAT|IPC_EXCL|0600) = -1 EEXIST (File exists)
semget(0x5101003b, 1, IPC_CREAT|0600)   = 48
semctl(48, 0, SETVAL, 0x1)              = 0
semop(48, [{0, -1, SEM_UNDO}], 1)       = 0
openat(AT_FDCWD, "/tmp/qipc_sharedmemory_KsnipInstanceLock45e4a2c2f71278828d34b44521bcc5f6326393f5", O_RDWR|O_CREAT|O_EXCL|O_CLOEXEC, 0640) = -1 EEXIST (File exists)
stat("/tmp/qipc_sharedmemory_KsnipInstanceLock45e4a2c2f71278828d34b44521bcc5f6326393f5", {st_mode=S_IFREG|0640, st_size=0, ...}) = 0
stat("/tmp/qipc_sharedmemory_KsnipInstanceLock45e4a2c2f71278828d34b44521bcc5f6326393f5", {st_mode=S_IFREG|0640, st_size=0, ...}) = 0
shmget(0x51010022, 1, IPC_CREAT|IPC_EXCL|0600) = -1 EEXIST (File exists)
semop(48, [{0, 1, SEM_UNDO}], 1)        = 0
unlink("/tmp/qipc_systemsem_KsnipInstanceLock45e4a2c2f71278828d34b44521bcc5f6326393f5") = 0
semctl(48, 0, IPC_RMID, NULL)           = 0
openat(AT_FDCWD, "/tmp/qipc_systemsem_KsnipInstanceLock45e4a2c2f71278828d34b44521bcc5f6326393f5", O_RDWR|O_CREAT|O_EXCL|O_CLOEXEC, 0640) = 17
fcntl(17, F_SETFD, FD_CLOEXEC)          = 0
close(17)                               = 0
stat("/tmp/qipc_systemsem_KsnipInstanceLock45e4a2c2f71278828d34b44521bcc5f6326393f5", {st_mode=S_IFREG|0640, st_size=0, ...}) = 0
semget(0x5101003b, 1, IPC_CREAT|IPC_EXCL|0600) = 49
semctl(49, 0, SETVAL, 0x1)              = 0
semop(49, [{0, -1, SEM_UNDO}], 1)       = 0
stat("/tmp/qipc_sharedmemory_KsnipInstanceLock45e4a2c2f71278828d34b44521bcc5f6326393f5", {st_mode=S_IFREG|0640, st_size=0, ...}) = 0
stat("/tmp/qipc_sharedmemory_KsnipInstanceLock45e4a2c2f71278828d34b44521bcc5f6326393f5", {st_mode=S_IFREG|0640, st_size=0, ...}) = 0
shmget(0x51010022, 0, 0400)             = 48
shmat(48, NULL, SHM_RDONLY)             = 0x7ff6b4c7d000
shmctl(48, IPC_STAT, {shm_perm={uid=1000, gid=1000, mode=0600, key=1359020066, cuid=1000, cgid=1000}, shm_segsz=1024, shm_cpid=11327, shm_lpid=21885, shm_nattch=2, shm_atime=1602961800, shm_dtime=1602961508, shm_ctime=1602211865}) = 0
semop(49, [{0, 1, SEM_UNDO}], 1)        = 0
semop(49, [{0, -1, SEM_UNDO}], 1)       = 0
shmdt(0x7ff6b4c7d000)                   = 0
shmget(0x51010022, 0, 0400)             = 48
shmctl(48, IPC_STAT, {shm_perm={uid=1000, gid=1000, mode=0600, key=1359020066, cuid=1000, cgid=1000}, shm_segsz=1024, shm_cpid=11327, shm_lpid=21885, shm_nattch=1, shm_atime=1602961800, shm_dtime=1602961800, shm_ctime=1602211865}) = 0
semop(49, [{0, 1, SEM_UNDO}], 1)        = 0
unlink("/tmp/qipc_systemsem_KsnipInstanceLock45e4a2c2f71278828d34b44521bcc5f6326393f5") = 0
semctl(49, 0, IPC_RMID, NULL)           = 0
openat(AT_FDCWD, "/tmp/qipc_systemsem_KsnipInstanceLock45e4a2c2f71278828d34b44521bcc5f6326393f5", O_RDWR|O_CREAT|O_EXCL|O_CLOEXEC, 0640) = 17
fcntl(17, F_SETFD, FD_CLOEXEC)          = 0
close(17)                               = 0
stat("/tmp/qipc_systemsem_KsnipInstanceLock45e4a2c2f71278828d34b44521bcc5f6326393f5", {st_mode=S_IFREG|0640, st_size=0, ...}) = 0
semget(0x5101003b, 1, IPC_CREAT|IPC_EXCL|0600) = 50
semctl(50, 0, SETVAL, 0x1)              = 0
openat(AT_FDCWD, "/tmp/qipc_systemsem_KsnipInstanceLock45e4a2c2f71278828d34b44521bcc5f6326393f5", O_RDWR|O_CREAT|O_EXCL|O_CLOEXEC, 0640) = -1 EEXIST (File exists)
stat("/tmp/qipc_systemsem_KsnipInstanceLock45e4a2c2f71278828d34b44521bcc5f6326393f5", {st_mode=S_IFREG|0640, st_size=0, ...}) = 0
semget(0x5101003b, 1, IPC_CREAT|IPC_EXCL|0600) = -1 EEXIST (File exists)
semget(0x5101003b, 1, IPC_CREAT|0600)   = 50
semctl(50, 0, SETVAL, 0x1)              = 0
semop(50, [{0, -1, SEM_UNDO}], 1)       = 0
openat(AT_FDCWD, "/tmp/qipc_sharedmemory_KsnipInstanceLock45e4a2c2f71278828d34b44521bcc5f6326393f5", O_RDWR|O_CREAT|O_EXCL|O_CLOEXEC, 0640) = -1 EEXIST (File exists)
stat("/tmp/qipc_sharedmemory_KsnipInstanceLock45e4a2c2f71278828d34b44521bcc5f6326393f5", {st_mode=S_IFREG|0640, st_size=0, ...}) = 0
stat("/tmp/qipc_sharedmemory_KsnipInstanceLock45e4a2c2f71278828d34b44521bcc5f6326393f5", {st_mode=S_IFREG|0640, st_size=0, ...}) = 0
shmget(0x51010022, 1, IPC_CREAT|IPC_EXCL|0600) = -1 EEXIST (File exists)
semop(50, [{0, 1, SEM_UNDO}], 1)        = 0
socket(AF_UNIX, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0) = 17
connect(17, {sa_family=AF_UNIX, sun_path="/tmp/org.ksnip.singleInstanceServer"}, 110) = -1 ENOENT (No such file or directory)
close(17)                               = 0
write(5, "\1\0\0\0\0\0\0\0", 8)         = 8
openat(AT_FDCWD, "/dev/tty", O_RDONLY|O_CLOEXEC) = 17
fcntl(17, F_SETFD, FD_CLOEXEC)          = 0
close(17)                               = 0
write(2, "QIODevice::write (QLocalSocket):"..., 49QIODevice::write (QLocalSocket): device not open
) = 49
write(2, "QAbstractSocket::waitForBytesWri"..., 74QAbstractSocket::waitForBytesWritten() is not allowed in UnconnectedState
) = 74
unlink("/tmp/qipc_systemsem_KsnipInstanceLock45e4a2c2f71278828d34b44521bcc5f6326393f5") = 0
semctl(50, 0, IPC_RMID, NULL)           = 0
write(16, "\1\v\1\0\1\0\0\0\0\0\0\0\0\0\0\0", 16) = 16
close(16)                               = 0
write(5, "\1\0\0\0\0\0\0\0", 8)         = 8
openat(AT_FDCWD, "/sys/devices/system/cpu/online", O_RDONLY|O_CLOEXEC) = 16
read(16, "0-7\n", 8192)                 = 4
close(16)                               = 0
write(5, "\1\0\0\0\0\0\0\0", 8)         = 8
poll([{fd=3, events=POLLIN|POLLOUT}], 1, -1) = 1 ([{fd=3, revents=POLLOUT}])
writev(3, [{iov_base="\1\0\10\0\4\0`\f\345\1\0\0\0\0\0\0\1\0\1\0\0\0\2\0!\0\0\0\0\0\0\0"..., iov_len=84}], 1) = 84
futex(0x559915eff928, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x559915f0ba70, FUTEX_WAIT_PRIVATE, 0, NULL) = 0
futex(0x559915f0ba20, FUTEX_WAKE_PRIVATE, 1) = 0
poll([{fd=3, events=POLLIN|POLLOUT}], 1, -1) = 1 ([{fd=3, revents=POLLOUT}])
writev(3, [{iov_base=".\0\2\0\2\0`\f", iov_len=8}], 1) = 8
poll([{fd=3, events=POLLIN|POLLOUT}], 1, -1) = 1 ([{fd=3, revents=POLLOUT}])
writev(3, [{iov_base="<0\2\0\0\0`\f+\0\1\0", iov_len=12}, {iov_base=NULL, iov_len=0}, {iov_base="", iov_len=0}], 3) = 12
poll([{fd=3, events=POLLIN}], 1, -1)    = 1 ([{fd=3, revents=POLLIN}])
recvmsg(3, {msg_name=NULL, msg_namelen=0, msg_iov=[{iov_base="\1\2\251\1\0\0\0\0\7\0`\r\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", iov_len=4096}], msg_iovlen=1, msg_controllen=0, msg_flags=0}, 0) = 32
shutdown(3, SHUT_RDWR)                  = 0
close(3)                                = 0
write(14, "\1\0\0\0\0\0\0\0", 8)        = 8
futex(0x559916099ba0, FUTEX_WAIT_PRIVATE, 0, NULL) = 0
futex(0x559916099b50, FUTEX_WAKE_PRIVATE, 1) = 0
write(14, "\1\0\0\0\0\0\0\0", 8)        = 8
futex(0x559916099ba0, FUTEX_WAIT_PRIVATE, 0, NULL) = -1 EAGAIN (Resource temporarily unavailable)
futex(0x559916099b50, FUTEX_WAKE_PRIVATE, 1) = 0
write(14, "\1\0\0\0\0\0\0\0", 8)        = 8
futex(0x559916099ba0, FUTEX_WAIT_PRIVATE, 0, NULL) = 0
futex(0x559916099b50, FUTEX_WAKE_PRIVATE, 1) = 0
write(14, "\1\0\0\0\0\0\0\0", 8)        = 8
futex(0x559916099ba0, FUTEX_WAIT_PRIVATE, 0, NULL) = 0
futex(0x559916099b50, FUTEX_WAKE_PRIVATE, 1) = 0
inotify_rm_watch(13, 1)                 = 0
close(13)                               = 0
write(14, "\1\0\0\0\0\0\0\0", 8)        = 8
futex(0x5599160ca3f0, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x559916069870, FUTEX_WAIT_PRIVATE, 0, NULL) = -1 EAGAIN (Resource temporarily unavailable)
futex(0x559916069820, FUTEX_WAKE_PRIVATE, 1) = 0
brk(0x559916232000)                     = 0x559916232000
getpid()                                = 21885
exit_group(0)                           = ?
+++ exited with 0 +++

We wouldn't want to make it too easy for you now would we? 😈

@DamirPorobic
Copy link
Member

I'm really puzzled how the single instance lock is related to this issue, it should only come into play when starting a new instance but when I understand the initial report, it seems to be happening on the same instance. @Nokia808 can you disable single-instance in ksnip config and try to reproduce this issue?

@DamirPorobic
Copy link
Member

@kendoori has provided a video showing the issue https://youtu.be/nZSGv8KPi9I

Can someone try out few things:

  1. Does this issue happen when you hit the close button or does it also happen when you minimize?
  2. Does it happen with and without single-instance enabled?

@kendoori
Copy link

For me, I can reliably get it to happen upon close. Minimize works properly.

@DamirPorobic
Copy link
Member

What about the single-sinatnce? It can be disabled in settings under Settings > Application > Run ksnip as single instance. Changing the single instance setting requires ksnip restart.

@DamirPorobic DamirPorobic self-assigned this Dec 15, 2020
@kendoori
Copy link

For me, by default it was set to single instance. So the behavior I captured, was with single instance on. I tried to deselecting and restarting, which led to the same behavior. I then close, and reselect single instance, then restarted again. Close still produces the same behavior no matter what combination I have configured.

@kendoori
Copy link

I was still having this issue when running 1.8.0 installed as a .deb on Linux Mint 20. I tried installing the 1.9.0 continuous .deb build and the issue persisted. I decided to uninstall and use the appimage instead. Oddly, the appimage doesn't have the issue.

@DamirPorobic
Copy link
Member

Ok, that's news. I haven't had the time to look into it but that's valuable information.

@DamirPorobic DamirPorobic changed the title Editor can not be shown again after click "close" icon of it !! Editor can not be shown again after click close icon Jan 23, 2021
@DamirPorobic
Copy link
Member

I was able to reproduce this issue in my Mint Cinnamon 20.1 VM and to resolve with a simple fix. Would be nice if you could double check on your side.

@kendoori
Copy link

kendoori commented Jan 24, 2021 via email

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

No branches or pull requests

5 participants