From owner-freebsd-hackers@freebsd.org Sun Dec 27 00:05:31 2015 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 0649BA5372C for ; Sun, 27 Dec 2015 00:05:31 +0000 (UTC) (envelope-from yuri@rawbw.com) Received: from shell1.rawbw.com (shell1.rawbw.com [198.144.192.42]) by mx1.freebsd.org (Postfix) with ESMTP id CE15B1E81; Sun, 27 Dec 2015 00:05:30 +0000 (UTC) (envelope-from yuri@rawbw.com) Received: from yuri.doctorlan.com (c-50-184-63-128.hsd1.ca.comcast.net [50.184.63.128]) (authenticated bits=0) by shell1.rawbw.com (8.15.1/8.15.1) with ESMTPSA id tBR05O25046507 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO); Sat, 26 Dec 2015 16:05:24 -0800 (PST) (envelope-from yuri@rawbw.com) X-Authentication-Warning: shell1.rawbw.com: Host c-50-184-63-128.hsd1.ca.comcast.net [50.184.63.128] claimed to be yuri.doctorlan.com Subject: Re: Should DEBUG_VFS_LOCKS messages be reported as bugs? To: John Baldwin , freebsd-hackers@freebsd.org References: <567791E9.50207@rawbw.com> <567BA189.8080405@rawbw.com> <4247765.dyXyDaofWi@ralph.baldwin.cx> Cc: Rick Macklem , "'Konstantin Belousov'" From: Yuri Message-ID: <567F2B42.2040707@rawbw.com> Date: Sat, 26 Dec 2015 16:05:22 -0800 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <4247765.dyXyDaofWi@ralph.baldwin.cx> Content-Type: text/plain; charset=utf-8; format=flowed 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: Sun, 27 Dec 2015 00:05:31 -0000 On 12/24/2015 09:19, John Baldwin wrote: > Here's a rough attempt at fixing this. I have not tested it though and it > might be very wrong. My quick test of the patch caused kernel panic during the mount. Yuri From owner-freebsd-hackers@freebsd.org Mon Dec 28 19:42:41 2015 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 D7141A54175 for ; Mon, 28 Dec 2015 19:42:41 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B89C71E4C; Mon, 28 Dec 2015 19:42:41 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id BCFB4B981; Mon, 28 Dec 2015 14:42:40 -0500 (EST) From: John Baldwin To: Yuri Cc: freebsd-hackers@freebsd.org, Rick Macklem , 'Konstantin Belousov' Subject: Re: Should DEBUG_VFS_LOCKS messages be reported as bugs? Date: Mon, 28 Dec 2015 08:10:31 -0800 Message-ID: <17527804.nLh3JdF0Bz@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <567F2B42.2040707@rawbw.com> References: <567791E9.50207@rawbw.com> <4247765.dyXyDaofWi@ralph.baldwin.cx> <567F2B42.2040707@rawbw.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 28 Dec 2015 14:42:40 -0500 (EST) 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: Mon, 28 Dec 2015 19:42:41 -0000 On Saturday, December 26, 2015 04:05:22 PM Yuri wrote: > On 12/24/2015 09:19, John Baldwin wrote: > > Here's a rough attempt at fixing this. I have not tested it though and it > > might be very wrong. > > My quick test of the patch caused kernel panic during the mount. Do you have the panic message or backtrace? -- John Baldwin From owner-freebsd-hackers@freebsd.org Tue Dec 29 05:01:00 2015 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 0A397A558CB; Tue, 29 Dec 2015 05:01:00 +0000 (UTC) (envelope-from kaduk@mit.edu) Received: from dmz-mailsec-scanner-3.mit.edu (dmz-mailsec-scanner-3.mit.edu [18.9.25.14]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9BF381E38; Tue, 29 Dec 2015 05:00:59 +0000 (UTC) (envelope-from kaduk@mit.edu) X-AuditID: 1209190e-f79046d0000036c0-98-56821255e3ab Received: from mailhub-auth-1.mit.edu ( [18.9.21.35]) (using TLS with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by dmz-mailsec-scanner-3.mit.edu (Symantec Messaging Gateway) with SMTP id F5.66.14016.65212865; Mon, 28 Dec 2015 23:55:50 -0500 (EST) Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11]) by mailhub-auth-1.mit.edu (8.13.8/8.9.2) with ESMTP id tBT4tnd1031630; Mon, 28 Dec 2015 23:55:49 -0500 Received: from multics.mit.edu (system-low-sipb.mit.edu [18.187.2.37]) (authenticated bits=56) (User authenticated as kaduk@ATHENA.MIT.EDU) by outgoing.mit.edu (8.13.8/8.12.4) with ESMTP id tBT4tku5029808 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Mon, 28 Dec 2015 23:55:48 -0500 Received: (from kaduk@localhost) by multics.mit.edu (8.12.9.20060308) id tBT4tjg3024669; Mon, 28 Dec 2015 23:55:45 -0500 (EST) Date: Mon, 28 Dec 2015 23:55:45 -0500 (EST) From: Benjamin Kaduk X-X-Sender: kaduk@multics.mit.edu To: freebsd-hackers@FreeBSD.org cc: freebsd-current@FreeBSD.org Subject: second call for 2015Q4 quarterly status reports Message-ID: User-Agent: Alpine 1.10 (GSO 962 2008-03-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrDIsWRmVeSWpSXmKPExsUixCmqrBsm1BRmsK6Tw2LOmw9MFts3/2N0 YPKY8Wk+SwBjFJdNSmpOZllqkb5dAlfGhOk/WQsmcVd8/V3awLiAs4uRk0NCwETizLZGNghb TOLCvfVANheHkMBiJomemceZIZyNjBIfFn2Ccg4xScxYuwnKaWCU+PlkGztIP4uAtsSZZatZ QGw2ATWJ9SuuMUPMVZTYfGoSmC0iIC+xr+k9WD0zkL1l9WSw3cICFhLXJuxmBLF5BRwllv6+ C1YjKqAjsXr/FBaIuKDEyZlPWCB6tSSWT9/GMoFRYBaS1CwkqQWMTKsYZVNyq3RzEzNzilOT dYuTE/PyUot0jfVyM0v0UlNKNzGCA1GSbwfj14NKhxgFOBiVeHgzJjWGCbEmlhVX5h5ilORg UhLldfwFFOJLyk+pzEgszogvKs1JLT7EKMHBrCTC67oFKMebklhZlVqUD5OS5mBREued+8U3 TEggPbEkNTs1tSC1CCYrw8GhJMG7WLApTEiwKDU9tSItM6cEIc3EwQkynAdo+H4BoBre4oLE 3OLMdIj8KUZFKXHeXJBmAZBERmkeXC84UexmUn3FKA70ijCvGUgVDzDJwHW/AhrMBDR45tR6 kMEliQgpqQbGyLv/f04tl735nHHxNuEq/RkrPJg/LaxqzVmU4DDrwTUdVdv01kkuPms35GQf Nw1t/TvxZMR5bSv5kIhgnUNWjQ/Wfy97Nd989tcVVvvnNCTWFVV/WJTCFB1q90zqeYiZjeun z4se7wp6xnx102WRSVOYjy26pXA58+yOpAcRc2I/3W553H1hnhJLcUaioRZzUXEiAGgr7F/v AgAA 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: Tue, 29 Dec 2015 05:01:00 -0000 Dear FreeBSD Community, There are less than two weeks left before the deadline for the next FreeBSD Quarterly Status update -- submissions are due on January 7, 2016, for work done in October through December. Status report submissions do not have to be very long. They may be about anything happening in the FreeBSD project and community, and provide a great way to inform FreeBSD users and developers about what you're working on. Submission of reports is not restricted to committers. Anyone doing anything interesting and FreeBSD-related can -- and should -- write one! The preferred and easiest submission method is to use the XML generator [1] with the results emailed to the status report team at monthly at freebsd.org . There is also an XML template [2] which can be filled out manually and attached if preferred. For the expected content and style, please study our guidelines on how to write a good status report [3]. You can also review previous issues [4][5] for ideas on the style and format. We are looking forward to all of your 2015Q4 reports! Thanks, Ben (on behalf of monthly@) [1] http://www.freebsd.org/cgi/monthly.cgi [2] http://www.freebsd.org/news/status/report-sample.xml [3] http://www.freebsd.org/news/status/howto.html [4] http://www.freebsd.org/news/status/report-2015-04-2015-06.html [5] http://www.freebsd.org/news/status/report-2015-07-2015-09.html From owner-freebsd-hackers@freebsd.org Wed Dec 30 04:46:35 2015 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 65F35A56286 for ; Wed, 30 Dec 2015 04:46:35 +0000 (UTC) (envelope-from mybsdmailing@gmail.com) Received: from mail-oi0-x243.google.com (mail-oi0-x243.google.com [IPv6:2607:f8b0:4003:c06::243]) (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 329AF10CE for ; Wed, 30 Dec 2015 04:46:35 +0000 (UTC) (envelope-from mybsdmailing@gmail.com) Received: by mail-oi0-x243.google.com with SMTP id o62so18148597oif.1 for ; Tue, 29 Dec 2015 20:46:35 -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=OE2ajCVg7OH8R5O4cXDHHhuxaW9ERoPnkBOWoZQIXRA=; b=gt4m4qn9wCxUszBAd7pm85d8VdflLw8ilKDpQr98xdTC+HByGQkuLjcfHDbMoBPiat IWqyFTK9gnRSVw0c9syTHndxveFTE5OXZC8jkCTiytS/lFM+xPpD3stoGRrHZFTL0zEm 7N74/yJphh0/RH5heyjPqr6Dzsz7crH7IMQHPceBw5XM7i11W3h9JykW06OCOnR4qeZS 2RcrjxtdPBzgtgrWDvSGY7SUMeu5XJ8/NulXGJa18OK1csuNAxioTJTYASPDBsENmHFK flBOxcmWu33TDZ6mSncgroolY0rN6xx5ObTs2dHrTxbeIgzUFl6LfC5uBvyz0w8J39NW 8s+Q== MIME-Version: 1.0 X-Received: by 10.202.182.133 with SMTP id g127mr35125409oif.41.1451450794386; Tue, 29 Dec 2015 20:46:34 -0800 (PST) Received: by 10.202.177.69 with HTTP; Tue, 29 Dec 2015 20:46:34 -0800 (PST) Date: Tue, 29 Dec 2015 22:46:34 -0600 Message-ID: Subject: BPF Berkeley Packet Filter Question From: Juan Herrera To: freebsd-hackers@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 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: Wed, 30 Dec 2015 04:46:35 -0000 Hello BSD folks, I am developing a networking application in C and I have a question regarding BPF (Berkeley Packet Filters), I will give you an idea of the app first, I need to send a packet from machine A to machine B (any kind of packet) so for this I wrote a packet generator application which will send a packet to machine B, but before sending the packet I need to append some metadata values at the end of the packet, already done, so in machine B I have a raw socket listener app ready to receive incoming packets from machine A, however I want to implement filtering with BPF on machine B, but as my metadata was appended at the end of the packet (have to be at the end), I need to read the packet length with(using) Berkeley Packet Filter to match a specific field to filter one of the bytes at the end of my packet (metadata appended), in other words I need to know the incoming packet length to filtered against one of the metadatas fields and be able to drop the packet before reaching user space applications(drop it in kernel space). So my question is, Can I use BPF to read the packet length ? TIA! From owner-freebsd-hackers@freebsd.org Wed Dec 30 08:57:54 2015 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 95859A55C32 for ; Wed, 30 Dec 2015 08:57:54 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "vps1.elischer.org", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 7145E182F for ; Wed, 30 Dec 2015 08:57:54 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from Julian-MBP3.local (ppp121-45-250-125.lns20.per4.internode.on.net [121.45.250.125]) (authenticated bits=0) by vps1.elischer.org (8.15.2/8.15.2) with ESMTPSA id tBU8vnTl033342 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Wed, 30 Dec 2015 00:57:52 -0800 (PST) (envelope-from julian@freebsd.org) Subject: Re: BPF Berkeley Packet Filter Question To: Juan Herrera , freebsd-hackers@freebsd.org References: From: Julian Elischer Message-ID: <56839C88.3090708@freebsd.org> Date: Wed, 30 Dec 2015 16:57:44 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed 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: Wed, 30 Dec 2015 08:57:54 -0000 On 30/12/2015 12:46 PM, Juan Herrera wrote: > Hello BSD folks, > > I am developing a networking application in C and I have a question > regarding BPF (Berkeley Packet Filters), I will give you an idea of the app > first, I need to send a packet from machine A to machine B (any kind of > packet) so for this I wrote a packet generator application which will send > a packet to machine B, but before sending the packet I need to append some > metadata values at the end of the packet, already done, so in machine B I > have a raw socket listener app ready to receive incoming packets from > machine A, however I want to implement filtering with BPF on machine B, but > as my metadata was appended at the end of the packet (have to be at the > end), I need to read the packet length with(using) Berkeley Packet Filter > to match a specific field to filter one of the bytes at the end of my > packet (metadata appended), in other words I need to know the incoming > packet length to filtered against one of the metadatas fields and be able > to drop the packet before reaching user space applications(drop it in > kernel space). > > So my question is, Can I use BPF to read the packet length ? to continue on my previous mail. you can also use netgraph to do this in several ways as well. But I'd need more information to be able to explain what to do. > > TIA! > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" > From owner-freebsd-hackers@freebsd.org Wed Dec 30 12:11:16 2015 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 03C6EA567F8 for ; Wed, 30 Dec 2015 12:11:16 +0000 (UTC) (envelope-from janzon@gmail.com) Received: from mail-wm0-x230.google.com (mail-wm0-x230.google.com [IPv6:2a00:1450:400c:c09::230]) (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 9797E1954; Wed, 30 Dec 2015 12:11:15 +0000 (UTC) (envelope-from janzon@gmail.com) Received: by mail-wm0-x230.google.com with SMTP id f206so64527970wmf.0; Wed, 30 Dec 2015 04:11:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :content-type; bh=dN3TUGL436z0LFY8JK8BdSOWK2bLtNZRVN4ulV5OboE=; b=STZhN5dp4E6kC8AqLKEBvwyVrIY6lEwZZ2fXlqDhhtwqlvEdxdsB2+4z+IkxxZfH1y V0wqVpNl2NKYUGt8UGnkc72BwhSE/suYImyB1+y4kUlK8zzKYDKKogPuaojT1exWK/cX +YJMZCi0cD0+BNq+49/gQY7JmKbi6CH/FoOtiT/pLG2RxOVBnE56+ae2byeKtVIGFY/g +8r1hd/a1zkWnjvYA2QXcd1N8/5skhRL9APD6cf30QGvTZuScS/OuG8X8veQwkinJojw 9zG+6iPH20M5NF3QiUUiEY3Z8frWl6psFnav5hDZS/lNaUSfS6sbFQLc+RLckJvDaP0b TyvA== X-Received: by 10.194.118.162 with SMTP id kn2mr22144423wjb.148.1451477473525; Wed, 30 Dec 2015 04:11:13 -0800 (PST) MIME-Version: 1.0 References: <56839C88.3090708@freebsd.org> In-Reply-To: <56839C88.3090708@freebsd.org> From: Daniel Janzon Date: Wed, 30 Dec 2015 12:11:03 +0000 Message-ID: Subject: Re: BPF Berkeley Packet Filter Question To: Julian Elischer , Juan Herrera , freebsd-hackers@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 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: Wed, 30 Dec 2015 12:11:16 -0000 Hello Julian, I'm not sure I follow what you want to do but maybe I can help you get in the right direction. You can define a BPF program with macros, like struct bpf_insn instructions[] = { ... BPF_JUMP(BPF_JMP + BPF_JEQ + BPF_K, proto, 0, 1), BPF_STMT(BPF_RET + BPF_K, (uint16_t)-1), BPF_STMT(BPF_RET + BPF_K, 0) }; struct bpf_program bpf_program = { 4, (struct bpf_insn*)&instructions }; ioctl(fd, BIOCSETF, (struct bpf_program*)&bpf_program); etc, google for a complete example. Then you can use the -d option of tcpdump to get some help to find the right instructions, for instance tcpdump -i em0 -d host 10.10.10.1 and greater 150 # capture packets greater than 150 You will probably have to modify the output a bit to get what you want so you will have to learn a bit how it works. See the section Filter machine in the bpf manual (man 4 bpf). Hope that helps. All the best, Daniel Janzon On Wed, Dec 30, 2015 at 9:58 AM Julian Elischer wrote: > On 30/12/2015 12:46 PM, Juan Herrera wrote: > > Hello BSD folks, > > > > I am developing a networking application in C and I have a question > > regarding BPF (Berkeley Packet Filters), I will give you an idea of the > app > > first, I need to send a packet from machine A to machine B (any kind of > > packet) so for this I wrote a packet generator application which will > send > > a packet to machine B, but before sending the packet I need to append > some > > metadata values at the end of the packet, already done, so in machine B I > > have a raw socket listener app ready to receive incoming packets from > > machine A, however I want to implement filtering with BPF on machine B, > but > > as my metadata was appended at the end of the packet (have to be at the > > end), I need to read the packet length with(using) Berkeley Packet Filter > > to match a specific field to filter one of the bytes at the end of my > > packet (metadata appended), in other words I need to know the incoming > > packet length to filtered against one of the metadatas fields and be able > > to drop the packet before reaching user space applications(drop it in > > kernel space). > > > > So my question is, Can I use BPF to read the packet length ? > to continue on my previous mail. > > you can also use netgraph to do this in several ways as well. > But I'd need more information to be able to explain what to do. > > > > > TIA! > > _______________________________________________ > > freebsd-hackers@freebsd.org mailing list > > https://lists.freebsd.org/mailman/listinfo/freebsd-hackers > > To unsubscribe, send any mail to " > freebsd-hackers-unsubscribe@freebsd.org" > > > > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" > From owner-freebsd-hackers@freebsd.org Wed Dec 30 15:37:21 2015 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 7D15FA56615 for ; Wed, 30 Dec 2015 15:37:21 +0000 (UTC) (envelope-from mybsdmailing@gmail.com) Received: from mail-oi0-x229.google.com (mail-oi0-x229.google.com [IPv6:2607:f8b0:4003:c06::229]) (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 48F481B6D; Wed, 30 Dec 2015 15:37:21 +0000 (UTC) (envelope-from mybsdmailing@gmail.com) Received: by mail-oi0-x229.google.com with SMTP id l9so175456991oia.2; Wed, 30 Dec 2015 07:37:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=KElUYpmIZdA8OVliE7iphtjxrp2NPLk5+AMQjPKUoZY=; b=Bg/oF2USjTMs+frWJZj5VSlz5/3H+8YLCwSdClJZhUEP5DSl6aT3+YD6mRY70r5YBA V7C4TVfElj5OTDJdmnb4NZxDtgGjhP4gOZ/8a+ak6Jmgq+CB63lA0SRRnpDYrcbT2Gv1 /8dnpnj1985TZKikZfVSo010XumKtDpZgqSLx8eIi2DtbQHvl47yT3o6Y2tfsUJOyako Dg7b8MeGRN594rioQtWGsMztCUCpn7i2RQd649Klf8NiSxD6Fi+Zg0zfjgL8lAAPw/YA F9NIJ9c2jBKA+QvzjIIBQq2704C7UOkqJa2VtVJEW3l54P1NzhdMmoJ5kQbE13jPpzp1 kpGg== MIME-Version: 1.0 X-Received: by 10.202.209.138 with SMTP id i132mr40117339oig.122.1451489840542; Wed, 30 Dec 2015 07:37:20 -0800 (PST) Received: by 10.202.177.69 with HTTP; Wed, 30 Dec 2015 07:37:20 -0800 (PST) In-Reply-To: References: <56839C88.3090708@freebsd.org> Date: Wed, 30 Dec 2015 09:37:20 -0600 Message-ID: Subject: Re: BPF Berkeley Packet Filter Question From: Juan Herrera To: Daniel Janzon Cc: Julian Elischer , freebsd-hackers@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 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: Wed, 30 Dec 2015 15:37:21 -0000 Hello Julian, Daniel I am using raw ethernet, and testing with ARP Brief Explanation of what I want to do I am sending ARP requests packets(encapsulated with my metadata at the end), so it is Raw Ethernet like this "ARP Req bytes + Metadata bytes", I already did a test to filter with BPF jumbo ethernet packets and I can filter if I want against the last byte in the packet, but to do this I need to place in my program code the C filter code (generated with tcpdump), exacly the byte position I want to use for filtering, so the issue with this is that when I receive another ethernet frame that it is not an ARP Req, the byte position to filter will not be the right one(because it moves) to use because the packet is bigger or smaller so my metadata has shift left or shift right depending on the case, so I want BPF to read the total packet length to return it in a variable, and then I use this variable to calculate the right byte to use for filtering, depending on the packet length. I need to match with a specific metadata field base on length, but dont know how to use BPF to read packet's length. Thanks! 2015-12-30 6:11 GMT-06:00 Daniel Janzon : > Hello Julian, > > I'm not sure I follow what you want to do but maybe I can help you get in > the right direction. > > You can define a BPF program with macros, like > > struct bpf_insn instructions[] = { > ... > BPF_JUMP(BPF_JMP + BPF_JEQ + BPF_K, proto, 0, 1), > BPF_STMT(BPF_RET + BPF_K, (uint16_t)-1), > BPF_STMT(BPF_RET + BPF_K, 0) > }; > > struct bpf_program bpf_program = { 4, (struct bpf_insn*)&instructions }; > ioctl(fd, BIOCSETF, (struct bpf_program*)&bpf_program); > > etc, google for a complete example. > > Then you can use the -d option of tcpdump to get some help to find the > right instructions, for instance > > tcpdump -i em0 -d host 10.10.10.1 and greater 150 # capture packets > greater than 150 > > You will probably have to modify the output a bit to get what you want so > you will have to learn a bit how it works. See the section Filter machine > in the bpf manual (man 4 bpf). > > Hope that helps. > > All the best, > Daniel Janzon > > > On Wed, Dec 30, 2015 at 9:58 AM Julian Elischer > wrote: > >> On 30/12/2015 12:46 PM, Juan Herrera wrote: >> > Hello BSD folks, >> > >> > I am developing a networking application in C and I have a question >> > regarding BPF (Berkeley Packet Filters), I will give you an idea of the >> app >> > first, I need to send a packet from machine A to machine B (any kind of >> > packet) so for this I wrote a packet generator application which will >> send >> > a packet to machine B, but before sending the packet I need to append >> some >> > metadata values at the end of the packet, already done, so in machine B >> I >> > have a raw socket listener app ready to receive incoming packets from >> > machine A, however I want to implement filtering with BPF on machine B, >> but >> > as my metadata was appended at the end of the packet (have to be at the >> > end), I need to read the packet length with(using) Berkeley Packet >> Filter >> > to match a specific field to filter one of the bytes at the end of my >> > packet (metadata appended), in other words I need to know the incoming >> > packet length to filtered against one of the metadatas fields and be >> able >> > to drop the packet before reaching user space applications(drop it in >> > kernel space). >> > >> > So my question is, Can I use BPF to read the packet length ? >> to continue on my previous mail. >> >> you can also use netgraph to do this in several ways as well. >> But I'd need more information to be able to explain what to do. >> >> > >> > TIA! >> > _______________________________________________ >> > freebsd-hackers@freebsd.org mailing list >> > https://lists.freebsd.org/mailman/listinfo/freebsd-hackers >> > To unsubscribe, send any mail to " >> freebsd-hackers-unsubscribe@freebsd.org" >> > >> >> _______________________________________________ >> freebsd-hackers@freebsd.org mailing list >> https://lists.freebsd.org/mailman/listinfo/freebsd-hackers >> To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org >> " >> > From owner-freebsd-hackers@freebsd.org Wed Dec 30 16:27:32 2015 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 EEB29A55706 for ; Wed, 30 Dec 2015 16:27:32 +0000 (UTC) (envelope-from janzon@gmail.com) Received: from mail-wm0-x232.google.com (mail-wm0-x232.google.com [IPv6:2a00:1450:400c:c09::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 7EB8118D1; Wed, 30 Dec 2015 16:27:32 +0000 (UTC) (envelope-from janzon@gmail.com) Received: by mail-wm0-x232.google.com with SMTP id f206so70999397wmf.0; Wed, 30 Dec 2015 08:27:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-type; bh=C5UUjeux1HmEpIqAayUA5QQAi/hwABhh8YZyk7eJ2fU=; b=vC7QyexpSgVVfr8su0L+f3JOkUEtyBMQMKBs4YzgHBNZ3jIUQRSiEVKKiPuT0LADuR ex8bgPB6bw/cbfgFVaBRzWhIHCOiEWOe2ZFVHBHkLBZcof5BBABFF3Tv0VX0p9WhEmT0 uPhjbCO5raloV1fGT7XNA6ulJU7S9t6J7Iw496Ia7UcpIT1o/vkQGIiAs5yu0NSiedPG 20yvoDEZWbgbWZTcBQoEku/h4Pb1QT5Jmw8rsSr+EMpCfEtTDF+9WZGZZgADUhXIHL2V aB5Gceof4uq4Rsbon1aC9gqv6ClvSbF28VXUwyc10TK7RMTrT6LpfasmhkczeBlW7ip+ h6pg== X-Received: by 10.28.46.193 with SMTP id u184mr76715151wmu.102.1451492850811; Wed, 30 Dec 2015 08:27:30 -0800 (PST) MIME-Version: 1.0 References: <56839C88.3090708@freebsd.org> In-Reply-To: From: Daniel Janzon Date: Wed, 30 Dec 2015 16:27:21 +0000 Message-ID: Subject: Re: BPF Berkeley Packet Filter Question To: Juan Herrera Cc: Julian Elischer , freebsd-hackers@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 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: Wed, 30 Dec 2015 16:27:33 -0000 Hi again, It's a long time since I used BPF so I might be wrong but I think what you want to do is to (syntax from bpf man page in parenthesis) 1. Load from packet where the length is specified to the ackumulator (A <- P[k:4]). 2. Store the value in the ackumulator to scratch memory (M[k] <- A). 3. Copy value from scratch memory to the index (X <- M[k]). 4. Store the value in the packet at the dynamic position we now have in the index (A <- P[X+k:4]). Each step explained a bit below. Suppose the packet is an array P, at P[47] we can read the position of the value we want to filter on. In this case P[47] = 189. So P[189] contains the value we want to use as basis for filtering. 1. Store P[47] in ackumulator A. 2. Store A in M[0]. 3. Store M[0] in index X. 4. Store P[X] in A (let k=0). Now you can branch depending on the value in A. Under the section "Filter machine" in the BPF manual you can see how to translate the above to BPF macros. Beware if you want to read bytes or words. Regards, Daniel On Wed, Dec 30, 2015 at 4:37 PM Juan Herrera wrote: > Hello Julian, Daniel > > I am using raw ethernet, and testing with ARP > > Brief Explanation of what I want to do > > I am sending ARP requests packets(encapsulated with my metadata at the > end), so it is Raw Ethernet like this "ARP Req bytes + Metadata bytes", I > already did a test to filter with BPF jumbo ethernet packets and I can > filter if I want against the last byte in the packet, but to do this I need > to place in my program code the C filter code (generated with tcpdump), > exacly the byte position I want to use for filtering, so the issue with > this is that when I receive another ethernet frame that it is not an ARP > Req, the byte position to filter will not be the right one(because it > moves) to use because the packet is bigger or smaller so my metadata has > shift left or shift right depending on the case, so I want BPF to read the > total packet length to return it in a variable, and then I use this > variable to calculate the right byte to use for filtering, depending on the > packet length. > > I need to match with a specific metadata field base on length, but dont > know how to use BPF to read packet's length. > > > Thanks! > > 2015-12-30 6:11 GMT-06:00 Daniel Janzon : > >> Hello Julian, >> >> I'm not sure I follow what you want to do but maybe I can help you get in >> the right direction. >> >> You can define a BPF program with macros, like >> >> struct bpf_insn instructions[] = { >> ... >> BPF_JUMP(BPF_JMP + BPF_JEQ + BPF_K, proto, 0, 1), >> BPF_STMT(BPF_RET + BPF_K, (uint16_t)-1), >> BPF_STMT(BPF_RET + BPF_K, 0) >> }; >> >> struct bpf_program bpf_program = { 4, (struct bpf_insn*)&instructions }; >> ioctl(fd, BIOCSETF, (struct bpf_program*)&bpf_program); >> >> etc, google for a complete example. >> >> Then you can use the -d option of tcpdump to get some help to find the >> right instructions, for instance >> >> tcpdump -i em0 -d host 10.10.10.1 and greater 150 # capture packets >> greater than 150 >> >> You will probably have to modify the output a bit to get what you want so >> you will have to learn a bit how it works. See the section Filter machine >> in the bpf manual (man 4 bpf). >> >> Hope that helps. >> >> All the best, >> Daniel Janzon >> >> >> On Wed, Dec 30, 2015 at 9:58 AM Julian Elischer >> wrote: >> >>> On 30/12/2015 12:46 PM, Juan Herrera wrote: >>> > Hello BSD folks, >>> > >>> > I am developing a networking application in C and I have a question >>> > regarding BPF (Berkeley Packet Filters), I will give you an idea of >>> the app >>> > first, I need to send a packet from machine A to machine B (any kind >>> of >>> > packet) so for this I wrote a packet generator application which will >>> send >>> > a packet to machine B, but before sending the packet I need to append >>> some >>> > metadata values at the end of the packet, already done, so in machine >>> B I >>> > have a raw socket listener app ready to receive incoming packets from >>> > machine A, however I want to implement filtering with BPF on machine >>> B, but >>> > as my metadata was appended at the end of the packet (have to be at the >>> > end), I need to read the packet length with(using) Berkeley Packet >>> Filter >>> > to match a specific field to filter one of the bytes at the end of my >>> > packet (metadata appended), in other words I need to know the incoming >>> > packet length to filtered against one of the metadatas fields and be >>> able >>> > to drop the packet before reaching user space applications(drop it in >>> > kernel space). >>> > >>> > So my question is, Can I use BPF to read the packet length ? >>> to continue on my previous mail. >>> >>> you can also use netgraph to do this in several ways as well. >>> But I'd need more information to be able to explain what to do. >>> >>> > >>> > TIA! >>> > _______________________________________________ >>> > freebsd-hackers@freebsd.org mailing list >>> > https://lists.freebsd.org/mailman/listinfo/freebsd-hackers >>> > To unsubscribe, send any mail to " >>> freebsd-hackers-unsubscribe@freebsd.org" >>> > >>> >>> _______________________________________________ >>> freebsd-hackers@freebsd.org mailing list >>> https://lists.freebsd.org/mailman/listinfo/freebsd-hackers >>> To unsubscribe, send any mail to " >>> freebsd-hackers-unsubscribe@freebsd.org" >>> >> > From owner-freebsd-hackers@freebsd.org Wed Dec 30 16:43:32 2015 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 173F5A55E1E for ; Wed, 30 Dec 2015 16:43:32 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "vps1.elischer.org", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id F07D4145B for ; Wed, 30 Dec 2015 16:43:31 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from Julian-MBP3.local (ppp121-45-250-125.lns20.per4.internode.on.net [121.45.250.125]) (authenticated bits=0) by vps1.elischer.org (8.15.2/8.15.2) with ESMTPSA id tBUGhQdB035102 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Wed, 30 Dec 2015 08:43:29 -0800 (PST) (envelope-from julian@freebsd.org) Subject: Re: BPF Berkeley Packet Filter Question To: Daniel Janzon , Juan Herrera , freebsd-hackers@freebsd.org References: <56839C88.3090708@freebsd.org> From: Julian Elischer Message-ID: <568409A8.40508@freebsd.org> Date: Thu, 31 Dec 2015 00:43:20 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.20 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: Wed, 30 Dec 2015 16:43:32 -0000 On 30/12/2015 8:11 PM, Daniel Janzon wrote: > Hello Julian, It's not me that was asking, but Juan I'm sure that he's reading though.. > > I'm not sure I follow what you want to do but maybe I can help you > get in the right direction. > > You can define a BPF program with macros, like > > struct bpf_insn instructions[] = { > ... > BPF_JUMP(BPF_JMP + BPF_JEQ + BPF_K, proto, 0, 1), > BPF_STMT(BPF_RET + BPF_K, (uint16_t)-1), > BPF_STMT(BPF_RET + BPF_K, 0) > }; > > struct bpf_program bpf_program = { 4, (struct bpf_insn*)&instructions }; > ioctl(fd, BIOCSETF, (struct bpf_program*)&bpf_program); > > etc, google for a complete example. > > Then you can use the -d option of tcpdump to get some help to find > the right instructions, for instance > > tcpdump -i em0 -d host 10.10.10.1 and greater 150 # capture packets > greater than 150 > > You will probably have to modify the output a bit to get what you > want so you will have to learn a bit how it works. See the section > Filter machine in the bpf manual (man 4 bpf). > > Hope that helps. > > All the best, > Daniel Janzon > > > On Wed, Dec 30, 2015 at 9:58 AM Julian Elischer > wrote: > > On 30/12/2015 12:46 PM, Juan Herrera wrote: > > Hello BSD folks, > > > > I am developing a networking application in C and I have a > question > > regarding BPF (Berkeley Packet Filters), I will give you an > idea of the app > > first, I need to send a packet from machine A to machine B > (any kind of > > packet) so for this I wrote a packet generator application > which will send > > a packet to machine B, but before sending the packet I need to > append some > > metadata values at the end of the packet, already done, so in > machine B I > > have a raw socket listener app ready to receive incoming > packets from > > machine A, however I want to implement filtering with BPF on > machine B, but > > as my metadata was appended at the end of the packet (have to > be at the > > end), I need to read the packet length with(using) Berkeley > Packet Filter > > to match a specific field to filter one of the bytes at the > end of my > > packet (metadata appended), in other words I need to know the > incoming > > packet length to filtered against one of the metadatas fields > and be able > > to drop the packet before reaching user space > applications(drop it in > > kernel space). > > > > So my question is, Can I use BPF to read the packet length ? > to continue on my previous mail. > > you can also use netgraph to do this in several ways as well. > But I'd need more information to be able to explain what to do. > > > > > TIA! > > _______________________________________________ > > freebsd-hackers@freebsd.org > mailing list > > https://lists.freebsd.org/mailman/listinfo/freebsd-hackers > > To unsubscribe, send any mail to > "freebsd-hackers-unsubscribe@freebsd.org > " > > > > _______________________________________________ > freebsd-hackers@freebsd.org > mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to > "freebsd-hackers-unsubscribe@freebsd.org > " > From owner-freebsd-hackers@freebsd.org Fri Jan 1 17:32:37 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 89F63A5E518 for ; Fri, 1 Jan 2016 17:32:37 +0000 (UTC) (envelope-from j.deboynepollard-newsgroups@ntlworld.com) Received: from know-smtprelay-omc-1.server.virginmedia.net (know-smtprelay-omc-1.server.virginmedia.net [80.0.253.65]) by mx1.freebsd.org (Postfix) with ESMTP id ED21617A6 for ; Fri, 1 Jan 2016 17:32:36 +0000 (UTC) (envelope-from j.deboynepollard-newsgroups@ntlworld.com) Received: from [192.168.1.100] ([86.10.211.13]) by know-smtprelay-1-imp with bizsmtp id 0hXP1s00Q0HtmFq01hXQlt; Fri, 01 Jan 2016 17:31:24 +0000 X-Originating-IP: [86.10.211.13] X-Spam: 0 X-Authority: v=2.1 cv=AJvf2gUA c=1 sm=1 tr=0 a=SB7hr1IvJSWWr45F2gQiKw==:117 a=SB7hr1IvJSWWr45F2gQiKw==:17 a=NLZqzBF-AAAA:8 a=N659UExz7-8A:10 a=6I5d2MoRAAAA:8 a=BtMIoZpE7ZwaW54vCCcA:9 a=pILNOxqGKmIA:10 Subject: Re: pflog(8) manual page bug To: FreeBSD Hackers References: <54430B41.3010301@NTLWorld.com> <54B86FD5.3090203@NTLWorld.com> <554E53EF.4080600@NTLWorld.com> <554E93AF.3070709@NTLWorld.com> <556BA130.50708@NTLWorld.com> <55902328.8080602@NTLWorld.com> <559026FC.3080404@NTLWorld.com> <5591C838.3030006@NTLWorld.com> From: Jonathan de Boyne Pollard Message-ID: <5686B7E3.9030005@NTLWorld.com> Date: Fri, 1 Jan 2016 17:31:15 +0000 User-Agent: Mozilla/5.0 (Windows NT 6.0; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed 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: Fri, 01 Jan 2016 17:32:37 -0000 Warren Block: > Could I convince you to use our bug report system? You could. I don't know whence I learned it, but I'd been working under the misapprehension that the bug reporting was closed like the development tree is. * https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=205776 * https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=205777 * https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=205778 * https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=205786 Enjoy. From owner-freebsd-hackers@freebsd.org Fri Jan 1 18:31:00 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 0E1DCA5E647 for ; Fri, 1 Jan 2016 18:31:00 +0000 (UTC) (envelope-from aled.w.morris@googlemail.com) Received: from mail-ig0-x235.google.com (mail-ig0-x235.google.com [IPv6:2607:f8b0:4001:c05::235]) (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 D22D51BB7 for ; Fri, 1 Jan 2016 18:30:59 +0000 (UTC) (envelope-from aled.w.morris@googlemail.com) Received: by mail-ig0-x235.google.com with SMTP id to4so210442834igc.0 for ; Fri, 01 Jan 2016 10:30:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=P8fa3vlV+LQ2jXQWaYSY20fV2t8+mEbPVn+L6ibyn4E=; b=VDbAU4vSolREn/tqF8kmYO4WQEzoaLmBouLdbMwlr+YOOTxO8KtssCW6kpmOqJHYQj NEUlV9hHJVHQWGuxLyyzANRQOWi6ybyc9u1hicYvcr11q1Zw8gYLzf1swHH9zOmfNuJl Q67IYMHTfW8db44t+eTHXJeYgTvVaQDy1n2pnbFksk/mS0FSynOBKE5q9+BFMizhO6n0 WIrqpiVIWETP4c9mSkLgpQsOfQP7ClPzvA41w9ios9uRtgCfI+AkbRsqo6O9A8vl9/jj NWZrMQM9FAPaNFUiFFFQiUkm0tMPGjbhblaQajqUlO3Vf0wqXeeSBvjZNz0pNcSEc4H6 l6Dw== X-Received: by 10.50.50.9 with SMTP id y9mr74490489ign.46.1451673059269; Fri, 01 Jan 2016 10:30:59 -0800 (PST) MIME-Version: 1.0 Sender: aled.w.morris@googlemail.com Received: by 10.79.114.130 with HTTP; Fri, 1 Jan 2016 10:30:19 -0800 (PST) In-Reply-To: <5686B7E3.9030005@NTLWorld.com> References: <54430B41.3010301@NTLWorld.com> <54B86FD5.3090203@NTLWorld.com> <554E53EF.4080600@NTLWorld.com> <554E93AF.3070709@NTLWorld.com> <556BA130.50708@NTLWorld.com> <55902328.8080602@NTLWorld.com> <559026FC.3080404@NTLWorld.com> <5591C838.3030006@NTLWorld.com> <5686B7E3.9030005@NTLWorld.com> From: Aled Morris Date: Fri, 1 Jan 2016 18:30:19 +0000 X-Google-Sender-Auth: xGULdeYTY6Tt-zLmincEbJpMMPw Message-ID: Subject: Re: pflog(8) manual page bug To: FreeBSD Hackers Cc: Jonathan de Boyne Pollard 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: Fri, 01 Jan 2016 18:31:00 -0000 Those bug reports made me actually LOL. Should I be worried? Aled On 1 January 2016 at 17:31, Jonathan de Boyne Pollard wrote: > Warren Block: >> >> Could I convince you to use our bug report system? > > > You could. I don't know whence I learned it, but I'd been working under the > misapprehension that the bug reporting was closed like the development tree > is. > > * https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=205776 > * https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=205777 > * https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=205778 > * https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=205786 > > Enjoy. > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" From owner-freebsd-hackers@freebsd.org Sat Jan 2 01:24:49 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 294E6A5E5DC for ; Sat, 2 Jan 2016 01:24:49 +0000 (UTC) (envelope-from j.deboynepollard-newsgroups@ntlworld.com) Received: from know-smtprelay-omc-1.server.virginmedia.net (know-smtprelay-omc-1.server.virginmedia.net [80.0.253.65]) by mx1.freebsd.org (Postfix) with ESMTP id 81AF218CB for ; Sat, 2 Jan 2016 01:24:47 +0000 (UTC) (envelope-from j.deboynepollard-newsgroups@ntlworld.com) Received: from [192.168.1.100] ([86.10.211.13]) by know-smtprelay-1-imp with bizsmtp id 0pQm1s00Q0HtmFq01pQmS0; Sat, 02 Jan 2016 01:24:46 +0000 X-Originating-IP: [86.10.211.13] X-Spam: 0 X-Authority: v=2.1 cv=AJvf2gUA c=1 sm=1 tr=0 a=SB7hr1IvJSWWr45F2gQiKw==:117 a=SB7hr1IvJSWWr45F2gQiKw==:17 a=NLZqzBF-AAAA:8 a=IkcTkHD0fZMA:10 a=9sJiun-3AAAA:8 a=DR2r-ZD2LdijVJPnQ70A:9 a=QEXdDO2ut3YA:10 a=_G6b2cv1P-sA:10 Subject: Re: pflog(8) manual page bug To: FreeBSD Hackers References: <54430B41.3010301@NTLWorld.com> <54B86FD5.3090203@NTLWorld.com> <554E53EF.4080600@NTLWorld.com> <554E93AF.3070709@NTLWorld.com> <556BA130.50708@NTLWorld.com> <55902328.8080602@NTLWorld.com> <559026FC.3080404@NTLWorld.com> <5591C838.3030006@NTLWorld.com> <5686B7E3.9030005@NTLWorld.com> From: Jonathan de Boyne Pollard Message-ID: <568726D3.305@NTLWorld.com> Date: Sat, 2 Jan 2016 01:24:35 +0000 User-Agent: Mozilla/5.0 (Windows NT 6.0; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed 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, 02 Jan 2016 01:24:49 -0000 Aled Morris: > Those bug reports made me actually LOL. Should I be worried? Perhaps only if you then do not have the same reaction to these PC-BSD bug reports that I also filed: * https://bugs.freenas.org/issues/12986 * https://bugs.freenas.org/issues/12987 * https://bugs.freenas.org/issues/12988 (-: From owner-freebsd-hackers@freebsd.org Sat Jan 2 09:29:42 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 A861FA5FB7F for ; Sat, 2 Jan 2016 09:29:42 +0000 (UTC) (envelope-from bsd-lists@bsdforge.com) Received: from udns.ultimatedns.net (unknown [IPv6:2602:d1:b4d6:e600:4261:86ff:fef6:aa2a]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 62B821D77 for ; Sat, 2 Jan 2016 09:29:41 +0000 (UTC) (envelope-from bsd-lists@bsdforge.com) Received: from ultimatedns.net (localhost [127.0.0.1]) by udns.ultimatedns.net (8.14.9/8.14.9) with ESMTP id u029TWAb091837 for ; Sat, 2 Jan 2016 01:29:39 -0800 (PST) (envelope-from bsd-lists@bsdforge.com) To: In-Reply-To: References: <54430B41.3010301@NTLWorld.com> <54B86FD5.3090203@NTLWorld.com> <554E53EF.4080600@NTLWorld.com> <554E93AF.3070709@NTLWorld.com> <556BA130.50708@NTLWorld.com> <55902328.8080602@NTLWorld.com> <559026FC.3080404@NTLWorld.com> <5591C838.3030006@NTLWorld.com> <5686B7E3.9030005@NTLWorld.com>, From: "Chris H" Subject: Re: pflog(8) manual page bug Date: Sat, 02 Jan 2016 01:29:39 -0800 Content-Type: text/plain; charset=UTF-8; format=fixed MIME-Version: 1.0 Message-id: Content-Transfer-Encoding: 8bit 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 09:29:42 -0000 Jonathan, these aren't bugs. They're Easter Eggs. ;) Thanks for sharing them, and Happy New Year! --Chris On Fri, 1 Jan 2016 18:30:19 +0000 Aled Morris wrote > Those bug reports made me actually LOL. Should I be worried? > > Aled > > On 1 January 2016 at 17:31, Jonathan de Boyne Pollard > wrote: > > Warren Block: > >> > >> Could I convince you to use our bug report system? > > > > > > You could. I don't know whence I learned it, but I'd been working under > > the misapprehension that the bug reporting was closed like the development > > tree is. > > > > * https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=205776 > > * https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=205777 > > * https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=205778 > > * https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=205786 > > > > Enjoy. From owner-freebsd-hackers@freebsd.org Sat Jan 2 11:28:58 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 6A643A5FCB2 for ; Sat, 2 Jan 2016 11:28:58 +0000 (UTC) (envelope-from j.deboynepollard-newsgroups@ntlworld.com) Received: from know-smtprelay-omc-1.server.virginmedia.net (know-smtprelay-omc-1.server.virginmedia.net [80.0.253.65]) by mx1.freebsd.org (Postfix) with ESMTP id D0BCF1EED for ; Sat, 2 Jan 2016 11:28:56 +0000 (UTC) (envelope-from j.deboynepollard-newsgroups@ntlworld.com) Received: from [192.168.1.100] ([86.10.211.13]) by know-smtprelay-1-imp with bizsmtp id 0zUv1s0020HtmFq01zUvMF; Sat, 02 Jan 2016 11:28:55 +0000 X-Originating-IP: [86.10.211.13] X-Spam: 0 X-Authority: v=2.1 cv=AJvf2gUA c=1 sm=1 tr=0 a=SB7hr1IvJSWWr45F2gQiKw==:117 a=SB7hr1IvJSWWr45F2gQiKw==:17 a=NLZqzBF-AAAA:8 a=IkcTkHD0fZMA:10 a=6I5d2MoRAAAA:8 a=rKG08LzNdwuOBhfLSMgA:9 a=QEXdDO2ut3YA:10 a=ZUGwP7LCt9cA:10 a=IUCpGYfEpY0A:10 a=FSu5OgGmP5kA:10 From: Jonathan de Boyne Pollard Subject: Re: relaunchd: a portable clone of launchd To: FreeBSD Hackers Message-ID: <5687B469.7060001@NTLWorld.com> Date: Sat, 2 Jan 2016 11:28:41 +0000 User-Agent: Mozilla/5.0 (Windows NT 6.0; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed 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, 02 Jan 2016 11:28:58 -0000 Julian Elischer: > It would appear we have an embarrassment of riches. Someone correct > me if I'm wrong but we have: > > * nosh > * actual launchd with jkh's project > * now relaunchd > > and of course some people like the flexibility and debugability of > rc.d and are improving these. Relax. This is a good thing. (-: From my perspective, at least, the best things that you (plural) can be doing right now are: 1. Seeing what you can make of the to-do list that was in the Status Report. * https://www.freebsd.org/news/status/report-2015-07-2015-09.html#The-nosh-Project What can you do to get progress reporting into fsck, for example? Or boot_bare into the loader? 2. Install and use the system. Take the timorous admin's how-to in hand, with PC-BSD or FreeBSD 10, and see how far you get. * http://homepage.ntlworld.com./jonathan.deboynepollard/Softwares/nosh/timorous-admin-installation-how-to.html From owner-freebsd-hackers@freebsd.org Sat Jan 2 13:42:13 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 5814CA5E588 for ; Sat, 2 Jan 2016 13:42:13 +0000 (UTC) (envelope-from j.deboynepollard-newsgroups@ntlworld.com) Received: from know-smtprelay-omc-1.server.virginmedia.net (know-smtprelay-omc-1.server.virginmedia.net [80.0.253.65]) by mx1.freebsd.org (Postfix) with ESMTP id BA3AE1A1D for ; Sat, 2 Jan 2016 13:42:11 +0000 (UTC) (envelope-from j.deboynepollard-newsgroups@ntlworld.com) Received: from [192.168.1.100] ([86.10.211.13]) by know-smtprelay-1-imp with bizsmtp id 11iA1s0180HtmFq011iABf; Sat, 02 Jan 2016 13:42:10 +0000 X-Originating-IP: [86.10.211.13] X-Spam: 0 X-Authority: v=2.1 cv=AJvf2gUA c=1 sm=1 tr=0 a=SB7hr1IvJSWWr45F2gQiKw==:117 a=SB7hr1IvJSWWr45F2gQiKw==:17 a=NLZqzBF-AAAA:8 a=IkcTkHD0fZMA:10 a=e5mUnYsNAAAA:8 a=4Z-9RFdKAAAA:8 a=Cc3N9xrbAAAA:8 a=bg7qaaw2AAAA:8 a=3ygIBvSvAAAA:8 a=DwzA4venf-2cd0zNjlUA:9 a=uQUoIata3h4V7lox:21 a=X1z88faUs4GXzAYo:21 a=QEXdDO2ut3YA:10 a=7Vf-TXLDIfkA:10 a=-FEs8UIgK8oA:10 a=NWVoK91CQyQA:10 From: Jonathan de Boyne Pollard Subject: Re: relaunchd: a portable clone of launchd To: FreeBSD Hackers Message-ID: <5687D3A9.5050400@NTLWorld.com> Date: Sat, 2 Jan 2016 13:42:01 +0000 User-Agent: Mozilla/5.0 (Windows NT 6.0; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed 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, 02 Jan 2016 13:42:13 -0000 Mark Heily: > Then, if a program cares deeply about using the most up-to-date > timezone setting, it can subscribe to notifications about changes in > the time.zone key, instead of constantly polling for changes to > /etc/localtime. > If a program is constantly polling for changes to /etc/localtime, then it should at minimum be rewritten to use kevent/kqueue. But that aside: Mark Heily: > In a nutshell, [stated] is a generic publish/subscribe mechanism for > programs running on a single host to share information about their > internal state and receive notifications about interesting events. > [...] I'm hoping that [it] will present a unified view of all the > important OS configuration settings, so that programs can subscribe to > the ones they care about and get notified when they change. [...] > Notice that the above JSON isn't specific to FreeBSD, so programs > don't need to care about operating-system details like what file in > /etc is used to define the hostname. On Linux, it can be > /etc/hostname; on BSD it can be /etc/rc.conf; instead, all they need > to know is that the current value of the hostname is stored in a key > called "hostname" > > [...] I'm thinking of using D-Bus as the RPC mechanism for relaunchd, > since a lot of open source programs are already using D-Bus. > You've almost reached the point (needing just to take the step of combining what you later said about D-Bus with your ideas about servers that publish events) of reinventing these: * http://www.freedesktop.org/wiki/Software/systemd/timedated/ * http://www.freedesktop.org/wiki/Software/systemd/hostnamed/ * http://www.freedesktop.org/wiki/Software/systemd/localed/ I recommend, to anyone going down this route, looking towards finishing systembsd, especially instead of inventing a wholly new suite of protocols. * https://uglyman.kremlin.cc/gitweb/gitweb.cgi?p=systembsd.git * http://homepage.ntlworld.com./jonathan.deboynepollard/FGA/debian-systemd-packaging-hoo-hah.html * https://news.ycombinator.com/item?id=10176275 The reason is that finishing systemdbsd will make happy all of the people who want the desktop environments whose design is driven largely by Linux to work on FreeBSD/PC-BSD. The desktop environments that they'd like to use have been or are being modified to work with these daemons, over this D-Bus protocol. * http://blog.davidedmundson.co.uk/blog/systemd-and-plasma * https://systemd.events/systemdconf-2015/sessions/kde-plasma-embracing-systemd Giving them another server that speaks another protocol won't help them get their existing GNOME/KDE/whatever client utilities, that speak the hostnamed/timedated/localed protocols, to work. 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. From owner-freebsd-hackers@freebsd.org Sat Jan 2 22:53:12 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 15FC7A5F084 for ; Sat, 2 Jan 2016 22:53:12 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-wm0-x236.google.com (mail-wm0-x236.google.com [IPv6:2a00:1450:400c:c09::236]) (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 A606B10B9 for ; Sat, 2 Jan 2016 22:53:11 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by mail-wm0-x236.google.com with SMTP id f206so105794628wmf.0 for ; Sat, 02 Jan 2016 14:53:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=KXPvKojzmwF8+kUnlyBm7DEQKONrzke1ReJHoKk2FFA=; b=Npo5Navdk+ioBaZ526gIMN/9XmOZYhLBwk/cN+cCXWkPlV0TdMbJe6MidN4SXa6O6s ajc/Q+3mPvoud+xEwl/scFGKF27um7X0zqsr0oJp+iRG46ReVkN8ZKE1BirNXItLf+y/ qAjcT7QRqfsKKwR94mR5uW7CRHevsf4FBP3iueZ0GDpmRh+iwinnNIzyXwpXW0iHa/Nh 4A5Bqu2JZ5uaadyGukwRSSqNOvJlnd/s3ks7oY/M98RXvtOiOmygQw5WLeVLDA29W6MV h1XmHDcBydbH4qiM/IAvxUQEj2/nzUX6TSmQnM496+Na5TOYbnXnhdftcSPu/c/mI3ul QrdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=KXPvKojzmwF8+kUnlyBm7DEQKONrzke1ReJHoKk2FFA=; b=ej1tlLkell5qT4pWeoWFHH4g6UPQhUbgismGyQdWPyFcMDGCQtH6CO3DCVR9BKcmXh eh8npWDM/yjMXWszKG/DfWnIXrku40l7uJhXEBm4YyURxsNjBAAv8Y0XJ8Onrp4523+h wtLgPm8h2HNfZF5+QWFBeY0awJ0HYMoNysaiHch/9QJXZvE/fTcZrQliWDun4tNfZAAC b0GX78nm1Wxy0yXJ96a6Y1GFxf6q2COmicMW0jS0XJnexC4k/hnujXhge9RSn16xIZg5 9V6R2eR2Imf2LC8jhEuj5LjVdyXCvSFa9VVW4IKRVpFHMQv3QhqIJiP3foVvuDGBvneQ 6rBw== X-Gm-Message-State: ALoCoQmFRnAVnudgIKxWoQCB8ni/E6Dpu+/kANdU9Ij13sMUTI/3xN05FyVDqRSascATqzxOKSnJGqbT0rP2HdY+tUlQI2w5GCEOapxWqd/VmJhVs1J9cWg= MIME-Version: 1.0 X-Received: by 10.194.178.70 with SMTP id cw6mr88047771wjc.73.1451775190217; Sat, 02 Jan 2016 14:53:10 -0800 (PST) Received: by 10.194.85.167 with HTTP; Sat, 2 Jan 2016 14:53:10 -0800 (PST) In-Reply-To: References: Date: Sat, 2 Jan 2016 23:53:10 +0100 Message-ID: Subject: Re: Getting a core dump of a process without killing it? From: Oliver Pinter To: Dieter BSD Cc: "freebsd-hackers@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 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:53:12 -0000 On Saturday, January 2, 2016, Dieter BSD wrote: > 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. Take a look at gcore command. > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org > " >