🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #10755

Detecting a process being killed

#10755
From: Arnie Mauer
Date: Wed, 24 Mar 2004 00:21
19 lines
1598 bytes
I have a console app.  All of main runs in a try/catch block.  The app logs
messages including successful completion or any exceptions caught.  The
problem is that (a customer reported) it just disappears with no logging.
I'm thinking someone might be using task manager to kill it.

I built a test app and used task manager to kill it.  It does get killed.  I
have set up signal handlers for:

   signal( SIGINT, ImDead );
   signal( SIGTERM, ImDead );
   signal( SIGABRT, ImDead );
   signal( SIGILL, ImDead );
   signal( SIGSEGV, ImDead );

but "ImDead" never gets called upon termination.  Is there any other
mechanism that a process can use to detect if it's being killed?

Thanks,
- Arnie
Technical Details
Message-ID: <4060d44c@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!news-out1.nntp.be!propagator2-sterling!propagator3-cogent!in.nntp.be!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,4e1de9246721b866,start
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2004-03-23 16:33:20 PST
From: "Arnie Mauer" <xxx@nowhere.net>
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Detecting a process being killed
Date: Tue, 23 Mar 2004 19:21:39 -0500
Lines: 21
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
NNTP-Posting-Host: 24.151.21.222
Message-ID: <4060d44c@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1080087628 24.151.21.222 (23 Mar 2004 16:20:28 -0800)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!news-out1.nntp.be!propagator2-sterling!propagator3-cogent!in.nntp.be!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail