Incompatible clipboard format between 32bit and 64bit cygwin

Mark Geisert mark@maxrnd.com
Sun Sep 26 09:50:58 GMT 2021


Hi Takashi,

Takashi Yano via Cygwin wrote:
> I noticed that cygwin clipboard is not compatible
> between 32bit and 64bit cygwin.
> 
> If I run 'echo AAAAAAAA > /dev/clipboard' in 32bit cygwin,
> and run 'cat /dev/clipboard' in 64bit cygwin, this result in
> cat: /dev/clipboard: Bad address
> 
> This is because the structure
> typedef struct
> {
>    timestruc_t   timestamp;
>    size_t    len;
>    char      data[1];
> } cygcb_t;
> defined in fhandler_clipboard.cc has different size.
> 
> Is this the known issue?

I doubt anybody has ever tried what you did.  I have been testing getclip and 
putclip between 32- and 64-bit environments, but neglected to test Cygwin-internal 
clipboard format that prepends cygcb_t to the user-supplied data.  So getclip and 
putclip will need fixing as well.

I will submit a Cygwin patch to fix /dev/clipboard usage and a similar patch to 
cygutils for the utilities.

I appreciate your help in uncovering and investigating bugs in clipboard support.
Thanks & Regards,

..mark


More information about the Cygwin mailing list