Print this page
4229 mdb hangs on exit when long umem cache names exist
Reviewed by: Robert Mustacchi <rm@joyent.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/mdb/common/mdb/mdb_nv.h
          +++ new/usr/src/cmd/mdb/common/mdb/mdb_nv.h
↓ open down ↓ 15 lines elided ↑ open up ↑
  16   16   * If applicable, add the following below this CDDL HEADER, with the
  17   17   * fields enclosed by brackets "[]" replaced with your own identifying
  18   18   * information: Portions Copyright [yyyy] [name of copyright owner]
  19   19   *
  20   20   * CDDL HEADER END
  21   21   */
  22   22  /*
  23   23   * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
  24   24   * Use is subject to license terms.
  25   25   */
       26 +/*
       27 + * Copyright (c) 2013 Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
       28 + */
  26   29  
  27   30  #ifndef _MDB_NV_H
  28   31  #define _MDB_NV_H
  29   32  
  30      -#pragma ident   "%Z%%M% %I%     %E% SMI"
  31      -
  32   33  #include <sys/types.h>
  33   34  
  34   35  #ifdef  __cplusplus
  35   36  extern "C" {
  36   37  #endif
  37   38  
  38   39  #ifdef _MDB
  39   40  
       41 +/*
       42 + * There used to be a cap (MDB_NV_NAMELEN bytes including null) on the
       43 + * length of variable names stored in-line.  This cap is no longer there,
       44 + * however parts of mdb use the constant to sanitize input.
       45 + */
  40   46  #define MDB_NV_NAMELEN  31      /* Max variable name length including null */
  41   47  
  42   48  /*
  43   49   * These flags are stored inside each variable in v_flags:
  44   50   */
  45   51  #define MDB_NV_PERSIST  0x01    /* Variable is persistent (cannot be unset) */
  46   52  #define MDB_NV_RDONLY   0x02    /* Variable is read-only (cannot insert over) */
  47   53  #define MDB_NV_EXTNAME  0x04    /* Variable name is stored externally */
  48   54  #define MDB_NV_TAGGED   0x08    /* Variable is tagged (user-defined) */
  49   55  #define MDB_NV_OVERLOAD 0x10    /* Variable can be overloaded (multiple defs) */
↓ open down ↓ 17 lines elided ↑ open up ↑
  67   73          void (*disc_set)(struct mdb_var *, uintmax_t);
  68   74          uintmax_t (*disc_get)(const struct mdb_var *);
  69   75  } mdb_nv_disc_t;
  70   76  
  71   77  /*
  72   78   * Each variable is defined by the following variable-length structure.
  73   79   * The debugger uses name/value collections to hash almost everything, so
  74   80   * we make a few simple space optimizations:
  75   81   *
  76   82   * A variable's name can be a pointer to external storage (v_ename and
  77      - * MDB_NV_EXTNAME set), or it can be stored locally (MDB_NV_NAMELEN - 1
  78      - * bytes of storage are allocated immediately after v_lname[0]).
       83 + * MDB_NV_EXTNAME set), or it can be stored locally (bytes of storage are
       84 + * allocated immediately after v_lname[0]).
  79   85   *
  80   86   * A variable may have multiple definitions (v_ndef chain), but this feature
  81   87   * is mutually exclusive with MDB_NV_EXTNAME in order to save space.
  82   88   */
  83   89  typedef struct mdb_var {
  84   90          uintmax_t v_uvalue;             /* Value as unsigned integral type */
  85   91          union {
  86   92                  const char *v_ename;    /* Variable name if stored externally */
  87   93                  struct mdb_var *v_ndef; /* Variable's next definition */
  88   94          } v_du;
↓ open down ↓ 61 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX