| delorie.com/archives/browse.cgi | search |
| DMARC-Filter: | OpenDMARC Filter v1.4.2 delorie.com 61QMUwME1270370 |
| Authentication-Results: | delorie.com; dmarc=pass (p=none dis=none) header.from=cygwin.com |
| Authentication-Results: | delorie.com; spf=pass smtp.mailfrom=cygwin.com |
| DKIM-Filter: | OpenDKIM Filter v2.11.0 delorie.com 61QMUwME1270370 |
| Authentication-Results: | delorie.com; |
| dkim=fail reason="signature verification failed" (1024-bit key, unprotected) header.d=cygwin.com header.i=@cygwin.com header.a=rsa-sha256 header.s=default header.b=JKaPVS4S | |
| X-Recipient: | archive-cygwin AT delorie DOT com |
| DKIM-Filter: | OpenDKIM Filter v2.11.0 sourceware.org 18D734BA23CA |
| DKIM-Signature: | v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com; |
| s=default; t=1772145057; | |
| bh=W43JDXgHT1WRHda28vljAC9WPjFJKmJKOOP0z3QbHuw=; | |
| h=Date:Subject:To:Cc:References:In-Reply-To:List-Id: | |
| List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: | |
| From:Reply-To:From; | |
| b=JKaPVS4SKUYxw34u8d9HJQsMZGjsb6MkNz3XDBbaOVVnpyupy2XpweKhLiScl9Fkt | |
| SXjnNda1DNTXsdF9LCr4rKjcANBaiXnCqoZBdSg27AWGBZfk1jrZMzgtXXRySIp/q4 | |
| nu0OYjgczRFXrbxHzRgcYZFrlFjpHlrRf4SByEoU= | |
| X-Original-To: | cygwin AT cygwin DOT com |
| Delivered-To: | cygwin AT cygwin DOT com |
| DMARC-Filter: | OpenDMARC Filter v1.4.2 sourceware.org EABD94BA2E11 |
| ARC-Filter: | OpenARC Filter v1.0.0 sourceware.org EABD94BA2E11 |
| ARC-Seal: | i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1772145006; cv=none; |
| b=pkXMRYx6OBhVvitN7+Pe3Q6Agyequs3aPetKnaQjfSW2hYqMOAQm0oJhtwpdu2Y9q4gt3RwTZdbHCcpK3WCxziHiObOYCaIrTVk/9fMnREV4x7vjKxts6+EvfqRBV5Nz9pHS9r3BU0i2eJEmNTFuwxoKi3uF6gBQQ2m7Pg99wYM= | |
| ARC-Message-Signature: | i=1; a=rsa-sha256; d=sourceware.org; s=key; |
| t=1772145006; c=relaxed/simple; | |
| bh=mvy7vh4YI8oa3GmWkCHkcSCg9qtxT8TunH+ascnAWjE=; | |
| h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; | |
| b=B0t2Tpld8dLUFgbXU0Bx52Kc76yz1ccYrE42YQuEmn1WkJE1MqolDqLyH9+4qcdVuqnYiD5homnwtBddsvApzFIrhGz8Goxk6qcrVq9wl0W7AXsqrrLLVAYRhBBWyuE3KeWewcDD2+n9M/MjUg5ZqtF/l7xjuZBhzNye1IG+seg= | |
| ARC-Authentication-Results: | i=1; server2.sourceware.org |
| DKIM-Filter: | OpenDKIM Filter v2.11.0 sourceware.org EABD94BA2E11 |
| X-Barracuda-Envelope-From: | moss AT cs DOT umass DOT edu |
| X-Barracuda-RBL-Trusted-Forwarder: | 128.119.240.136 |
| DKIM-Filter: | OpenDKIM Filter v2.11.0 mailsrv.cs.umass.edu B7D995BDCC |
| X-Barracuda-RBL-Trusted-Forwarder: | 172.26.69.67 |
| Message-ID: | <399745a1-429a-ebb4-0f67-c32f6282caa6@cs.umass.edu> |
| Date: | Thu, 26 Feb 2026 17:30:04 -0500 |
| MIME-Version: | 1.0 |
| User-Agent: | Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 |
| Thunderbird/102.15.1 | |
| Subject: | Re: Memmove causing program crashes, giving SIGTRAP in GDB(?) |
| X-ASG-Orig-Subj: | Re: Memmove causing program crashes, giving SIGTRAP in GDB(?) |
| To: | KENNON J CONRAD <kennonconrad AT comcast DOT net>, |
| Dimitry Andric <dimitry AT unified-streaming DOT com> | |
| Cc: | KENNON J CONRAD via Cygwin <cygwin AT cygwin DOT com> |
| References: | <547312365 DOT 1464244 DOT 1771958282029 AT connect DOT xfinity DOT com> |
| <aZ7PrbisVR1R4A7v AT dimstar DOT local DOT net> | |
| <1670201592 DOT 1489273 DOT 1772043520008 AT connect DOT xfinity DOT com> | |
| <e91d8b5b-2690-4271-aa74-e6226440e33d AT SystematicSW DOT ab DOT ca> | |
| <1044918836 DOT 1507810 DOT 1772086967212 AT connect DOT xfinity DOT com> | |
| <1579472684 DOT 1508349 DOT 1772092747339 AT connect DOT xfinity DOT com> | |
| <aaABFf5iEowV1l7I AT xps13> <1148572549 DOT 1808180 DOT 1772097444036 AT mail DOT yahoo DOT com> | |
| <1901597260 DOT 1508573 DOT 1772100378936 AT connect DOT xfinity DOT com> | |
| <0C965DD0-856E-41FF-B5A4-15E472292A32 AT unified-streaming DOT com> | |
| <483908609 DOT 1508714 DOT 1772103775739 AT connect DOT xfinity DOT com> | |
| <2346fd41-2500-0db6-5849-6788174b5a1d AT cs DOT umass DOT edu> | |
| <1462848037 DOT 1521935 DOT 1772136952077 AT connect DOT xfinity DOT com> | |
| In-Reply-To: | <1462848037.1521935.1772136952077@connect.xfinity.com> |
| X-Barracuda-Connect: | mailsrv.cs.umass.edu[128.119.240.136] |
| X-Barracuda-Start-Time: | 1772145003 |
| X-Barracuda-Encrypted: | TLS_AES_256_GCM_SHA384 |
| X-Barracuda-URL: | https://barramail.cs.umass.edu:443/cgi-mod/mark.cgi |
| X-Barracuda-BRTS-Status: | 1 |
| X-Virus-Scanned: | by bsmtpd at cs.umass.edu |
| X-Barracuda-Scan-Msg-Size: | 2192 |
| X-ASG-Debug-ID: | 1772145003-24039d07336b500001-w5GHUG |
| X-Barracuda-Spam-Score: | 0.00 |
| X-Barracuda-Spam-Status: | No, SCORE=0.00 using global scores of TAG_LEVEL=3.5 |
| QUARANTINE_LEVEL=10.0 KILL_LEVEL=9.7 test= | |
| X-Barracuda-Spam-Report: | Code version 3.2, rules version 3.2.3.125474 |
| Rule breakdown below | |
| pts rule name description | |
| ---- ---------------------- -------------------------------------------------- | |
| X-BeenThere: | cygwin AT cygwin DOT com |
| X-Mailman-Version: | 2.1.30 |
| List-Id: | General Cygwin discussions and problem reports <cygwin.cygwin.com> |
| List-Archive: | <https://cygwin.com/pipermail/cygwin/> |
| List-Post: | <mailto:cygwin AT cygwin DOT com> |
| List-Help: | <mailto:cygwin-request AT cygwin DOT com?subject=help> |
| List-Subscribe: | <https://cygwin.com/mailman/listinfo/cygwin>, |
| <mailto:cygwin-request AT cygwin DOT com?subject=subscribe> | |
| From: | Eliot Moss via Cygwin <cygwin AT cygwin DOT com> |
| Reply-To: | Eliot Moss <moss AT cs DOT umass DOT edu> |
| Sender: | "Cygwin" <cygwin-bounces~archive-cygwin=delorie DOT com AT cygwin DOT com> |
On 2/26/2026 3:15 PM, KENNON J CONRAD wrote:
> Hello Eliot,
>
> Yes, that helps a lot. With the frame set to the one for memmove, the RSI register contains 0xa00035e0e. With the candidates_index address of 0xa00034460, that indicates the RSI register is 0x19AE more than the array start index and corresponds to index 3287 of the uint16_t array. The array index of the rightmost element that should be moved is 3359, so RSI holds an array index that is 72 less than the last index that should be moved. But since the RSI is already set up for the next iteration of REP MOVSQ, it seems that 68 array elements should have been moved prior to the REP that gets the SIGTRAP. So I checked the index array, and found it contains duplicate values of 2028 at both array indexes 3291 and 3292 (elements 3292 and above have been copied from elements 3291 and above). There should not be any duplicate values in the active portion of the array except during the move. So it seems that 17 REP MOVSQ's were completed successfully before the SIGTRAP prevented the
18
> th move from being completed. It shouldn't stop until the 767th array element is moved, so this is pretty early in the desired REP MOVSQ iterations. Interestingly, the DF is not set in EFLAGS at the point where the SIGTRAP is issued (eflags 0x246 [ PF ZF IF ]) - I thought it should be set for backward REP MOVSQ's.
I know it's a low probability for a cause, but I wonder if either the
hardware or the OS have some issue with proper restartability of the
REP MOVSQ under some weird circumstance. If the hardware/firmware
does not save the in-flight register information correct (again, in
some weird and rare situation) then restarting the instruction could
fail. Might be worth:
(a) trolling the web to see if there are reports of issues around this
instruction, Intel firmware fixes, etc. (An instruction like REP
MOVSQ is almost certainly implemented with a microcode loop, etc.)
(b) trying this exact code with a substantially different CPU model
(which might tend to avoid any microcode bug in the model you're
using).
Again, low probability, but ...
Regards - EM
--
Problem reports: https://cygwin.com/problems.html
FAQ: https://cygwin.com/faq/
Documentation: https://cygwin.com/docs.html
Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |