DMARC-Filter: OpenDMARC Filter v1.4.2 delorie.com 61QLgriE1253228
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 61QLgriE1253228
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=ZaWPG5T6
X-Recipient: archive-cygwin@delorie.com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 04B654BA23C6
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
	s=default; t=1772142171;
	bh=eQX7SYuuidWIQRXMCgi5G9+EC58NpqqVh+rcLtd6MSs=;
	h=Subject:In-Reply-To:Date:References:To:List-Id:List-Unsubscribe:
	 List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:
	 From;
	b=ZaWPG5T62/Ewywr4ccqlHRdn/mwXwlQxOXhR690d7fId6fQQyIEn54nYWFQGQ3QQM
	 EgsHTU2eai/1x9wNfRQD1ujxD1q/DrR6LHyAP/eicLtSazWbAkemaVFjzcK8Fckzuu
	 SB28leMqvYx6ayDdiekIy0zGKbUg/MQerJ98+yo0=
X-Original-To: cygwin@cygwin.com
Delivered-To: cygwin@cygwin.com
DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 559C24BA2E16
ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 559C24BA2E16
ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1772142151; cv=none;
 b=LnznuTMMcytGmznHezQMv3MTUnUNVTgWvMPDArnFenxGsA3WAX8AI6uXsS2csvxDHR9qo/N+A6Z5aucc0JIZQwix+fckI0ucQ4eSI+sL9M12iADjzkRS9tlutXeidOn6jnEh3kqrcjJz5EwH3CXrwHqDJwEuD4y86otzxqhPd3o=
ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key;
 t=1772142151; c=relaxed/simple;
 bh=hNJcdgljjqsy4s0mzACS5cClFF5NJynMqK6ArpKwM5w=;
 h=DKIM-Signature:Mime-Version:Subject:From:Date:Message-Id:To;
 b=UAMTgeTWNzwapJeMxhEJI5XLJi8OmnBzjQyhQlLiOVdrpL5FTqcvHUHXIhStepn90lGorfjTh9gO3AsUdg8u9VPm3hJgdsZ95/e01Jch9JtCt/Cq1jL9qcC9ULcfiZ2NA+435miIc6yJ5Et3+1zPtFitGFsGrXt7eerF1UClwRE=
ARC-Authentication-Results: i=1; server2.sourceware.org
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 559C24BA2E16
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1772142150; x=1772746950;
 h=to:references:message-id:content-transfer-encoding:cc:date
 :in-reply-to:from:subject:mime-version:x-gm-gg:x-gm-message-state
 :from:to:cc:subject:date:message-id:reply-to;
 bh=3MgxMm7hLQsHPR4wLnAYJNKz1wQUXcrv5QCUy8iHA4Q=;
 b=e4cbPPx7mthBkcmEAw3VGyvSObJfbOBoXLkW5wp5FXK1HvhyDzCxCW+gJ//mmATzSL
 anFETFEscQuxzsnUNIlQmEBisYVXBcDJaMtqH7FpzWLSwxI5YiZiVY/5FmAQr8oR9ovU
 p6JBAJNkY//adkyKHt4vGtw6iDhuELWzz2gHrfNzHqLrA5+Ht0Sdtbg1FvsvjdGEHAQC
 77tulKzcAqJJcnm6ds6Rb3jvYiXSMFIPnroygInJp20Baj/esYm3jJHeynicIGdvP+NC
 e8wPGBFVyxaWXsOqQ+yo891RSdp0rwAdGu8zI594J5hh+MV10qsKAVRr7/TiPUMapy5f
 vdjA==
X-Forwarded-Encrypted: i=1;
 AJvYcCWBriPP8gnh91f4Qo+URZKupMG7+pUsdr0njuTyKvzTEsEc+6smL3Yy4wwqu/AaLy3bC6onnyQ=@cygwin.com
X-Gm-Message-State: AOJu0YxJyn2znF+cQJ82ynnppMKcGOMc6S75BmE+wu64GIKlk8FsmRrg
 KeWLQAi5/XPBnepJxeoAkheOL51W7HvGRl+DIDLIWFZbo2QhwC6pF3j+ma8VmD0IyT0=
X-Gm-Gg: ATEYQzwiw2f2MPLsw2vhxNsSdbZAEVCh+j29AScmMVfJqvv2Q7j42m+z0ODva9HjRuM
 p26edUtxYbIouRUywQn5HUaSMN43Ql/aTyfvNH7GKAjt45QUQlBh0o0CPa6pChdDhv3SQ5w5IVl
 UhspfufWWeB2SbybDoLvbe3khW1UdkNvgjPPq5JXicwCzW4SqZ5FOIi5L2BckKxK+qglJaALC7y
 WRPdCm9RUGlQqP9WQLDtVqHplSnkPkgRdHxHM/BWho0uDAjAXGAebvhaCRdXo0SHk699ggbEpei
 48FFGyXfrJQVdhBYF7Wc+Tl3uwsxGTr+BnCcxClOu0c0f7K7t10TuyqL+lh4fNu+9IHYUHU1kSa
 lKqN1vOE27WbnD+WKXWKgLL4WD3r1MYeNJwbWK+p8AEqwQvc7bTGTXusipLMSEIfGy8u9KfXwEq
 cBRsOG59nO6zefHV+TjXurlUIR1nuB1QMfFuEJpuELYZCUn4y0B3bY5dtxHJDtYzME6w==
X-Received: by 2002:a17:907:868b:b0:b8e:a024:1c81 with SMTP id
 a640c23a62f3a-b9376365dc0mr31175066b.7.1772142150074; 
 Thu, 26 Feb 2026 13:42:30 -0800 (PST)
Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.700.81.1.4\))
Subject: Re: Memmove causing program crashes, giving SIGTRAP in GDB(?)
X-Priority: 3
In-Reply-To: <957583332.1523179.1772138829815@connect.xfinity.com>
Date: Thu, 26 Feb 2026 22:42:28 +0100
Message-Id: <6E812632-0E73-464A-AAB9-DC5BC5546B4C@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>
 <957583332.1523179.1772138829815@connect.xfinity.com>
To: KENNON J CONRAD <kennonconrad@comcast.net>
X-Mailer: Apple Mail (2.3826.700.81.1.4)
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: Dimitry Andric via Cygwin <cygwin@cygwin.com>
Reply-To: Dimitry Andric <dimitry@unified-streaming.com>
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>

If such a crash occurs, can you do a "thread apply all bt" in gdb? This will show what all the other threads are doing. I'm betting some other thread is calling memcpy or some other function that is messing with the direction flag.

-Dimitry

> On 26 Feb 2026, at 21:47, KENNON J CONRAD <kennonconrad@comcast.net> wrote:
> 
> 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
