DMARC-Filter: OpenDMARC Filter v1.4.2 delorie.com 62D5OG54370075 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 62D5OG54370075 Authentication-Results: delorie.com; dkim=pass (1024-bit key, unprotected) header.d=cygwin.com header.i=@cygwin.com header.a=rsa-sha256 header.s=default header.b=vlOFU+WK X-Recipient: archive-cygwin AT delorie DOT com DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1256F4C31822 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com; s=default; t=1773379455; bh=3wdjJ8lDFTaxaw85BQuKJskAqcQm+VligiORxgZNwXY=; h=Date:To:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=vlOFU+WKIO7QLrY2CTTYkRAO6LMaec7pt/aimFjgxmNDu70SmlhydSZbz3rzdeYTT UDWmZPjJyaV+RPtY/ZVDf0Gujl2b4k7RHRIyISC2iwPKBPw3miuYj6ZuQwHkM9YqjL oAfplw99NPWjYe79/myCleNtEvQn1yl6aTHXMk0E= X-Original-To: cygwin AT cygwin DOT com Delivered-To: cygwin AT cygwin DOT com DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 666814BBC0C6 ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 666814BBC0C6 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1773379404; cv=none; b=FJzFCc2lPWN8NwKP2S4MjGbGksb3KFBLbyDRMzHRBlDXnHGx4bqDobFMvrjl1g4AislBIpMAfsZkXGPzW9FpJw0vZh9cIY2p0xN9iXssrqmpo5ykZoPhXlYxgH6MjxxbFnJnJjGZFLdyg1zuOsCxjk2aCranihxGqOmLtl6EEqU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1773379404; c=relaxed/simple; bh=0+VfEVFX4spgrGuBksD1HYI7OBXNstVAl7ki80VvlB4=; h=DKIM-Signature:Date:From:To:Message-ID:Subject:MIME-Version; b=A7OJV4lzxzkHe/lXnzUz2TTDRJYG9w9UnWV1OEz9KaeFzEhlSwXZRZR0BRxrSQ3okFyz87XWdhohdsLrxdqxmvQ8lFNLcdPGIn8siNet4UBtSQobWaefs4ymmamdrFgFDcF7GAXC+WKNcCySjsnGZ5zAlHeOdmCadzKSvbT20ZY= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 666814BBC0C6 Date: Thu, 12 Mar 2026 22:23:20 -0700 (PDT) To: KENNON J CONRAD via Cygwin , Jon Turney Message-ID: <275464098.52532.1773379400076@connect.xfinity.com> In-Reply-To: <533298615.52416.1773378911433@connect.xfinity.com> 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> <533298615 DOT 52416 DOT 1773378911433 AT connect DOT xfinity DOT com> 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: 33754 X-Originating-Client: open-xchange-appsuite X-CMAE-Envelope: MS4xfMjdIUaAxNuHCG70p1opcwmYZGxKss6j72J6iPqCGz5Rhfpdj5HClTxDg1u3RALe3T8DCP3fSP4fDygdBBH15+2Zbgx57n3n50Nf0VSCRI3rWKpEjNRS qP8rSa7VtE6bInLxUXiC4x2F0DzpMjFyhmEO6gdLqJmSazXGHYwmruZWw5esYLy+jNfOmp9DnE/rUxjeq0PH9m7TQui9gEEiV+DY5eM9s15rV5YQN2ejFXDV cS3o23aKF20L/0xVDaDxh4PxqhtE/Hl8q/QEHTcevEk= 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" Corrections: Elements 973 - 976 would be moved on the next iteration of the REP MOVSQ. REP MOVSQ made it through 17 iterations > On 03/12/2026 10:15 PM PDT KENNON J CONRAD via Cygwin wrote: > > > Thanks, Jon. Setting cygwin-exceptions on does change the picture considerably, > but the picture of exactly what is happening is still cloudy for me. > > The program breaks at the same spot in memmove, which is now in frame 0: > REP MOVSQ %ds(%rsi),%es(%rdi) > > but now GDB says "received signal SIGSEGV, Segmentation fault." > > The EFLAGS register value is 0x10687 [ CF PF SF IF DF RF ]. > So DF is set (as it should be), which is different than without exceptions on. > > ds contains 0x2b (not relevant?) > es contains 0x2b (not relevant?) > rsi contains 0xa00034c1a > rdi contains 0xa00034c1c > The uint16_t array starts at address 0xa00034480 > Array elements 781 - 1045 are being moved to 782 - 1046 (backward move). > Elements 973 - 980 would be moved on the next iteration of the REP MOVSQ. > > I see no obvious reason for the segmentation fault. The array address looks correct, > the array indexes are valid, and the REP MOVSQ made it through 8 iterations before > the SIGSEGV happened, and the program does not crash using alternative code in place > of the memmove call. > > Is it possible some interrupt routine doesn't handle DF being set when it starts and > gets a segmentation fault that GDB would detect at this point in the code? > > > > I'd add to that a reference to [1] > > > > [1] https://cygwin.com/faq.html#faq.programming.debugging-cygwin > > > > Unfortunately, when investigating exceptions inside the cygwin dll, it's > > necessary to 'set cygwin-exceptions on', which will cause the debugger > > to actually stop at the point of the exception. > > > > (This explains why the specific exception is SIGTRAP, and why you get > > the all the extra frames for exception handling below memmove in the > > backtrace) > > > > -- > 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 -- 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