From owner-freebsd-hackers@freebsd.org Sat Jan 2 22:41:48 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 737F1A5EB4D for ; Sat, 2 Jan 2016 22:41:48 +0000 (UTC) (envelope-from dieterbsd@gmail.com) Received: from mail-ig0-x232.google.com (mail-ig0-x232.google.com [IPv6:2607:f8b0:4001:c05::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CA7818AF for ; Sat, 2 Jan 2016 22:41:48 +0000 (UTC) (envelope-from dieterbsd@gmail.com) Received: by mail-ig0-x232.google.com with SMTP id ik10so60085959igb.1 for ; Sat, 02 Jan 2016 14:41:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=gVSY6hfnKFpFBZXVmxIlKfKxcgmtpjgmeik2t8uEMiI=; b=LrGYjdCyL0/+T+cKAWnVf7ZA3Jb8iYmQlHrllK/UfBlCyjjR3AA6MG0zeG5d1ajCqG ZkUdeL7OYGoPiQNGdx5HHx1EsgX0Q71RA960HaFMMJ57qtsOK/ZMT0tUgeLfm48TCRsn 2HdyVXh6WrXb7EFwumUzQJ23PXkxU9Qd4TwRiOxXyvtRGsR1poJLX9ZfUkQyC9dOM8Sv u9U7skuKCc3Q4+prqeLnuyW4tM51sbDVkS4STXG9ICyM64z4zWjYBJJKL1w1Z1bCQBrb bIyV0hnw3PjKKusVmRfELYJI5ymGy8m+rq8gZ80/p5enLGf9P37Jg7WBI+Dz/F/GLIVN cd9Q== MIME-Version: 1.0 X-Received: by 10.50.50.144 with SMTP id c16mr33030491igo.82.1451774507720; Sat, 02 Jan 2016 14:41:47 -0800 (PST) Received: by 10.64.120.68 with HTTP; Sat, 2 Jan 2016 14:41:47 -0800 (PST) Date: Sat, 2 Jan 2016 14:41:47 -0800 Message-ID: Subject: Getting a core dump of a process without killing it? From: Dieter BSD To: freebsd-hackers@freebsd.org Content-Type: text/plain; charset=UTF-8 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, 02 Jan 2016 22:41:48 -0000 I have a (stopped) process which hopefully has some data in its memory. Is there a way to get a core dump of a process without killing it? Looked in kern_sig.c but it appears that any signal that gives a core dump also kills the process. Created a similar process, sent it a SIGTRAP, looked at the core dump with hexdump and found the data. But of course SIGTRAP also kills the process. Gdb can attach to a process and dump areas of memory, (dump memory filename addr1 addr2) if you can figure out what address range(s) you want. I tried "maint info sections" but no joy. Use too large a range with "dump memory" and gdb fails. There doesn't seem to be a dump everything option. FreeBSD 8.2 [ because 10.1 doesn't work :-( ] on amd64 ps reports that VSZ is 108104.