delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2026/02/26/21:27:28

DMARC-Filter: OpenDMARC Filter v1.4.2 delorie.com 61R2RSTQ1403203
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 61R2RSTQ1403203
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=slJ3Xh5D
X-Recipient: archive-cygwin AT delorie DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7A5594BA2E15
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
s=default; t=1772159246;
bh=SMnemTKA6JQMw+dFaxNrjZ6bYER76tn8gLx8WZlSvpI=;
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=slJ3Xh5D6rNnXrWdno4Hk4avTxU9bevxtJxhWvCqZkFdB4WseJ+dfY3Kxc8wx7ZGb
9m33Umz3tUXUFGSluEtGUb4x9A6xOhn1x+/QCMJ5QVYIAqgJbJlTShorJgLubn2n+1
YyL1B0BG0vKXm51geJmL+qbr22LPbWrPiN0G0Z4Y=
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 97E954BA23CE
ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 97E954BA23CE
ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1772159227; cv=none;
b=CMIsRY1cJs7LvKFtCXFRnKsD9fviOIZxvxWKQdNrljC+y/Rb4g6OJz/4fbYi04I5g9U+QUleMI8HIJFhMFWCTjIjfrxy+hFxqZNdDqw/rnEd2BwOHvZvZyZBZWZuR8dSfAP1w9jYuBppk1Eo7T4Y+281tDG/5lafGRlf6o2Mfno=
ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key;
t=1772159227; c=relaxed/simple;
bh=Kzi4T1Mf+rxwqw8LKUtRdo/qxqysNrtplAMDlTVHzPw=;
h=DKIM-Signature:Date:From:To:Message-ID:Subject:MIME-Version;
b=vWN9iugCsDBuMNhugtsUWwAM9ZCGnvk1+G+FQvJMCMs5zIdARQz1toWxh8v6K+FRo0sgKtGyOMPIv0++faauQpCh0yTSPk3x1dxzGW2eoDoWloK5s33NRIGXljXQXfdBlpXpls/975zJV2Orx69SQYa10I1/+DJk/S4s2Wp2dzk=
ARC-Authentication-Results: i=1; server2.sourceware.org
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 97E954BA23CE
Date: Thu, 26 Feb 2026 18:27:02 -0800 (PST)
To: Dimitry Andric <dimitry AT unified-streaming DOT com>
Message-ID: <2136348071.1533617.1772159222811@connect.xfinity.com>
In-Reply-To: <6E812632-0E73-464A-AAB9-DC5BC5546B4C@unified-streaming.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>
<609655EE-8E9D-4522-A05C-F74C3FC89583 AT unified-streaming DOT com>
<957583332 DOT 1523179 DOT 1772138829815 AT connect DOT xfinity DOT com>
<6E812632-0E73-464A-AAB9-DC5BC5546B4C AT unified-streaming 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: 14658
X-Originating-Client: open-xchange-appsuite
X-CMAE-Envelope: MS4xfDAlrhf7UJCtlwyQj0STYwVS31xYVRrCX5AJVT75eRJtlOxHtF3IR3SmqIbRyDEeNZTZNU0XR2u6dAqo1mynWDnIRQmxVvSDEVNF58s+o4V+6YfI7TdV
khkZPq4c/s8zD0n5cQOHKOvdZ3EiF3zK10QohVngKhjlImoERxtu4jwyxmlp4Xm7FCo5evh6xXT4mtLQcIleHUvPnOdZBuLzncgH0s+C2JelFlGIZ0CQkHxb
xyQLM3X7Mtx4PCPOWzEzOoJO0HOKoLQaq9TWjrQdkruFyx7GTBMLqPfa6cYjd+xJ
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: KENNON J CONRAD via Cygwin <cygwin AT cygwin DOT com>
Reply-To: KENNON J CONRAD <kennonconrad AT comcast DOT net>
Cc: KENNON J CONRAD via Cygwin <cygwin AT cygwin DOT com>
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>

Yes, I still have the gdb session running for the crash.

Five threads are in the function "add_suffix".  Code lines are as follows:
1.  node_ptr = &nodes[*sibling_node_num_ptr];
2.  while (node_ptr->child_node_num != 0) {
3.  new_node_ptr->sibling_node_num[1] = 0;
4.  return;
5.  if (*(node_symbol_ptr + 1) == *(in_symbol_ptr + 1)) {

One thread is in rank_scores_thread and giving the SIGTRAP in the memmove function

Mainline is in score_base_node_tree_cap at this line:
    node_instances = node_ptr->instances;

Threads 1 - 5 do not have calls to memmove, memcopy or memset in the C code, although I'd need to check the assembly code to be sure these are not called.  Mainline does have some mem library calls but these are only used at points in the code where all other threads have exited.  So I don't immediately see anything that looks particularly suspect.

For now I'm going to investigate this information from Google AI since the errors are occuring on a Haswell architecture i7-4790K:

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

Best Regards,

Kennon

> On 02/26/2026 1:42 PM PST Dimitry Andric <dimitry AT unified-streaming DOT com> wrote:
> 
>  
> 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 AT comcast DOT 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 AT unified-streaming DOT 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

- Raw text -


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