Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 3 Oct 2018 14:45:48 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r339127 - stable/11/cddl/contrib/opensolaris/cmd/zdb
Message-ID:  <201810031445.w93Ejm5s030045@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Wed Oct  3 14:45:48 2018
New Revision: 339127
URL: https://svnweb.freebsd.org/changeset/base/339127

Log:
  MFC r337179: 9523 Large alloc in zdb can cause trouble
  
  16MB alloc in zdb_embedded_block() can cause cores in certain situations
  (clang, gcc55).
  
  OsX commit: https://github.com/openzfsonosx/zfs/commit/ced236a5da6e72ea7bf6d2919fe14e17cffe10f1
  FreeBSD commit: https://svnweb.freebsd.org/base?view=revision&revision=326150
  illumos/illumos-gate@03a4c2f4bfaca30115963b76445279b36468a614
  
  Reviewed by: Igor Kozhukhov <igor@dilos.org>
  Reviewed by: Andriy Gapon <avg@FreeBSD.org>
  Reviewed by: Matthew Ahrens <mahrens@delphix.com>
  Approved by: Dan McDonald <danmcd@joyent.com>
  Author:     Jorgen Lundman <lundman@lundman.net>
  
  This is an update for r326150 (by avg), where this change comes from.

Modified:
  stable/11/cddl/contrib/opensolaris/cmd/zdb/zdb.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/cddl/contrib/opensolaris/cmd/zdb/zdb.c
==============================================================================
--- stable/11/cddl/contrib/opensolaris/cmd/zdb/zdb.c	Wed Oct  3 14:44:16 2018	(r339126)
+++ stable/11/cddl/contrib/opensolaris/cmd/zdb/zdb.c	Wed Oct  3 14:45:48 2018	(r339127)
@@ -4950,19 +4950,18 @@ zdb_embedded_block(char *thing)
 	    words + 8, words + 9, words + 10, words + 11,
 	    words + 12, words + 13, words + 14, words + 15);
 	if (err != 16) {
-		(void) printf("invalid input format\n");
+		(void) fprintf(stderr, "invalid input format\n");
 		exit(1);
 	}
 	ASSERT3U(BPE_GET_LSIZE(&bp), <=, SPA_MAXBLOCKSIZE);
 	buf = malloc(SPA_MAXBLOCKSIZE);
 	if (buf == NULL) {
-		(void) fprintf(stderr, "%s: failed to allocate %llu bytes\n",
-		    __func__, SPA_MAXBLOCKSIZE);
+		(void) fprintf(stderr, "out of memory\n");
 		exit(1);
 	}
 	err = decode_embedded_bp(&bp, buf, BPE_GET_LSIZE(&bp));
 	if (err != 0) {
-		(void) printf("decode failed: %u\n", err);
+		(void) fprintf(stderr, "decode failed: %u\n", err);
 		free(buf);
 		exit(1);
 	}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201810031445.w93Ejm5s030045>