X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:to:from:subject:message-id:date:mime-version :content-type:content-transfer-encoding; q=dns; s=default; b=HXS R4LfPUA3c9ViC5g/LlOGaodf0r9kzmMSoUamHwid3zJo8PEA+byBSf7f7Gk5mbSy 1vyveGLaEfeF78SJbQDhyanC6EN+YtCr+g0zcIUubP2JbIyfHFy695bVir8XvTFG z4jcydpW3MqEMbXx+DnMPZhrH+RiEqoaVVhMPMdU= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:to:from:subject:message-id:date:mime-version :content-type:content-transfer-encoding; s=default; bh=acaQ/KR+P hlWIaHOiFRPSmSzeVw=; b=CNGRP5wnQO1B7S4qbAlvsqsC75JmKKcXeZvhkNJhH 1l9XAULkRbxvxl8/74QCJbs+OrD+Tgf54tDTaOm8J3h7Ks7alrhr2CehmDkIl0Is ZN36cHg/1NLq6wedBJNiZmTp11xsR2Q4gz6SZ9x/1voQDfK3JzBXzrqrK6HLVSdN uU= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.7 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 spammy=acts, H*Ad:D*pobox.com, race, H*MI:pobox X-HELO: sasl.smtp.pobox.com To: cygwin AT cygwin DOT com From: Daniel Santos Subject: How to trap crash or exit in Windows? Message-ID: <5a3891fb-1307-5eb8-210b-d07f37b17323@pobox.com> Date: Fri, 14 Apr 2017 17:44:56 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Pobox-Relay-ID: 580E6332-2163-11E7-9676-E680B56B9B0B-06139138!pb-smtp1.pobox.com X-IsSubscribed: yes I'm hacking expect to try to solve its "broken pipe" problem, but I haven't done any serious windows programming/debugging in over 10 years. I want to be able to set some type of "trap" after a fork (on the child) and then disable it before it calls execvp to catch any crashes or normal program exit in between those two points, how can I do this on Windows / Cygwin? Does sigaction work in Cygwin with SIGILL, SIGSEGV, et. al.? I haven't had an atexit function get called yet, so I'm hoping that means that I'm never getting a normal exit prior to calling exec (I should verify that). Also, is there a way I can use strace with Cygwin to narrow what spams? This acts like a race condition and sometimes I have to run for 5 or 10 minutes before it fails, so emitting more spam will likely lower the likelihood of failure. One very interesting aspect of this is that if I run two separate make -kj1 check jobs (gcc's testsuite) then I can still get the failure, but never when just running a single make -kj1 job. Thus, one suspect is DLL base address, even though I have rebased the build tree. Is there a nifty way of catching or debugging fork/DLL base address conflicts? iiuc, the whole rebasing thing is so that every DLL has a unique (non-overlapping) base address so that when we fork, the DLLs are always loaded at the same address. Using debug log spew, I traced the child "going away" to after calling an ioctl to set the terminal window size. Thanks in advance! Daniel -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple