rickyrockrat / parcellite

GNU General Public License v3.0
220 stars 29 forks source link

Core dump on attempt of read a string from persistent history #83

Closed zhum closed 7 months ago

zhum commented 1 year ago

I stored in the persistent history a string scontrol update nodename=``uname -n`` reason='[J], and every time I try to copy it into the clipboard parcellite fails with core dumped. (Double quotes are actually single, but MD does not allow to write them, in the trace is correct version).

Here is the gdb trace:

[Thread 0x7fffe7fff640 (LWP 2407568) exited]
xdotool:'/bin/sh -c 'xdotool type "scontrol update nodename=`uname -n` reason='[J] "''
text:'scontrol update nodename=`uname -n` reason='[J] '

Thread 1 "parcellite" received signal SIGSEGV, Segmentation fault.
0x00007ffff773a908 in g_spawn_async_with_pipes () from /lib/x86_64-linux-gnu/libglib-2.0.so.0

Note, I don't have xdotool (if installed, it does not changed the situation). Also I suppose to check it is available only on parcellite start and do not try to use it later, if if it is missing.

rickyrockrat commented 1 year ago

It doesn't segfault with the master and without the paste option. Can you please post your parcellite rc file so I can duplicate your settings? Thanks

zhum commented 1 year ago

Here it is:

[rc]
RCVersion=1
use_copy=true
use_primary=true
synchronize=false
save_history=true
history_pos=false
history_x=1
history_y=1
history_limit=25
data_size=0
item_size=5
automatic_paste=false
auto_key=true
auto_mouse=true
key_input=false
restore_empty=true
rc_edit=true
type_search=false
case_search=false
ignore_whiteonly=false
trim_wspace_begend=false
trim_newline=false
hyperlinks_only=false
confirm_clear=true
current_on_top=true
single_line=true
reverse_history=false
item_length=50
persistent_history=false
persistent_separate=false
persistent_on_top=false
persistent_delim=\\n
nonprint_disp=false
ellipsize=2
multi_user=true
icon_name=parcellite
menu_key=<Ctrl><Alt>P
history_key=<Ctrl><Alt>H
phistory_key=<Ctrl><Alt>X
actions_key=<Ctrl><Alt>A
zhum commented 1 year ago

And I've checked - in the main list it also segfaults with this string, if you try to paste.

rickyrockrat commented 1 year ago

Would it be possible to put this exact string in a text file, then gzip it and put it somewhere and send me a link? I don't seem to be able to duplicate, and I'm guessing it's some translation between you, me, and github.

zhum commented 1 year ago

https://drive.google.com/file/d/1OdxbMSVF2ei0Lq4dSIamHOG8ZJE4lfxr/view?usp=drivesdk - here is the archieve with config file and history file too.

rickyrockrat commented 1 year ago

Sorry it's taken so long. Way too busy. I have your string now, I think: 00000000 73 63 6f 6e 74 72 6f 6c 20 75 70 64 61 74 65 20 |scontrol update | 00000010 6e 6f 64 65 6e 61 6d 65 3d 60 75 6e 61 6d 65 20 |nodename=uname | 00000020 2d 6e 60 20 72 65 61 73 6f 6e 3d 27 5b 4a 5d 20 |-nreason='[J] | 00000030 0a Does that look right besides the ending newline? I extracted that from your history file, then copied it. It shows up in the clipboard history. I verified the my copy/primary/sync/save history, auto key/mouse/key_input/autopaste are the same as yours. I moved it to persistent and can paste it. I removed xdotool from my system and still can't duplicate. If that is not your string, can you put it in a file and post the hexdump -C output?

zhum commented 1 year ago

Yes, this is exactly my string. I use version "Parcellite 1.2.1" from ubuntu package (22.04.2 LTS).

I've noted, that any string without backquotes works fine, but even the single backquote leads to segfault. Should I try to use 1.2.2 from this site and try to compile it by myself? Could it be that ubuntu compilation can include some additional destructive compiler/linker options e.g.?

rickyrockrat commented 1 year ago

Please do. 1.2.2 is the latest release. I don't know why your copy is segfaulting.

zhum commented 1 year ago

I compiled it from source - seems to be working! But I failed to build deb package:

$ ./rel.deb.sh 
Using '/home/szhumatiy/0_tmp/parcellite-1.2.2'
set_scm_local
directory '/home/szhumatiy/0_tmp should NOT be under 

So, I'm waiting for official package update in Ubuntu or ppa, or instructions how to build it.

rickyrockrat commented 7 months ago

The deb package is not trivial, and it connects to my PPA to upload, so I don't expect it to build. However there are instructions to build it (see No Autotools section in README), and this will do the same thing a .deb would do only with lots fewer steps.