DMARC-Filter: OpenDMARC Filter v1.4.2 delorie.com 61Q7pxWx962199 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 61Q7pxWx962199 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=RxuZQzbF X-Recipient: archive-cygwin AT delorie DOT com DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 005C84BA23F9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com; s=default; t=1772092318; bh=0HyeVQAZ1mxPKCsDfIWaxmJwxAshb9XO9+ub2g12bP8=; 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=RxuZQzbFFShTdrzbHG38ik6kHZ7tXdrTd64XA8bJrH7JKzX5jwcAjnz9qDoQwPEEW LJArZCi1CR4tuRae5xiP8fXWWSBfBWwQoOXz++d3LAzM/icS/OWc1xNX8+ApT02LhA qefVdIjuClZJX0XaHuUQ1UUGbZfkPZQ6x3dxxJYU= X-Original-To: cygwin AT cygwin DOT com Delivered-To: cygwin AT cygwin DOT com DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 36E994BA2E15 ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 36E994BA2E15 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1772092298; cv=none; b=GDO7BcZ50ht01Bf1o/Wab5XJMyDfbiroIzZ06JkeJeXPtPq695ZBlGeEtzbktCDe/HDm/hB97aWiNGfcR6hT8Z1Lue8hgam8GyMNr2hVjTdC8RkQ/XXJu5M+BPO/MwZSwv5zDu910saqgqo0ZLUzsGVIS2H1sinFsD6JMrak59c= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1772092298; c=relaxed/simple; bh=ljWsJjmA9zwS9GjdygnK9apJoSyOmw15W09VJQsbj9o=; h=DKIM-Signature:Date:From:To:Message-ID:Subject:MIME-Version; b=LsyG5IDKHzhGO6zGL/vhS+kAz7hgCHpPv8buWUwCRD1NOYhWGEj1DQHrr3v9mWK5d+7Zp2QZ9GQIE2yzoycbse4y8bJfe1WIyAwVVzQAnFURb7ixhQ0a+4gQ635IlCIcplMQZwEqQFUSVPImATx19gRqmWLCf6++DZFUuHXx0Hc= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 36E994BA2E15 Date: Wed, 25 Feb 2026 23:51:35 -0800 (PST) To: Glenn Strauss Cc: General Cygwin discussions and problem reports Message-ID: <1324758034.1508322.1772092295385@connect.xfinity.com> In-Reply-To: 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> 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: 36258 X-Originating-Client: open-xchange-appsuite X-CMAE-Envelope: MS4xfItqpwuPPGDj57aS37pUaoLk9iyqRfQnBjndWP1teudMWPGup+JcLMyMzdkqaQK2CE55KvKmuQRGxfIKYrXL5HtRjg7QR6xoqkgFJBzEleQk0n4hf5Or NLNrWmatHtCzGqG/l5ZWytq20vJu98Myo6K0KCryfp7Bj4IuefMkWR1SVt7dQvyS04eJ64dJPIX2d5IuyKyuPgBXLdGLByRO+shhS3kWqVRMGBtmsRlJ+XKT lfXAqz6DpAomb78a7nicNN66eOCMTBP/LZ80TwrC6Kw= 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" Hi Glenn, Thanks for the tips. I think I mentioned that I am a first time user of gdb, so tips like this are very helpful. I was having problems debugging at first, getting nothing useful, and did a web search and found a suggestion to compile with -O0 and -g. Once I did that change in the Makefile I got the first result I posted on the first try. Then for today's run I switched the -g to -ggdb to see if it made any difference and didn't notice anything. This memmove call is for clearing a spot in the ranked list to insert a new entry in the list by moving everything after it 2 bytes to the right. So the intent of the code is to move each byte pair (uint16) to the right by 2 bytes starting at the end of the list (deleting the last entry if the list is full, which has not been in both crash cases). Best Regards, Kennon > On 02/25/2026 10:47 PM PST Glenn Strauss wrote: > > > On Wed, Feb 25, 2026 at 10:22:47PM -0800, KENNON J CONRAD via Cygwin wrote: > > Hi Brian, > > > > I installed the version of the cygwin-debuginfo that is on my test computer to the build machine (version 3.6.6-1). I put the memmove back in the code in place of the bloated code that has been running the past 4 days without any problem (and the past ~10 years before changing to memset) and got another SIGTRAP in gbd on that memset within 2 hours. The backtrace looks very similar: > > When debugging issues with low-level library calls such as memmove, > I highly suggest testing using reduced compiler optimization settings. > > If you can, pull the function in question into a separate .c or .cxx > file, and compile that translation unit with -Os -ggdb. If you can > reproduce the issue, compile that translation unit with -O0 -ggdb and > try again. > > Question: are you replacing old code with memmove() from address x+y to > address x, i.e. shifting left? Or are replacing existing code with > memmove() and shifting right onto overlapping ranges? In both cases for > memmove(), the resulting assembly code should detect if the ranges > overlap and should not overwrite existing data before it gets moved. > > Cheers, Glenn -- 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