From owner-svn-src-head@freebsd.org Mon Jul 17 17:45:32 2017 Return-Path: Delivered-To: svn-src-head@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 7C41BD9BC9A; Mon, 17 Jul 2017 17:45:32 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qk0-x241.google.com (mail-qk0-x241.google.com [IPv6:2607:f8b0:400d:c09::241]) (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 2BAB56986B; Mon, 17 Jul 2017 17:45:32 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-qk0-x241.google.com with SMTP id z22so2854465qka.2; Mon, 17 Jul 2017 10:45:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=TGGagnh0IwmE7u5l4LlTfANFqvwFEI0wqmc4OhGRfI8=; b=XH2JG6DS0YXNLeNCNOUkH0GqVqh/HidZ2dat1zXHa5WVCDlsLd/6+iZ88CDQZlDUvS Zg0VmBkgAox7mfGzf1DFUk07G3SwlSB/GwdqV5SemwDb4Ot9QjDriMGmydAz/z6z3HhB +QyJY+DWRyAEYdlKZ7StfR121L3JXVDI0nx2sCT8iBg6MGUEJ6oEWSAXPaxygLfuQJ3V UK66VsVUtu+ukXPzQa8vjl7Gnr1FigosjrmTjQpZuev8rc+ZXn3JHFR+S986V36kb8CK ahPlrtSZzE+XCF8PP0aUUfIcIKvxw9q8E9NcXvXJ0yUhh28WgCWIve/ytmnmqViRKDe9 gfgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=TGGagnh0IwmE7u5l4LlTfANFqvwFEI0wqmc4OhGRfI8=; b=LjmAvYGFGwOyuJbdOTjZo86wZA+u9QOrQqniRiH3WZ37GZ5vORdTZjPD7nXlUZOi9D bLvGpAjeMdF1Y0FzKpBcyQEQP8gPBN7frm90qdVfLk1qa9f+OG5yvm5TJM16vSpve0r5 ar1i+hgcvwSPYX215YQkA/suVI/L41M1/x3hUbNZqO6cDGLmKzN4EYfdbgqxHcbXiiHF w9HQbsrVTvzZcaV9VtjAubqH+1M9XwR84kExpKmxRbWNSNceNwJQoKEBDA1AL0eIlK3w z/Ptfo/sz1Y5scV3YFZzThyKuSJmAME73tSas7+FLmn3kUhcj5LBfjH+o1YgXGuLEbdY zvEA== X-Gm-Message-State: AIVw11098vm4k3Ierj4Lk4at3UnLV3Q0qIaPslGCqSTZ68UEnPDQDEVz Gwp7GhSfGCJ4q9IX X-Received: by 10.55.175.3 with SMTP id y3mr26570161qke.185.1500313531038; Mon, 17 Jul 2017 10:45:31 -0700 (PDT) Received: from wkstn-mjohnston.west.isilon.com (c-76-104-201-218.hsd1.wa.comcast.net. [76.104.201.218]) by smtp.gmail.com with ESMTPSA id c5sm10696568qkd.27.2017.07.17.10.45.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 17 Jul 2017 10:45:30 -0700 (PDT) Sender: Mark Johnston Date: Mon, 17 Jul 2017 10:46:18 -0700 From: Mark Johnston To: John Baldwin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r320918 - head/sbin/savecore Message-ID: <20170717174618.GE95367@wkstn-mjohnston.west.isilon.com> References: <201707121829.v6CITPxG012102@repo.freebsd.org> <1930640.IHpqZ2aWqS@ralph.baldwin.cx> <20170712234108.GA48612@wkstn-mjohnston.west.isilon.com> <7394656.HeKS8RJobr@ralph.baldwin.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7394656.HeKS8RJobr@ralph.baldwin.cx> User-Agent: Mutt/1.8.3 (2017-05-23) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jul 2017 17:45:32 -0000 On Mon, Jul 17, 2017 at 09:48:53AM -0700, John Baldwin wrote: > On Wednesday, July 12, 2017 04:41:09 PM Mark Johnston wrote: > > On Wed, Jul 12, 2017 at 02:23:52PM -0700, John Baldwin wrote: > > > On Wednesday, July 12, 2017 06:29:25 PM Mark Johnston wrote: > > > > Author: markj > > > > Date: Wed Jul 12 18:29:25 2017 > > > > New Revision: 320918 > > > > URL: https://svnweb.freebsd.org/changeset/base/320918 > > > > > > > > Log: > > > > Add a newline after the version string. > > > > > > > > MFC after: 3 days > > > > > > I think the version string normally has a trailing \n emedded in it? > > > > You're right. The problem in my case is that the version string is > > getting truncated in mkdumpheader(), and so the trailing \n is omitted. > > > > > Also, > > > have you verified that crashinfo is still able to match the Version String > > > from the generated info.X file? I think it might as it stops printing lines > > > once it matches the second line of the version, so I think (just reading the > > > awk) that it will not include the extra newline in the 'ivers' compared > > > against 'version' from gdb. > > > > That's true, but it looks like it doesn't work properly in the truncated > > case. What if we declare a match when the version string in the info.X > > file matches a prefix of the version string reported by gdb? > > Sorry I didn't reply earlier. I think the patch below for crashinfo is fine > (but have not tested it myself): I did test it with both truncated and non-truncated version strings (with r321035 applied). The bit that gets truncated first is the objdir path, so I think it'd be unlikely that we match the wrong kernel: the build time and build number are also both contained in the version string. > > > diff --git a/usr.sbin/crashinfo/crashinfo.sh b/usr.sbin/crashinfo/crashinfo.sh > > index e52c01419b0d..b3029c6eea4a 100755 > > --- a/usr.sbin/crashinfo/crashinfo.sh > > +++ b/usr.sbin/crashinfo/crashinfo.sh > > @@ -85,8 +85,9 @@ find_kernel() > > > > # Look for a matching kernel version. > > for k in `sysctl -n kern.bootfile` $(ls -t /boot/*/kernel); do > > - kvers=$(gdb_command $k 'printf " Version String: %s", version' \ > > - 2>/dev/null) > > + kvers=$(gdb_command $k 'printf " Version String: %s", version' | \ > > + awk "{line=line\$0\"\n\"} END{print substr(line,1,${#ivers})}" \ > > + 2>/dev/null) > > if [ "$ivers" = "$kvers" ]; then > > KERNEL=$k > > break > > > > > -- > John Baldwin