delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2025/04/10/09:49:43

DMARC-Filter: OpenDMARC Filter v1.4.2 delorie.com 53ADnggv3292181
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 53ADnggv3292181
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=FSpmXaLn
X-Recipient: archive-cygwin AT delorie DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E523E383D83A
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
s=default; t=1744292980;
bh=DK7kUoW0PFOr9wf2him+6yBXMRWXFhRcUq+5066r0gE=;
h=References:In-Reply-To:Date:Subject:To:List-Id:List-Unsubscribe:
List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:
From;
b=FSpmXaLnAIdRWCixFHX9cDZQzcAihuwNx8zyRys40Xh/wTL9l3jKhMtHXO/2dENBN
wSk65eOsvGF1svP/xbk7JECu7ekRILCauuMrONqUjO1wTSbewyFuDfobjmuTCBTiH4
1iZ15Hk9eSGA5Hg0F6IT6V4C0KV/LVjzlbvg9sJ0=
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4946F3846033
ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 4946F3846033
ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1744292952; cv=none;
b=YU7e6ueVNOtLwgQ3Na8bUvTTbzWWEasMfsG57hFUBPUtUWzYbge1sJIyf6FeCnzs4g4O+YJXGQRWvy45Xb4dULaxLBfCUjJhEEmcYtZ7KbqYWm+Oz868aXgeB9TPc63KZr9/YP5KaYO/e7CVJZrtxkxWZnSD+kQw7GVpc1WBn1k=
ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key;
t=1744292952; c=relaxed/simple;
bh=dhBl6AcvHy3werfM9+FmBcsfaCf6uz74yL739zgUyTs=;
h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To;
b=Wu/CDXDwc2359R9omA33HFG32dUo3plLlBawkFUnF5LzR3KYJJ33Gh83k6Pnt10hTmINLGZ0i3Q0iMBAUnKkxZWdSHPW519sVBHDLJjKpaMd6+PEBANZ8DK3SzC/ipEC6o/If1Fq/aIcKVp2I9Ze95rP3Ox4xIa9EwtIH0leFeA=
ARC-Authentication-Results: i=1; server2.sourceware.org
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4946F3846033
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20230601; t=1744292951; x=1744897751;
h=content-transfer-encoding:to:subject:message-id:date:from
:in-reply-to:references:mime-version:x-gm-message-state:from:to:cc
:subject:date:message-id:reply-to;
bh=Y0XWtfWp9ARTLiCbxmfAGOxzxPdDbHx7qM9AQGdKMTQ=;
b=bK7P5JdoUGLefafV5sPNlE73rxpdYuhV8mXdxaceF9pbaQYH6eY6G+2h5YFvcgUdmq
TLzvvt3bQ9nLKwyEoKufWVDp6QNZmWy/SviDjqAkU0wyNCWTEZtmYG/f3ndw17mxfQpm
jrPLi7aZr7ANHZIVEd9qkaGhpSWGHOIGIj3Fcb2zR935UeTUxxff79WhLg1KbhzsTQHT
V6i9GFJBuDfFokWImYRfiIHCHsvOOrty3sxeiidbk14u8897ZNbAB8D/gM5+9cnCFnrw
vzr5dZmgJmMSP6JichNZTcllIz4PXm+wG/Qi/Lv5ftVWvxpY6qP4yIEwi0jqfMtbE2hn
Yg7Q==
X-Gm-Message-State: AOJu0YxbO4Ov3atcjk4+PBXfEm5QNCLP+ERqGUWn7GBNXoVBtFwBvpi6
95//ORbS7mdVNR0Dw3K+ixolQsOk9rANe0Qzz7/Ieig99zCWeVOTQFZv9WN9+Efr3wpApWQV+8t
82U/iIUfcrYARkwndbS/aHKfYhe4Q5WY2
X-Gm-Gg: ASbGnctbDk0ODilYH2z5Uopm7+1FHwK42+l3YbnwVNchLZrQh1WAEcCyH7Y0qA/E+fO
prId/Cu71ADR5YgDIXR6O3lskfzONTAQfY+u4AD/OOUZxr6jb2LxoxQYJwhgqv5UKb+lnp1o+x6
EoTfVO2psrWdiSBfOKziUDew==
X-Google-Smtp-Source: AGHT+IHC1EemTwJwzyTb0dskbzyTs014gYYRknk9HHbIER2kWcYSntQzWjpiyuHO4z4CoxFUR2FON/EPudOLXLMGOhA=
X-Received: by 2002:a05:6808:3096:b0:3fe:f57e:7027 with SMTP id
5614622812f47-400740426d9mr1352557b6e.3.1744292951190; Thu, 10 Apr 2025
06:49:11 -0700 (PDT)
MIME-Version: 1.0
References: <CAA3frXTFnLSF2HzB5Z278=5J0bsOGRcRmqyv+7qcr3-QGmKbBw AT mail DOT gmail DOT com>
<7a8fd4a7-e07c-4d09-9741-72d3b2b27b06 AT dronecode DOT org DOT uk>
In-Reply-To: <7a8fd4a7-e07c-4d09-9741-72d3b2b27b06@dronecode.org.uk>
Date: Thu, 10 Apr 2025 22:48:35 +0900
X-Gm-Features: ATxdqUHkKLoSH0VNcoVY3DtIP0uisEdXsEe860Zk8gWztEiAfKMBKYOtEnWGegU
Message-ID: <CAA3frXQiMLSLOpj2CE1toQEO=fR26HB59h2H4mBy5ykwDC-_RA@mail.gmail.com>
Subject: Re: A process spawned inside gem command running on latest ruby
segfaults
To: cygwin AT cygwin DOT com
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-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: Daisuke Fujimura via Cygwin <cygwin AT cygwin DOT com>
Reply-To: Daisuke Fujimura <booleanlabel AT gmail 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 53ADnggv3292181

Thank you for the advice.

I updated cygwin and ran again.

```
$ uname -srvmpio
CYGWIN_NT-10.0-22000-ARM64 3.6.1-1.x86_64 2025-04-09 11:31 UTC x86_64
unknown unknown Cygwin
(snip)
$ gdb /usr/bin/ruby
(gdb) set cygwin-exceptions on
(gdb) run /usr/bin/gem install -V --local --ignore-dependencies
--document=rdoc,ri --build-root
/tmp/cygport-ruby-debug_inspector/ruby-debug_inspector-1.2.0-1.x86_64/inst
--install-dir /usr/share/gems --bindir /usr/bin
debug_inspector-1.2.0.gem
:
Building native extensions. This could take a while...
current directory:
/tmp/cygport-ruby-debug_inspector/ruby-debug_inspector-1.2.0-1.x86_64/inst/usr/share/gems/gems/debug_inspector-1.2.0/ext/debug_inspector
["/usr/bin/ruby.exe", "-I/usr/share/rubygems", "extconf.rb"]
[New Thread 5284.0x2200]
[New Thread 5284.0xe10]
[New Thread 5284.0x50c]
creating Makefile
current directory:
/tmp/cygport-ruby-debug_inspector/ruby-debug_inspector-1.2.0-1.x86_64/inst/usr/share/gems/gems/debug_inspector-1.2.0/ext/debug_inspector
["make", "DESTDIR=", "sitearchdir=./.gem.20250410-1545-swemh8",
"sitelibdir=./.gem.20250410-1545-swemh8", "clean"]

Thread 11 "ruby" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 5284.0xe10]
0x0000000000000000 in ?? ()
(gdb) where
#0  0x0000000000000000 in ?? ()
#1  0x00007ffef1609fb4 in pthread_testcancel () at
/usr/src/debug/cygwin-3.6.1-1/winsup/cygwin/thread.cc:399
#2  pthread_rwlock_wrlock (rwlock=0xa003a9a00) at
/usr/src/debug/cygwin-3.6.1-1/winsup/cygwin/thread.cc:4352
#3  0x00007ffef16eacd4 in _sigfe () at sigfe.s:35
#4  0x00000003ff54e3f9 in cygcrypto-3!CRYPTO_THREAD_write_lock () from
/usr/bin/cygcrypto-3.dll
#5  0x00000003ff541922 in cygcrypto-3!OPENSSL_atexit () from
/usr/bin/cygcrypto-3.dll
#6  0x00000003ff541d43 in cygcrypto-3!OPENSSL_thread_stop () from
/usr/bin/cygcrypto-3.dll
#7  0x00000003ff53fdd3 in ossl_DER_w_end_sequence () from
/usr/bin/cygcrypto-3.dll
#8  0x00007fff4d63d6ac in ?? ()
#9  0x00007fff4d6cb590 in ?? ()
#10 0x00007fff4d6cb590 in ?? ()
#11 0x0000000000000000 in ?? ()
(gdb)
```


On Sat, Feb 22, 2025 at 2:11 AM Jon Turney <jon DOT turney AT dronecode DOT org DOT uk> wrote:
>
> On 20/02/2025 15:33, Daisuke Fujimura via Cygwin wrote:
> > Reproduction:
> > - Use ruby-3.4.2-1 (test)
> > - Install gem containing native libraries
> >
> > ```
> > $ uname -srvmpio
> > CYGWIN_NT-10.0-22000 3.5.7-1.x86_64 2025-01-29 19:46 UTC x86_64
> > unknown unknown Cygwin
> > $ ruby -v
> > ruby 3.4.2 (2025-02-15 revision d2930f8e7a) +PRISM [x86_64-cygwin]
> > $ gem -v
> > 3.5.11
> > $ cd /tmp
> > $ git clone https://cygwin.com/git/cygwin-packages/ruby-debug_inspector
> > # Any gem that contains native libraries
> > $ cd ruby-debug_inspector
> > $ cygport ruby-debug_inspector.cygport fetch prep compile # preparation
> > $ cygport ruby-debug_inspector.cygport install
> > :
> > ```
> >
> > The process spawned inside `gem install` seems to raise SIGSEGV
> > internally and exits.
> >
> > ```
> > $ gdb /usr/bin/ruby
> > :
> > (gdb) run /usr/bin/gem install -V --local --ignore-dependencies
> > --document=rdoc,ri --build-root
> > /tmp/ruby-debug_inspector/ruby-debug_inspector-1.1.0-1.x86_64/inst
> > --install-dir /usr/share/gems --bindir /usr/bin
> > debug_inspector-1.1.0.gem #
> > https://github.com/cygwin/cygport/blob/0.36.9/cygclass/rubygem.cygclass#L134
> > :
> > :
> > Building native extensions. This could take a while...
> > current directory:
> > /tmp/ruby-debug_inspector/ruby-debug_inspector-1.1.0-1.x86_64/inst/usr/share/gems/gems/debug_inspector-1.1.0/ext/debug_inspector
> > ["/usr/bin/ruby.exe", "-I/usr/share/rubygems", "extconf.rb"]
> > [New Thread 3600.0x23a0]
> > [New Thread 3600.0x1278]
> > [New Thread 3600.0x2794]
> > creating Makefile
> >
> > Thread 11 "ruby" received signal SIGSEGV, Segmentation fault.
> > [Switching to Thread 3600.0x1278]
> > 0x0000000000000000 in ?? ()
> >
> [...]
>
> >
> > SIGSEGV seems to occur inside the cygwin DLL.
>
> You might get more useful backtrace information after the exception with
> the gdb setting 'set cygwin-exceptions on' (See [1]).
>
> [1] https://cygwin.com/faq.html#faq.programming.debugging-cygwin
>
> (It would be a nice project for someone to work on to see if is possible
> improve this gdb (mis)feature so it only ignores exceptions inside the
> cygwin DLL where exception::myfault() is on the SEH stack [which is used
> to implement things like "POSIX defines that this function returns
> EFAULT when you hand it an invalid pointer"], not all of them).
>
> > This problem also occurs with ruby-3.3.2-3 (test).
> >
> > We have confirmed that it also occurs in cygwin-3.6.
>

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