From owner-freebsd-hackers@freebsd.org Sat Feb 13 16:40:15 2016 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 11A7EAA1FCD for ; Sat, 13 Feb 2016 16:40:15 +0000 (UTC) (envelope-from wjw@digiware.nl) Received: from smtp.digiware.nl (unknown [IPv6:2001:4cb8:90:ffff::3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D1C711834 for ; Sat, 13 Feb 2016 16:40:14 +0000 (UTC) (envelope-from wjw@digiware.nl) Received: from rack1.digiware.nl (unknown [127.0.0.1]) by smtp.digiware.nl (Postfix) with ESMTP id A85C21534E5 for ; Sat, 13 Feb 2016 17:40:08 +0100 (CET) X-Virus-Scanned: amavisd-new at digiware.nl Received: from smtp.digiware.nl ([127.0.0.1]) by rack1.digiware.nl (rack1.digiware.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Ka8ptdepiK9k; Sat, 13 Feb 2016 17:39:47 +0100 (CET) Received: from [192.168.10.10] (asus [192.168.10.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.digiware.nl (Postfix) with ESMTPSA id 868FC1534E6 for ; Sat, 13 Feb 2016 17:30:05 +0100 (CET) To: freebsd-hackers@freebsd.org From: Willem Jan Withagen Subject: Debugging C++ code with atexit functions not called.. X-Enigmail-Draft-Status: N1110 Message-ID: <56BF5A0C.6060503@digiware.nl> Date: Sat, 13 Feb 2016 17:30:04 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2016 16:40:15 -0000 Hi, I've rn into a snag with porting some of the Ceph code.... PID file cleanup is done tru a atexit(pidfile_remove) setup. Ive augmented the code and I see that the last thing the Linux version does is actually execute the pidfile_remove code. Whereas on FreeBSD this does not happen, the function does not seem to be called at all.. The most obvious reason would be a crash of the program, but I don't get a core file... But to terminate the program I have to send it a 'kill TERM'. Doing so under gdb gdb prints: [New Thread 806c91800 (LWP 101527 sginal_handler)] [New Thread 806c91400 (LWP 101519 ms_accepter)] [New Thread 806c91000 (LWP 101512 ms_local)] [New Thread 804dffc00 (LWP 101509 ms_dispatch)] [New Thread 804dff800 (LWP 101489 safe_timer)] [New Thread 804dff400 (LWP 100256 ms_reaper)] [New Thread 804dff000 (LWP 100223 fn_monstore)] [New Thread 804c15c00 (LWP 100206 admin_socket)] [New Thread 804c15800 (LWP 100193 service)] [New Thread 804c15400 (LWP 100167 log)] Program received signal SIGTERM, Terminated. [Switching to Thread 804c15000 (LWP 101222)] 0x00000008025ea1fc in _umtx_op_err () from /lib/libthr.so.3 (gdb) Are these threads being fired up by the program upon receiving the signal? Continuing gives me some of the programs output, and it prints that it has received a signal. The break on the pidfile_remove is not triggered. Suggesting that it does not call the atexit-functions... Suggestions on how to debug this further.... --WjW