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

data corruption after 4000 bytes #14

Closed
phemmer opened this issue Oct 25, 2015 · 3 comments
Closed

data corruption after 4000 bytes #14

phemmer opened this issue Oct 25, 2015 · 3 comments

Comments

@phemmer
Copy link

phemmer commented Oct 25, 2015

Seeing a few weird behaviors after the 4000 byte mark.

when the content is 4001-7999 bytes long, it goes missing

# base64 /dev/urandom | head -c 4000 | xsel; xsel | wc -c     
4000
# base64 /dev/urandom | head -c 4001 | xsel; xsel | wc -c
0
# base64 /dev/urandom | head -c 8000 | xsel; xsel | wc -c
0
# base64 /dev/urandom | head -c 8001 | xsel; xsel | wc -c
8009

But then notice that when the data started coming back after the 8001b payload, we got more data out than we put in.

But this extra data comes in chunks:

# base64 /dev/urandom | head -c 8002 | xsel; xsel | wc -c
8009
# base64 /dev/urandom | head -c 8008 | xsel; xsel | wc -c
8009
# base64 /dev/urandom | head -c 8009 | xsel; xsel | wc -c
8025

This extra data also changes each time you retrieve it:

# base64 /dev/urandom | head -c 8001 | xsel
# xsel | tail -n 1
HHj6gt96ap39szmytRQN+rMgImKfb6kSft3h7xaa8WMjZ4GHA7rJEQSASqqTqbEq9OMaJPdwQRQ+m!
# xsel | tail -n 1
HHj6gt96ap39szmytRQN+rMgImKfb6kSft3h7xaa8WMjZ4GHA7rJEQSASqqTqbEq9OMaJPGmRSBoXQ
# xsel | tail -n 1
HHj6gt96ap39szmytRQN+rMgImKfb6kSft3h7xaa8WMjZ4GHA7rJEQSASqqTqbEq9OMaJP5FhEpsX!

(note the last few bytes of each line)

@LuisAlejandro
Copy link

Happening to me. Had to replace my xsel based copy-paste implementation in vim because of this.

cstrahan added a commit to cstrahan/nixpkgs that referenced this issue Sep 21, 2016
The last xsel release was in 2008. Since then, a number of bugs have
been fixed. For example, pasting a large chunk of text (>4000 chars)
into chrome would cause the current tab to hang indefinitely.

A couple examples in the wild:

kfish/xsel#14
kfish/xsel#13
kfish/xsel#16
https://bugs.chromium.org/p/chromium/issues/detail?id=515401
electron/electron#3116
neovim/neovim#4719
acowley pushed a commit to acowley/nixpkgs that referenced this issue Sep 29, 2016
The last xsel release was in 2008. Since then, a number of bugs have
been fixed. For example, pasting a large chunk of text (>4000 chars)
into chrome would cause the current tab to hang indefinitely.

A couple examples in the wild:

kfish/xsel#14
kfish/xsel#13
kfish/xsel#16
https://bugs.chromium.org/p/chromium/issues/detail?id=515401
electron/electron#3116
neovim/neovim#4719
@ElijahLynn
Copy link

#16

@kfish
Copy link
Owner

kfish commented Aug 24, 2017

This was fixed along with #16

@kfish kfish closed this as completed Aug 24, 2017
KoviRobi pushed a commit to KoviRobi/nixos-config that referenced this issue Oct 3, 2024
The latter might support large copies:
kfish/xsel#14
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

4 participants