DMARC-Filter: OpenDMARC Filter v1.4.2 delorie.com 61QKlYsI1237328
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 61QKlYsI1237328
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=h0RWZcwF
X-Recipient: archive-cygwin@delorie.com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 78D7A4BA2E10
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
	s=default; t=1772138853;
	bh=cG6RPtQUCxNzgZ5s7+1YCAoqMYRdXCej1AMqCzXJqU0=;
	h=Date:To:In-Reply-To:References:Subject:List-Id:List-Unsubscribe:
	 List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:
	 From;
	b=h0RWZcwF8Wvzdwg9u3as8VYjhxph1hknWhj+p7ZDNPa6DMBSNqSmUCMU1NaJXQud5
	 tk727m3N3qyIeFsB7uEmWW9hoRoFO/0T/XOxRfN93jvUYZvdeTEKx8BE3hGvcutiqh
	 zKZuVN7uyvWSh4HaTN37EsePiD7VOa2PONa1Rs9U=
X-Original-To: cygwin@cygwin.com
Delivered-To: cygwin@cygwin.com
DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2C49D4BA2E0A
ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 2C49D4BA2E0A
ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1772138834; cv=none;
 b=E8OPA7GRuj/Nc98yzzsgThxdfqAfPlPzcXUFAo7kJ/fbcEKlV8ZnBqMV0taDbb/M/Yx/++qd/xDVdBUkgLXVFeZ0u2nFva2K87+9ru4kgJiMjcaet8p0Az5NH+3Nv2skoahVdWtf+zVHE+BGquLRZ6jMbBOZ3e2OauZflUHBvvE=
ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key;
 t=1772138834; c=relaxed/simple;
 bh=vIRCFku5IEmNSJwxVLX0XtOwGNe/2J2wnNT3xCO+mas=;
 h=DKIM-Signature:Date:From:To:Message-ID:Subject:MIME-Version;
 b=EmeRqMp5B3I0zqbcLLhkyeN5IU2tZ7uJ5ojNBoGzdF1TtpK2f+C120NBJTVsNtTz4EvrumpYZUNJHjK6ZHn1+i9YRJatnmf5HqcFAsBdGH08Q1E4Zr8/AXwNPw+UT5TtvqcBvnjXc5F5sC6UqeeATJ3ScYNRDdGZEWHF+cuYQzA=
ARC-Authentication-Results: i=1; server2.sourceware.org
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2C49D4BA2E0A
Date: Thu, 26 Feb 2026 12:47:09 -0800 (PST)
To: Dimitry Andric <dimitry@unified-streaming.com>
Message-ID: <957583332.1523179.1772138829815@connect.xfinity.com>
In-Reply-To: <609655EE-8E9D-4522-A05C-F74C3FC89583@unified-streaming.com>
References: <547312365.1464244.1771958282029@connect.xfinity.com>
 <aZ7PrbisVR1R4A7v@dimstar.local.net>
 <1670201592.1489273.1772043520008@connect.xfinity.com>
 <e91d8b5b-2690-4271-aa74-e6226440e33d@SystematicSW.ab.ca>
 <1044918836.1507810.1772086967212@connect.xfinity.com>
 <1579472684.1508349.1772092747339@connect.xfinity.com>
 <aaABFf5iEowV1l7I@xps13>
 <1148572549.1808180.1772097444036@mail.yahoo.com>
 <1901597260.1508573.1772100378936@connect.xfinity.com>
 <0C965DD0-856E-41FF-B5A4-15E472292A32@unified-streaming.com>
 <483908609.1508714.1772103775739@connect.xfinity.com>
 <2346fd41-2500-0db6-5849-6788174b5a1d@cs.umass.edu>
 <1462848037.1521935.1772136952077@connect.xfinity.com>
 <609655EE-8E9D-4522-A05C-F74C3FC89583@unified-streaming.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: 65182
X-Originating-Client: open-xchange-appsuite
X-CMAE-Envelope: MS4xfJuqd7PVzXx0l3c3JIMXQFOml7LFmJphRPjsoVN/JO9DP8VgvatL0QSCa62P3q/0Ln54LRBLHfS9t6hlXuWV8w+lP1AwhoH7sH1QlYZoR0YrJWIRXeLj
 IPxS9/BfcX9h0B0It+n5jhlYWec2z0llCpO5zlaugTKH1zgIDN5pd1G8i8Ym+3xeag0jEL4lEZZTqns46AFsW4BUWyk45aM9vr01UJLyZ5kLEeeavsKcJuZu
 YZS5U3eQRuLpWbOanacThNK69fLoXi1EB76s+CpNCFrJ/czx3LvwofN6eI8DstIY
X-BeenThere: cygwin@cygwin.com
X-Mailman-Version: 2.1.30
Precedence: list
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
 <mailto:cygwin-request@cygwin.com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-request@cygwin.com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
 <mailto:cygwin-request@cygwin.com?subject=subscribe>
From: KENNON J CONRAD via Cygwin <cygwin@cygwin.com>
Reply-To: KENNON J CONRAD <kennonconrad@comcast.net>
Cc: KENNON J CONRAD via Cygwin <cygwin@cygwin.com>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: cygwin-bounces~archive-cygwin=delorie.com@cygwin.com
Sender: "Cygwin" <cygwin-bounces~archive-cygwin=delorie.com@cygwin.com>

Yes, lots.  7 threads were running at the point of the crash  87% load on my i7-4790k.  I did a little research since the last post.  The memmove code where the crash occurs is:

   0x00007ff96ba812a8 <+136>:	std
=> 0x00007ff96ba812a9 <+137>:	rep movsq %ds:(%rsi),%es:(%rdi)
   0x00007ff96ba812ac <+140>:	cld

This sets the direction flag immediately before the rep movsq and clears the direction flag immediately after the rep movsq.  Yet when gdb breaks it shows the direction flag is not set:

eflags         0x246               [ PF ZF IF ]

  Would a forward move on overlapping data cause the SIGTRAP?  Could the code have moved to a different core?  Or could it have been interrupted by some other task that corrupts the flag?  As I mentioned earlier, the rep movsq is only failing once per several million times memmove is called so it seems likely to be something along those lines.

-Kennon


> On 02/26/2026 12:20 PM PST Dimitry Andric <dimitry@unified-streaming.com> wrote:
> 
>  
> Is there some concurrency going on? Maybe some other part of the program is flipping the direction flag?
> 
> -Dimitry
>

-- 
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
