DMARC-Filter: OpenDMARC Filter v1.4.2 delorie.com 61Q6mFH3940029 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 61Q6mFH3940029 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=YN0EeVq6 X-Recipient: archive-cygwin AT delorie DOT com DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0DE8C4BA23CE DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com; s=default; t=1772088495; bh=qj06GOO/7jKPfisOu78+bdHfH7u8kpk8IOPV1TjytaU=; h=Date:To:Cc:Subject:References:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=YN0EeVq6o5Nx9MsdLXF+WDMREz4v8ZE7DbhsL08ayvk0OgdpJApA5yzYbc9eQg6ae tgg3kqR1aqxlmd0Q9WD531QOz3oG4d7SBUveuSQ4f1+CWKpYfyuvdn94DjxvKd6LK3 iaaLUomnv+R0YVTv4n64anaRZIEHaXNDqMs9EbVI= X-Original-To: cygwin AT cygwin DOT com Delivered-To: cygwin AT cygwin DOT com DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 925E44BA23CA ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 925E44BA23CA ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1772088475; cv=none; b=uTmYgPLmA0MrHG2z9WmDag2AZuDWx0XE2IP+4LLvJ/C5mjcA2/HFM1JMQWgeYHmhFoD6Gqe0SfoDuwvfopmz3peRPDU0dqfbCNWSo3+8VFgoVdCbpwOKZulYbrjIR+TwvdDgbXZQdiCJoSsdAk91ftfVpEzaMpHINN+bWAvWK9U= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1772088475; c=relaxed/simple; bh=5cELe2VnS4FCUMnQZ7D4zIMttHhPrv7Nlsp1XC5/fj0=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=VJn7ZoslI6SDQQhuGTnOBpI5DYCXNCaOnZiOBq43ePRpkor7n/fZAUbdjmMXGPiMngBnVN27Dhu7RUWO/UAs6yDGnoDsbLZuFrdEz9oy9/oGYl6BkiPxtOQIXI+AapTZ47z4hHaulwayAiKWmzSx/l3mzBkv3fgibQ2oRFN8/lc= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 925E44BA23CA Date: Thu, 26 Feb 2026 01:47:51 -0500 To: KENNON J CONRAD Cc: General Cygwin discussions and problem reports Subject: Re: Memmove causing program crashes, giving SIGTRAP in GDB(?) Message-ID: 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> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1044918836.1507810.1772086967212@connect.xfinity.com> 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: Glenn Strauss via Cygwin Reply-To: Glenn Strauss 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" 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