From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from omta002.cacentral1.a.cloudfilter.net (omta002.cacentral1.a.cloudfilter.net [3.97.99.33]) by sourceware.org (Postfix) with ESMTPS id BE12F3858C2C for ; Tue, 28 Sep 2021 06:46:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org BE12F3858C2C Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=SystematicSw.ab.ca Authentication-Results: sourceware.org; spf=none smtp.mailfrom=systematicsw.ab.ca Received: from shw-obgw-4004a.ext.cloudfilter.net ([10.228.9.227]) by cmsmtp with ESMTP id Uw0mmKPO4ps7PV6sam7Dii; Tue, 28 Sep 2021 06:46:16 +0000 Received: from [192.168.1.105] ([68.147.0.90]) by cmsmtp with ESMTP id V6sZm6J62dCHGV6sZmEfn3; Tue, 28 Sep 2021 06:46:16 +0000 X-Authority-Analysis: v=2.4 cv=SdyUytdu c=1 sm=1 tr=0 ts=6152ba38 a=T+ovY1NZ+FAi/xYICV7Bgg==:117 a=T+ovY1NZ+FAi/xYICV7Bgg==:17 a=IkcTkHD0fZMA:10 a=dc4GsmJuRcvp36BYjAIA:9 a=QEXdDO2ut3YA:10 Reply-To: cygwin@cygwin.com To: cygwin@cygwin.com References: <20210926103325.5c17eb11c3c8a56c377199a8@nifty.ne.jp> <584f536c-b108-b562-b940-798ec2847c68@maxrnd.com> <0b13b9ac-583f-ab72-4202-f8b187946d93@towo.net> <498f0cfb-c6c1-cb61-2e88-fcb9ce61f4d4@maxrnd.com> <731c8611-4ed2-29fd-0b9c-33e221d6451e@SystematicSw.ab.ca> <20210928151936.2e644c2ebc717dc367e63003@nifty.ne.jp> From: Brian Inglis Organization: Systematic Software Subject: Re: Incompatible clipboard format between 32bit and 64bit cygwin Message-ID: <82c34eff-3913-785c-7e77-aadc9d257d60@SystematicSw.ab.ca> Date: Tue, 28 Sep 2021 00:46:15 -0600 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: <20210928151936.2e644c2ebc717dc367e63003@nifty.ne.jp> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-CA Content-Transfer-Encoding: 8bit X-CMAE-Envelope: MS4xfAhRH7cZ8T26kCwpicItUvK3ndFZn6iUmEBjsr+0A0Oj4zZFMEqq3s8DjXoA4fKcrkKvrSvgPtGW7njKYviUuna9cr3I7iUnJdXf3itnhq8XjYNGvxgy 1lm0FSTUgPaMKs4blFJ23b6YlTCmuDrhhw4CAOH0BGJQnegtlB7B9n9hZ0HZ/CCV1+uf8IMddJVnuZK3eAJDDhtEWuS2gnpMvDU= X-Spam-Status: No, score=-1164.7 required=5.0 tests=BAYES_00, BODY_8BITS, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, NICE_REPLY_A, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: cygwin@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: General Cygwin discussions and problem reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Sep 2021 06:46:18 -0000 On 2021-09-28 00:19, Takashi Yano via Cygwin wrote: > On Mon, 27 Sep 2021 23:22:30 -0600 > Brian Inglis wrote: >> On 2021-09-27 22:49, Mark Geisert wrote: >>> Hi Thomas, >>> >>> Thomas Wolff wrote: >>>> >>>> Am 26.09.2021 um 20:37 schrieb Thomas Wolff: >>>>> >>>>> Am 26.09.2021 um 11:50 schrieb Mark Geisert: >>>>>> 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 and it failed; I just didn't find it important enough to >>>>> report it here... Thanks for the plan to fix it. >>>>> >>>>>> 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. >>>> As we're at it, what's the purpose of a cygwin-internal clipboard >>>> format at all? >>>> Copy/paste between 32bit/64bit mintty works; mintty uses Windows >>>> CF_UNICODETEXT clipboard format. >>> >>> The cygwin-internal clipboard format records a timestamp and content >>> length when Cygwin (or putclip) updates the clipboard contents.  This >>> allows 'stat' and fstat() to show something sensible for >>> /dev/clipboard.  The latter feature went into Cygwin 1.7.13. >>> >>> Other than that, not much difference to CF_UNICODETEXT ;-). >> >> Would it perhaps make sense to include struct stat with appropriate >> entries rather than a couple of adhoc members unrelated to much else? > > struct stat also has different size between 32 and 64 bit environment, > therefore, it does not resolve the issue. I didn't think any of those types varied by architecture, given the same underlying file systems are supported, except the trailing long st_spare4[2]; if it does, your proposal is better. > I imagine using structure such as > typedef struct > { > struct { > int64_t tv_sec; > int64_t tv_nsec; > } timestamp; > int64_t len; > char data[1]; > } cygcb_t; > rather than > typedef struct > { > struct timespec timestamp; > size_t len; > char data[1]; > } cygcb_t; -- Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada This email may be disturbing to some readers as it contains too much technical detail. Reader discretion is advised. [Data in binary units and prefixes, physical quantities in SI.]