delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2026/02/27/14:50:31

DMARC-Filter: OpenDMARC Filter v1.4.2 delorie.com 61RJoVNu1753149
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 61RJoVNu1753149
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=wy6IthrZ
X-Recipient: archive-cygwin AT delorie DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 13CBA4B9DB6A
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
s=default; t=1772221829;
bh=yi0liP5oRzu5TiPquYUIWtz/jjx1TSPdUnAIxV5ydMw=;
h=Date:Subject:To:References:In-Reply-To:List-Id:List-Unsubscribe:
List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:
From;
b=wy6IthrZUC4zs3mXabRb8czrR/4RyLZdpvojjH8oUoDGc9eYVqOChBHD+TMKaVHYT
nJUC8ytGId61JWl88emz2vjrVMMM3FccDUvskV+EiTV/hFPt8RVgaiLMAkMVWx+AGF
3JbX/lxS2Mt1co1cMwS3AVUuTkhKA3D2EyrR7yks=
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0C3344BA2E1A
ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 0C3344BA2E1A
ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1772221780; cv=none;
b=N/P36tQo5Fm3WAUGQDyHJSgzsbqH6yV6lL81wsp9Cwsb7+3PLZNWLcMl2OYJZ6YlJKJ+liYe6yos1C2TvaYN51nnC1p8prXA6/INVlzFzGP8QNbAh5Upwjti1lXjQl4ok2gWbsueu6ASHzsa84ID6/T0yi8VJdXobJyPd+mnBXI=
ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key;
t=1772221780; c=relaxed/simple;
bh=H/vvqYHQ5Dev1wSnlq52DkeSdffDCT4W8QRXswGYdng=;
h=Message-ID:Date:MIME-Version:From:Subject:To:DKIM-Signature;
b=KL1ZpgYDc+Xax52x71cg61K/BdOmxBy6UmTGSySKIBCNfadbuly0iOqYmBEt7LVU5TOyiryeWP1xHSFLWgKeZxNxSELsv7GzYJGcEpYs/rFIwD0+0j6hKiWugARV2wGr06VMHyeuPGHKC7u9qCxmp2kQLRqD8tTPadAK0XkF6F4=
ARC-Authentication-Results: i=1; server2.sourceware.org
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0C3344BA2E1A
Message-ID: <45c133f7-8285-4cb3-9701-2642cb76ab37@SystematicSW.ab.ca>
Date: Fri, 27 Feb 2026 12:49:36 -0700
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: Memmove causing program crashes, giving SIGTRAP in GDB(?)
To: General Cygwin discussions and problem reports <cygwin AT cygwin DOT com>
References: <547312365 DOT 1464244 DOT 1771958282029 AT connect DOT xfinity DOT com>
<aZ7PrbisVR1R4A7v AT dimstar DOT local DOT net>
<1670201592 DOT 1489273 DOT 1772043520008 AT connect DOT xfinity DOT com>
<e91d8b5b-2690-4271-aa74-e6226440e33d AT SystematicSW DOT ab DOT ca>
<1044918836 DOT 1507810 DOT 1772086967212 AT connect DOT xfinity DOT com>
<1579472684 DOT 1508349 DOT 1772092747339 AT connect DOT xfinity DOT com>
<aaABFf5iEowV1l7I AT xps13> <1148572549 DOT 1808180 DOT 1772097444036 AT mail DOT yahoo DOT com>
<1901597260 DOT 1508573 DOT 1772100378936 AT connect DOT xfinity DOT com>
<0C965DD0-856E-41FF-B5A4-15E472292A32 AT unified-streaming DOT com>
<483908609 DOT 1508714 DOT 1772103775739 AT connect DOT xfinity DOT com>
<2346fd41-2500-0db6-5849-6788174b5a1d AT cs DOT umass DOT edu>
<1462848037 DOT 1521935 DOT 1772136952077 AT connect DOT xfinity DOT com>
<399745a1-429a-ebb4-0f67-c32f6282caa6 AT cs DOT umass DOT edu>
<1093316506 DOT 1533154 DOT 1772157883568 AT connect DOT xfinity DOT com>
<3e0de899-a7dd-8fea-7743-10e6b05cc6b6 AT cs DOT umass DOT edu>
<1990836634 DOT 1545853 DOT 1772216419837 AT connect DOT xfinity DOT com>
Organization: Systematic Software
In-Reply-To: <1990836634.1545853.1772216419837@connect.xfinity.com>
X-Stat-Signature: 5sb119511143kbf4w8xzn9sknkx4915w
X-Rspamd-Server: rspamout04
X-Rspamd-Queue-Id: 2923632
X-Session-Marker: 427269616E2E496E676C69734053797374656D6174696353572E61622E6361
X-Session-ID: U2FsdGVkX1+7OH27nkMaNPcKITyNYtPBfXltc82cBIo=
X-HE-Tag: 1772221778-846496
X-HE-Meta: U2FsdGVkX1+Xs7yE1g/sgtDJkR9wlUV9lXHrzWn/sSUV1Q7kActf0/1XhYw5gfhrtnPeDj6avfwyJkZvHjr8oZKpiZxWhZfsYJVXSbKsOEJ0Me1whmQf/uLi7PYL1VUKdF0oxKL0lb9qm1tvd+YMEUt4gHaj2SJds9athflJXznTTFTfaQQ4HDWFFG37AqRTs/WttpoWovqJ9+a3P1aOBKTeB7R9sCrIKNfSULqqSx0seuVgscs9VStVgRNfSzLWziqOfDA+sdhNE42nqIozAFncgqpBKFS5FIjbEeub7K3sqaHnt7bAM4up7cWnJf+jLIvg81glNniCSP2Nth1KnmZYigAkYLCe
X-BeenThere: cygwin AT cygwin DOT com
X-Mailman-Version: 2.1.30
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-request AT cygwin DOT com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
From: Brian Inglis via Cygwin <cygwin AT cygwin DOT com>
Reply-To: General Cygwin discussions and problem reports <cygwin AT cygwin DOT com>
Cc: Brian Inglis <Brian DOT Inglis AT SystematicSW DOT ab DOT ca>
Errors-To: cygwin-bounces~archive-cygwin=delorie DOT com AT cygwin DOT com
Sender: "Cygwin" <cygwin-bounces~archive-cygwin=delorie DOT com AT cygwin DOT com>
X-MIME-Autoconverted: from base64 to 8bit by delorie.com id 61RJoVNu1753149

Hi Kennon,

Some perf reports and analysis imply that backward moves (with overlap?) are no 
faster than straight rep movsb on some CPUs, so it may be better to just 
simplify to that, unless you want to stash the final element(s) to be moved out 
of the way in register(s), and use multiple registers in unrolled wide moves for 
the aligned portion?

On 2026-02-27 11:20, KENNON J CONRAD via Cygwin wrote:
>     I updated the BIOS to the newest version and ran the code again.  The memmove got SIG_TRAP again.  This time the code was freeing up uint16_t array element 1525 and eliminating array element 1676 by moving elements 1525 - 1675 to elements 1526 - 1676.
> RSI contains the address of element 1601, indicating the rep movsq did only 9 iterations before the SIG_TRAP happened.  The ZF shows a value of 0.  So it seems like this is perhaps an OS problem with ZF handling of interrupts.  At this point, it is easiest for me to avoid memmove for backward moves with source/destination overlap because of this problem.  I don't know how many computers are impacted by this problem but I do know it's causing crashes on my test computer and that's enough reason to avoid it.

>> On 02/26/2026 7:06 PM PST Eliot Moss wrote:
>> On 2/26/2026 9:04 PM, KENNON J CONRAD wrote:
>>> Perhaps something like this?  Maybe I need to try a BIOS update?
>> Yes, something *like* these flaws.  The thing is to find out if your specific
>> processor has a flaw that needs an update, etc.
>>> Intel Haswell (and related architectures) processors may experience stability issues, including machine check errors (MCEs), due to a microcode bug related to REP MOVS (specifically REP MOVSB or REP MOVSQ) handling. These issues often cause system crashes or lockups, leading to microcode, BIOS/UEFI updates to resolve them.
>>> Debian Wiki
>>>    +4
>>> Issue: A high-rate of interrupts or specific memory operations can cause REP MOVS instructions to trigger Machine Check Errors (MCE) or internal errors (IERR) on older processors.
>>> Affected Processors: The bug primarily impacts older Intel processors, including Haswell and Broadwell architectures.
>>> Fix/Mitigation: The primary solution is to apply the latest motherboard BIOS/UEFI update, which contains the corrected microcode update (often labelled 20180108 or later).
>>> Background: This is linked to Intel’s efforts to fix security vulnerabilities (like Spectre), where early patches for Haswell/Broadwell caused unexpected instability, requiring further refinements.
>>> Debian Wiki
>>>    +4
-- 
Take care. Thanks, Brian Inglis              Calgary, Alberta, Canada

La perfection est atteinte                   Perfection is achieved
non pas lorsqu'il n'y a plus rien à ajouter  not when there is no more to add
mais lorsqu'il n'y a plus rien à retrancher  but when there is no more to cut
                                 -- Antoine de Saint-Exupéry

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019