DMARC-Filter: OpenDMARC Filter v1.4.2 delorie.com 61QKGGNR1227298 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 61QKGGNR1227298 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=BpCvA9yH X-Recipient: archive-cygwin AT delorie DOT com DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CF2A34B9DB70 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com; s=default; t=1772136975; bh=1Oums99MOh9OBYMkU9c2iwX7ZHutRR4LPMOojQnqvxQ=; h=Date:To:Cc:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=BpCvA9yH1LSjejOFHtc7YzVHQuVboGPDj09ANKIf5dhBe19QUDxGHdOaBL8Z9p5jQ 8czIFSIlRiqCCCjklD9JpGOkKeffUTOvwTMJKtheZAWfrpLNEhy9Q1bz77aIPOGqCi 9SDeLtjnQ80eegZw4vrUFAdDBF3KtFMHDCUPGYJE= X-Original-To: cygwin AT cygwin DOT com Delivered-To: cygwin AT cygwin DOT com DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C6CB94B9DB41 ARC-Filter: OpenARC Filter v1.0.0 sourceware.org C6CB94B9DB41 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1772136957; cv=none; b=GNdES4M92NEcsBp1CCKbuZLkrFzxHlNojgBhvJqlns8lXB9aYFX66/EiS1gI05s+Ig2R5+bCOAv/lTcGH58ZCYWCYjuszK+EZp46LIE86kFjSuzzsb4NslJYAP4N3wM7p8jFVfkWBrRDmESzBX5igthVPBEKF3+Q/TNIuhiMTzs= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1772136957; c=relaxed/simple; bh=/G8+lpnDf6BUtx2kuB6ZfhhyS0sM+Bb7Q7h43MWlbS0=; h=DKIM-Signature:Date:From:To:Message-ID:Subject:MIME-Version; b=V5PbVzdv6E0iVrzdmP1nPSCDl6kXRFGoI6KGb83IeXXPr2TvzAI5mKW7/HJbreyrTgTCAhXOcF4/yxjWsqPVHbvzcl+BileYulEULrA3fVUIJOvwFcZOJXgf/3sAejvZVHErcyVeeCRgUa6W+gaM0cCVnz/RsLfvk4h/+SBqd50= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C6CB94B9DB41 Date: Thu, 26 Feb 2026 12:15:52 -0800 (PST) To: Eliot Moss , Dimitry Andric Cc: KENNON J CONRAD via Cygwin Message-ID: <1462848037.1521935.1772136952077@connect.xfinity.com> In-Reply-To: <2346fd41-2500-0db6-5849-6788174b5a1d@cs.umass.edu> References: <547312365 DOT 1464244 DOT 1771958282029 AT connect DOT xfinity DOT com> <1670201592 DOT 1489273 DOT 1772043520008 AT connect DOT xfinity DOT com> <1044918836 DOT 1507810 DOT 1772086967212 AT connect DOT xfinity DOT com> <1579472684 DOT 1508349 DOT 1772092747339 AT connect DOT xfinity DOT com> <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> Subject: Re: Memmove causing program crashes, giving SIGTRAP in GDB(?) MIME-Version: 1.0 X-Priority: 3 Importance: Normal X-Mailer: Open-Xchange Mailer v7.10.6-Rev83 X-Originating-IP: ::ffff:50.47.202.14 X-Originating-Port: 35148 X-Originating-Client: open-xchange-appsuite X-CMAE-Envelope: MS4xfJ9oJRgNnzdQS2i0HQHSbJsmY3d0KwBet94018jJdxooT03oAq1O/yJR1k7UBPcsXbgQUMAnrA4rFgEUPbka5Kdd16iqA/wPNfUhKK9oKtJ0uqF/u1oh 2aYdd1R1e/xFwj754c0buHaZUXeXQ9anH2yUCrxrhrw6VP+utgG8Gya8Ua1YUdwp20zFDUZJYMxBreTZfbIRGlr6z7zCAkODyICFHwBlJHnbBUmkG+QBpjxh d29J8gIAMwnlftXtqN2jVdvDHauDPQpgdhGmpmswaibCa83pjHxehS40mZhnmk65 X-BeenThere: cygwin AT cygwin DOT com X-Mailman-Version: 2.1.30 Precedence: list List-Id: General Cygwin discussions and problem reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: KENNON J CONRAD via Cygwin Reply-To: KENNON J CONRAD Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: cygwin-bounces~archive-cygwin=delorie DOT com AT cygwin DOT com Sender: "Cygwin" 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. Best Regards, Kennon > On 02/26/2026 5:25 AM PST Eliot Moss wrote: > > > On 2/26/2026 6:02 AM, KENNON J CONRAD via Cygwin wrote: > > > Thanks for checking and sharing your thoughts. This is what I would expect, so at least I'm not crazy :) > > I really need to see the values of the registers in memmove, hopefully it's just a matter of continuing to learn gdb. > > The command is "info registers", of "info r" for short. You can also print an > individual register using (say) "print $rax" (prefix the register name by $) > or "info r rax". If you're stepping, you can set up a *layout* that shows all > the register values as you step along. > > You also might consider using a reverse debugging tool like the "undo" debugger. > They track enough information to allow them to (effectively) execute backwards > from a point. Not sure if any work under cygwin, though. > > By the way, I got the commands for printing individual registers with a simple > web search :-) ... > > HTH -- Eliot Moss -- 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