From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 65982 invoked by alias); 30 Oct 2015 19:18:31 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 65946 invoked by uid 89); 30 Oct 2015 19:18:30 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-5.4 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY autolearn=no version=3.3.2 X-HELO: calimero.vinschen.de Received: from aquarius.hirmke.de (HELO calimero.vinschen.de) (217.91.18.234) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 30 Oct 2015 19:18:29 +0000 Received: by calimero.vinschen.de (Postfix, from userid 500) id EDA73A805EA; Fri, 30 Oct 2015 20:18:26 +0100 (CET) Date: Fri, 30 Oct 2015 21:23:00 -0000 From: Corinna Vinschen To: cygwin@cygwin.com Subject: Re: Segmentation fault before main Message-ID: <20151030191826.GQ5319@calimero.vinschen.de> Reply-To: cygwin@cygwin.com Mail-Followup-To: cygwin@cygwin.com References: <56338BCC.40709@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="yTfYsguFsV8cp5cf" Content-Disposition: inline In-Reply-To: <56338BCC.40709@gmail.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-SW-Source: 2015-10/txt/msg00573.txt.bz2 --yTfYsguFsV8cp5cf Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-length: 2635 On Oct 30 16:25, Marco Atzeri wrote: > Hi Corinna, >=20 > as mention some time ago, testing netcdf 4.4.0 release candidates > I see a puzzling SIGSEGV before reaching main, so something goes wrong > on cygwin loading/inizialization of the program. >=20 > It happens in a simple test programs that is linked to > cygnetcdf-7.dll and its only job is to create a test file > called ctest0.nc. >=20 > Previous 4.3.3.1 test case runs fine. > The new ctest.c fails both with the new and with the old library. > Test case and binaries are here : > http://matzeri.altervista.org/works/segfault/ >=20 > $ gcc ctest.c -o ctest.exe -lnetcdf >=20 > $ gdb ./ctest.exe > (gdb) break main > Breakpoint 1 at 0x100401171 > (gdb) run > Starting program: /cygdrive/e/cyg_pub/devel/netcdf/tests/ctest-440.exe > [New Thread 8404.0x18f4] > [New Thread 8404.0xa8c] > [New Thread 8404.0x2270] >=20 > Program received signal SIGSEGV, Segmentation fault. > ___chkstk_ms () at > /usr/src/debug/gcc-4.9.3-1/libgcc/config/i386/cygwin.S:146 > 146 orq $0x0, (%rcx) /* probe there */ >=20 >=20 > $ uname -svrm > CYGWIN_NT-6.1 2.2.1(0.289/5/3) 2015-08-20 11:42 x86_64 >=20 >=20 > libnetcdf-devel 4.3.3.1-2 > libnetcdf7 4.3.3.1-2 > netcdf 4.3.3.1-2 > netcdf-debuginfo 4.3.3.1-2 >=20 >=20 > Unfortunately I have no clue about this code: >=20 > /* ___chkstk_ms is a *special* function call, which uses %rax as the > argument. > We avoid clobbering any registers. Unlike ___chkstk, it just probes t= he > stack and does no stack allocation. */ > .global ___chkstk_ms > #ifdef __x86_64__ > cfi_startproc() > ___chkstk_ms: > pushq %rcx /* save temps */ > cfi_push(%rcx) > pushq %rax > cfi_push(%rax) > cmpq $0x1000, %rax /* > 4k ?*/ > leaq 24(%rsp), %rcx /* point past return addr */ > jb 2f >=20 > 1: subq $0x1000, %rcx /* yes, move pointer down 4k */ > orq $0x0, (%rcx) /* probe there */ >=20 > Any help will be really appreciated. Well, it's a stack probe. It's typically called when trying to allocate big datastructures on the stack, e.g. with alloca. Did you try to raise the default stacksize in the executable header (see peflags -x and -X options). There's not much else to work with... HTH, Corinna --=20 Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Maintainer cygwin AT cygwin DOT com Red Hat --yTfYsguFsV8cp5cf Content-Type: application/pgp-signature Content-length: 819 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJWM8KCAAoJEPU2Bp2uRE+gotEP/jnHUDlwqpuTZymX3S64vLm9 yOwRiJuqEbuyGPzPw/TIpBbqdlDayzxvZVVmkHBk/sV101DymxT2XvV3lRVobKtx eKW2Oq8IcPibvdmVI+5vqGY/0QEmd3J62Lt7P+dhFGeMR2PXJlgfaNWjUgXN4rxh 5E0O3/YKkv1UfW8SD89drmMxH688ww4HeDa0tQH+uJ5UDTW4yUCjBdZEzPnMiJYd lXnFf3ErLPhvOA78jcS373QRZ9bgMyuTm239q5fL1SN1sHm6vKqMxNRj57FzSPcV LEcf1UlK7GrXvz50QtZlm3mz3irIr1nz5wCUAVHOmye4qOhoRODBzwHoZV+fc0UT y7tiXzj6Fm0xtvamej2q0UbgRqCvyRgueyg+0wwgMyiu6Iy1ZFXdoXUxFAb+5rt/ ugCs2mFy5B8dDu5392hg4zD6+9Slqag8yNyjLvYVuCv0pz/8Gc9U4VaPL2l0Xwl0 XomUFZX6NyCSVTsmyHrGRZiR0bd0qjmYaBvsCWjl/uE/zW0TbFkm2wb+M4WGI+lQ o26uWb9CvbZTlHK2j8tsVX3fVKp/IP12PsbIRcgpHmSdntwvLuDdc4tfcpDqCF/n qqi875N4/BX05NpEoTgsWe1az5LRmcLSHIMVDwdBh/nWLsmt+cBdZfKEFDJKYhv+ fLSwrCSzCc2HmKimD2a4 =VCqr -----END PGP SIGNATURE----- --yTfYsguFsV8cp5cf--