From 2f3e88a2ae884dfc1a740509fcb6f469cc3b115c Mon Sep 17 00:00:00 2001 From: Richard Lowe Date: Thu, 30 Oct 2014 23:20:21 -0400 Subject: 4989 removal of ntfsprogs and parted (missed files) --- usr/src/cmd/parted/AUTHORS.txt | 233 --------------- usr/src/cmd/parted/strlist.c | 586 -------------------------------------- usr/src/lib/libparted/AUTHORS.txt | 233 --------------- 3 files changed, 1052 deletions(-) delete mode 100644 usr/src/cmd/parted/AUTHORS.txt delete mode 100644 usr/src/cmd/parted/strlist.c delete mode 100644 usr/src/lib/libparted/AUTHORS.txt (limited to 'usr/src') diff --git a/usr/src/cmd/parted/AUTHORS.txt b/usr/src/cmd/parted/AUTHORS.txt deleted file mode 100644 index e955e6f58c..0000000000 --- a/usr/src/cmd/parted/AUTHORS.txt +++ /dev/null @@ -1,233 +0,0 @@ -This file is part of GNU Parted -Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 - Free Software Foundation Inc. - -This file may be modified and/or distributed without restriction. This is -not an invitation to misrepresent who contributed to GNU Parted. - -------------------------------------------------------------------------------- - -We need to keep track of copyright (see the Maintainer HOWTO on www.gnu.org). - - -Leslie Patrick Polzer - * parts of 1.6.24 PedUnit API - * GPT pth_* functions and block size fixes - * PED_SECTOR_SIZE -> PED_SECTOR_SIZE_DEFAULT - * debugging framework - * ext2 "strange layout" fix (experimental) - * support for physical block sizes - * SCO BFS support - - http://nic-nac-project.de/~skypher/ - - Snail Mail: - Am Kirchberg 15 - 89537 Giengen - Germany - -Andrew Clausen - * all FAT code (libparted/fs_fat) - * all linux-swap code (libparted/fs_linux_swap) - * some reiserfs glue code (libparted/fs_reiserfs) with Umanets - * most of the API (with lots of discussion with Lennert Buytenhek) - (include/parted/*) - * generic filesystem code (filesys.c) and device code (device.c) - * exception code (exception.c, debug.c) - * partition table code (disk.c) - * dos partition support (disk_dos.c) - * mac partition support (disk_mac.c) - * mips partition support (disk_mips.c) - * loopback support (disk_loop.c) - * some of the PC98 code (disk_pc98.c), with Masahiro Sakai. - * misc. hacking on all disk_*.c code - * low-level I/O code (device.c, geom.c, linux.c) - - init_scsi() stolen from gnome-gfdisk via Matt Wilson. - * constraint solver (natmath.c, constraint.c) - * command-line, and fdisk-like frontend (parted/*) - * stubs for ntfs, hfs, xfs - * hacked on libparted/fs_ext2 a fair bit (bug fixes, error handling, - support for > 1024 groups, etc.) - * libparted/mbr.s (the MBR boot loader code) - * misc hacking on GNU/Hurd port - * major surgery on GUID Partition Table (GPT) support (disk_gpt.[ch]) - * progress meter support (libparted/timer.c include/parted/timer.h) - - Snail mail: - 18 Shaw St - Ashwood, 3147 - Australia - -Lennert Buytenhek - * original ext2 code (libparted/fs_ext2) - * discussion/ideas for API - -Matthew Wilson - * basis of partition table and device code (disk.c, disk_dos.c, - and device.c) Has morphed into something that looks completely - different now :-) - * bug fixes - * BSD disklabel support (disk_bsd.c) - * Python bindings to libparted - * Don't detect AIX physical volumes as msdos partition tables - * Code for manipulating AIX PVs - -Martin von Löwis - * German translations - -Baty Jean-Marc - * French translations - -Hiroshi Takekawa - * Japanese translations - -Eliphas Levy Theodoro - * Brazillian Portugese translations - -Dmitry S. Sivachenko - * Russian translations - -Timshel Knoll - * man pages (parted.8 partprobe.8) - * bug fixes - -Ivo Timmermans - * Dutch translations - -Ryoji Kawagishi - * Japanese translation of doc/USER (user documentation) - (replaced by Okuji's version, now) - -Okuji Yoshinori - * doc/USER.jp - * contributions to Japanese translations - -Masahiro Sakai - * most of the PC98 support (disk_pc98.c), with Andrew Clausen - * lots of tedious work on parted/strlist.c - -Damien Genet - * parted.m4 - -Ben Collins - * Sun disk label support (libparted/disk_sun.c) - * stubs for UFS - -Vincent Stelhé - * move syntax patch (make END specification optional). Trivial - for copyright purposes (no disclaimer needed) - -Neal H Walfield - * GNU/Hurd port - libparted/gnu.c - -Thomas Roelz - * misc bug fixes - -Matt Domsch - * GUID Partition Table (GPT) support (disk_gpt.[ch], - crc32.[ch]) - * misc bug fixes, including end-of-device workaround - in libparted/linux.c - -Kjetil Torgrim Homme - * Norweigen translations - -Jörgen Tegnér - * Swedish translations - -Keld Simonsen - * Danish translations - -Richard M. Kreuter - * converted doc/USER to texinfo (doc/parted.texi) - -Miquel Matas - * Catalan translations - -Andreas Dilger - * lots of mix bug fixes/cleanups - -Vicente E. Llorens - * Spanish translations - -Yury Umanets - * basis of libparted/fs_reiserfs - -Bernardo João Torres da Silveira - - * pt_BR translation of FAQ and parted.texi - -Wojciech Polak - * Polish translations - -Miloslav Trmac - * Czech translations - -Maxim V. Dziumanenko - * Ukrainian translations - -Giuseppe Sacco - * Italian translations - -Guillaume Knispel - * nearly all hfs and hfs+ code (libparted/fs_hfs) - * hfs+ support for mac partitions (disk_mac.c) - * sync_fast code (linux.c gnu.c geom.[ch] device.[ch] ) - * various fixes (parted.c ui.c filesys.c disk_dos.c disk.c - doc/parted.texi doc/API disk_gpt.c disk_mac.c unit.c fs_fat/traverse.c) - -Chris Lumens - * interactive help fixes for filesystem types - * gcc-4 pedanticism cleanups - -Wei-Lun Chao - * Taiwanese dialect of Chinese (Cantonese?) translations. - -Tran Thi Hoang Quyen - * Vietnamese translations - -Eduardo Maestri Righes - * hidden partitions support - * setting MS Reserved partitions through "set" command. - -Arif E. Nugroho - * Indonesian translations - -Ithamar R. Adema - * BeOS support - -David Cantrell - * Added support for Promise SX8 devices (original patch from Jeremy - Katz ) - * Brought IBM/Red Hat DASD patches forward to parted-1.7.x - Original IBM authors: Volker Sameske - Horst Hummel - Original Red Hat authors: Phil Knirsch - Harald Hoyer - * Prevent SIGFPE when FAT sector size is 0 - * Add virtual DASD (VIODASD) on iSeries support - * Use O_DIRECT I/O to prevent first partition corruption on GPT disks - * Prevent sector reading exceptions from ped_geometry_check() on Mac - disklabels. - * Various bug fixes and other things. - -Peter Jones - * Add ped_exception_get_handler() - * /dev/mapper read/write support on Linux (via libdevmapper) - -Darren Lavender - * Fix SIGSEGV in parted 1.6.19 and assertion error in 1.7.0 - * Add support for LUN/device resize detection and option GPT - header corruption - * Fixed off-by-one error in GPT header that allowed for overlap - between LDAs of LastUsableLBA and PartitionEntryLBA in backup GPT - -Olaf Hering - * Fixes for Macintosh disk label code - -Debarshi Ray - * Display disk model and transport type in parted(8). - * '--list/-l' command line switch. - * Introduce 'print devices' and alias 'print list' to 'print all'. - * Alias 'mktable' to 'mklabel'. - * Code and API clean-up, bug fixes, and other miscellaneous stuff. diff --git a/usr/src/cmd/parted/strlist.c b/usr/src/cmd/parted/strlist.c deleted file mode 100644 index 6b4568ae08..0000000000 --- a/usr/src/cmd/parted/strlist.c +++ /dev/null @@ -1,586 +0,0 @@ -/* - parted - a frontend to libparted - Copyright (C) 1999, 2000, 2001, 2007 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ - -#include - -#include - -#include -#include -#include -#include -#include -#include -#include -#include "xalloc.h" - -#ifdef ENABLE_NLS - -#undef __USE_GNU -#define __USE_GNU - -#include -#include - -#else /* ENABLE_NLS */ - -#ifdef wchar_t -#undef wchar_t -#endif - -#define wchar_t char - -#endif /* !ENABLE_NLS */ - -#include "strlist.h" - -#define MIN(a,b) ( (anext = NULL; - - return list; -} - -void -str_list_destroy (StrList* list) -{ - if (list) { - str_list_destroy (list->next); - str_list_destroy_node (list); - } -} - -void -str_list_destroy_node (StrList* list) -{ - free ((wchar_t*) list->str); - free (list); -} - -StrList* -str_list_duplicate_node (const StrList* node) -{ - StrList* result = str_list_alloc (); - result->str = wchar_strdup (node->str); - return result; -} - -StrList* -str_list_duplicate (const StrList* list) -{ - if (list) - return str_list_join (str_list_duplicate_node (list), - str_list_duplicate (list->next)); - else - return NULL; -} - -StrList* -str_list_join (StrList* a, StrList* b) -{ - StrList* walk; - - for (walk = a; walk && walk->next; walk = walk->next); - - if (walk) { - walk->next = b; - return a; - } else { - return b; - } -} - -static StrList* -_str_list_append (StrList* list, const wchar_t* str) -{ - StrList* walk; - - if (list) { - for (walk = list; walk->next; walk = walk->next); - walk->next = str_list_alloc (); - walk = walk->next; - } else { - walk = list = str_list_alloc (); - } - walk->str = str; - - return list; -} - -StrList* -str_list_append (StrList* list, const char* str) -{ - return _str_list_append (list, gettext_to_wchar (str)); -} - -StrList* -str_list_append_unique (StrList* list, const char* str) -{ - StrList* walk; - wchar_t* new_str = gettext_to_wchar (str); - - for (walk=list; walk; walk=walk->next) { - if (walk->str) { - if (wchar_strcasecmp (new_str, walk->str) == 0) { - free (new_str); - return list; - } - } - } - - return _str_list_append (list, new_str); -} - -StrList* -str_list_insert (StrList* list, const char* str) -{ - return str_list_join (str_list_create (str, NULL), list); -} - -StrList* -str_list_create (const char* first, ...) -{ - va_list args; - char* str; - StrList* list; - - list = str_list_append (NULL, first); - - if (first) { - va_start (args, first); - while ( (str = va_arg (args, char*)) ) - str_list_append (list, str); - va_end (args); - } - - return list; -} - -StrList* -str_list_create_unique (const char* first, ...) -{ - va_list args; - char* str; - StrList* list; - - list = str_list_append (NULL, first); - - if (first) { - va_start (args, first); - while ( (str = va_arg (args, char*)) ) - str_list_append_unique (list, str); - va_end (args); - } - - return list; -} - -char* -str_list_convert_node (const StrList* list) -{ - return wchar_to_str (list->str, 0); -} - -char* -str_list_convert (const StrList* list) -{ - const StrList* walk; - int pos = 0; - int length = 1; - char* str = xstrdup (""); - - for (walk = list; walk; walk = walk->next) { - if (walk->str) { - char* tmp = wchar_to_str (walk->str, 0); - - length += strlen (tmp); - - str = realloc (str, length); - strcpy (str + pos, tmp); - - pos = length - 1; - free (tmp); - } - } - - return str; -} - -void -str_list_print (const StrList* list) -{ - const StrList* walk; - - for (walk=list; walk; walk=walk->next) { - if (walk->str) - print_wchar (walk->str, 0); - } -} - -static int -str_search (const wchar_t* str, int n, wchar_t c) -{ - int i; - - for (i=0; i 10, return); - - line_left = line_length - offset; - - for (walk=list; walk; walk=walk->next) { - if (!walk->str) - continue; - str = walk->str; - str_len = wchar_strlen (str); - - while (line_left < str_len || wchar_strchr (str, '\n')) { - line_break = 0; - - cut_left = MIN (line_left - 1, str_len - 1); - - /* we can have a space "over", but not a comma */ - if (cut_left < str_len - && is_space (str [cut_left + 1])) - cut_left++; - - while (cut_left && !is_break_point (str [cut_left])) - cut_left--; - while (cut_left && is_space (str [cut_left])) - cut_left--; - - /* str [cut_left] is either the end of a word, or a - * Japanese character, or the start of a blank line. - */ - - search_result = str_search (str, cut_left + 1, '\n'); - if (search_result != -1) { - cut_left = search_result - 1; - line_break = 1; - } - - for (cut_right = cut_left + (line_break ? 2 : 1); - cut_right < str_len && is_space (str [cut_right]); - cut_right++); - - if (cut_left > 0) - print_wchar (str, cut_left + 1); - - str += cut_right; - str_len -= cut_right; - line_left = line_length - indent; - - if (walk->next || *str) - printf ("\n%*s", indent, ""); - else if (line_break) - putchar ('\n'); - } - - print_wchar (str, 0); - line_left -= wchar_strlen (str); - } -} - -static int -_str_list_match_node (const StrList* list, const wchar_t* str) -{ - if (wchar_strcasecmp (list->str, str) == 0) - return 2; - if (wchar_strncasecmp (list->str, str, wchar_strlen (str)) == 0) - return 1; - return 0; -} - -int -str_list_match_node (const StrList* list, const char* str) -{ - wchar_t* wc_str = gettext_to_wchar (str); /* FIXME */ - int status; - - status = _str_list_match_node (list, wc_str); - free (wc_str); - - return status; -} - -/* returns: 2 for full match - 1 for partial match - 0 for no match - */ -int -str_list_match_any (const StrList* list, const char* str) -{ - const StrList* walk; - int best_status = 0; - wchar_t* wc_str = gettext_to_wchar (str); - - for (walk = list; walk; walk = walk->next) { - int this_status = _str_list_match_node (walk, wc_str); - if (this_status > best_status) - best_status = this_status; - } - - free (wc_str); - return best_status; -} - -StrList* -str_list_match (const StrList* list, const char* str) -{ - const StrList* walk; - const StrList* partial_match = NULL; - int ambiguous = 0; - wchar_t* wc_str = gettext_to_wchar (str); - - for (walk = list; walk; walk = walk->next) { - switch (_str_list_match_node (walk, wc_str)) { - case 2: - free (wc_str); - return (StrList*) walk; - - case 1: - if (partial_match) - ambiguous = 1; - partial_match = walk; - } - } - - free (wc_str); - return ambiguous ? NULL : (StrList*) partial_match; -} - -int -str_list_length (const StrList* list) -{ - int length = 0; - const StrList* walk; - - for (walk = list; walk; walk = walk->next) - length++; - - return length; -} diff --git a/usr/src/lib/libparted/AUTHORS.txt b/usr/src/lib/libparted/AUTHORS.txt deleted file mode 100644 index e955e6f58c..0000000000 --- a/usr/src/lib/libparted/AUTHORS.txt +++ /dev/null @@ -1,233 +0,0 @@ -This file is part of GNU Parted -Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 - Free Software Foundation Inc. - -This file may be modified and/or distributed without restriction. This is -not an invitation to misrepresent who contributed to GNU Parted. - -------------------------------------------------------------------------------- - -We need to keep track of copyright (see the Maintainer HOWTO on www.gnu.org). - - -Leslie Patrick Polzer - * parts of 1.6.24 PedUnit API - * GPT pth_* functions and block size fixes - * PED_SECTOR_SIZE -> PED_SECTOR_SIZE_DEFAULT - * debugging framework - * ext2 "strange layout" fix (experimental) - * support for physical block sizes - * SCO BFS support - - http://nic-nac-project.de/~skypher/ - - Snail Mail: - Am Kirchberg 15 - 89537 Giengen - Germany - -Andrew Clausen - * all FAT code (libparted/fs_fat) - * all linux-swap code (libparted/fs_linux_swap) - * some reiserfs glue code (libparted/fs_reiserfs) with Umanets - * most of the API (with lots of discussion with Lennert Buytenhek) - (include/parted/*) - * generic filesystem code (filesys.c) and device code (device.c) - * exception code (exception.c, debug.c) - * partition table code (disk.c) - * dos partition support (disk_dos.c) - * mac partition support (disk_mac.c) - * mips partition support (disk_mips.c) - * loopback support (disk_loop.c) - * some of the PC98 code (disk_pc98.c), with Masahiro Sakai. - * misc. hacking on all disk_*.c code - * low-level I/O code (device.c, geom.c, linux.c) - - init_scsi() stolen from gnome-gfdisk via Matt Wilson. - * constraint solver (natmath.c, constraint.c) - * command-line, and fdisk-like frontend (parted/*) - * stubs for ntfs, hfs, xfs - * hacked on libparted/fs_ext2 a fair bit (bug fixes, error handling, - support for > 1024 groups, etc.) - * libparted/mbr.s (the MBR boot loader code) - * misc hacking on GNU/Hurd port - * major surgery on GUID Partition Table (GPT) support (disk_gpt.[ch]) - * progress meter support (libparted/timer.c include/parted/timer.h) - - Snail mail: - 18 Shaw St - Ashwood, 3147 - Australia - -Lennert Buytenhek - * original ext2 code (libparted/fs_ext2) - * discussion/ideas for API - -Matthew Wilson - * basis of partition table and device code (disk.c, disk_dos.c, - and device.c) Has morphed into something that looks completely - different now :-) - * bug fixes - * BSD disklabel support (disk_bsd.c) - * Python bindings to libparted - * Don't detect AIX physical volumes as msdos partition tables - * Code for manipulating AIX PVs - -Martin von Löwis - * German translations - -Baty Jean-Marc - * French translations - -Hiroshi Takekawa - * Japanese translations - -Eliphas Levy Theodoro - * Brazillian Portugese translations - -Dmitry S. Sivachenko - * Russian translations - -Timshel Knoll - * man pages (parted.8 partprobe.8) - * bug fixes - -Ivo Timmermans - * Dutch translations - -Ryoji Kawagishi - * Japanese translation of doc/USER (user documentation) - (replaced by Okuji's version, now) - -Okuji Yoshinori - * doc/USER.jp - * contributions to Japanese translations - -Masahiro Sakai - * most of the PC98 support (disk_pc98.c), with Andrew Clausen - * lots of tedious work on parted/strlist.c - -Damien Genet - * parted.m4 - -Ben Collins - * Sun disk label support (libparted/disk_sun.c) - * stubs for UFS - -Vincent Stelhé - * move syntax patch (make END specification optional). Trivial - for copyright purposes (no disclaimer needed) - -Neal H Walfield - * GNU/Hurd port - libparted/gnu.c - -Thomas Roelz - * misc bug fixes - -Matt Domsch - * GUID Partition Table (GPT) support (disk_gpt.[ch], - crc32.[ch]) - * misc bug fixes, including end-of-device workaround - in libparted/linux.c - -Kjetil Torgrim Homme - * Norweigen translations - -Jörgen Tegnér - * Swedish translations - -Keld Simonsen - * Danish translations - -Richard M. Kreuter - * converted doc/USER to texinfo (doc/parted.texi) - -Miquel Matas - * Catalan translations - -Andreas Dilger - * lots of mix bug fixes/cleanups - -Vicente E. Llorens - * Spanish translations - -Yury Umanets - * basis of libparted/fs_reiserfs - -Bernardo João Torres da Silveira - - * pt_BR translation of FAQ and parted.texi - -Wojciech Polak - * Polish translations - -Miloslav Trmac - * Czech translations - -Maxim V. Dziumanenko - * Ukrainian translations - -Giuseppe Sacco - * Italian translations - -Guillaume Knispel - * nearly all hfs and hfs+ code (libparted/fs_hfs) - * hfs+ support for mac partitions (disk_mac.c) - * sync_fast code (linux.c gnu.c geom.[ch] device.[ch] ) - * various fixes (parted.c ui.c filesys.c disk_dos.c disk.c - doc/parted.texi doc/API disk_gpt.c disk_mac.c unit.c fs_fat/traverse.c) - -Chris Lumens - * interactive help fixes for filesystem types - * gcc-4 pedanticism cleanups - -Wei-Lun Chao - * Taiwanese dialect of Chinese (Cantonese?) translations. - -Tran Thi Hoang Quyen - * Vietnamese translations - -Eduardo Maestri Righes - * hidden partitions support - * setting MS Reserved partitions through "set" command. - -Arif E. Nugroho - * Indonesian translations - -Ithamar R. Adema - * BeOS support - -David Cantrell - * Added support for Promise SX8 devices (original patch from Jeremy - Katz ) - * Brought IBM/Red Hat DASD patches forward to parted-1.7.x - Original IBM authors: Volker Sameske - Horst Hummel - Original Red Hat authors: Phil Knirsch - Harald Hoyer - * Prevent SIGFPE when FAT sector size is 0 - * Add virtual DASD (VIODASD) on iSeries support - * Use O_DIRECT I/O to prevent first partition corruption on GPT disks - * Prevent sector reading exceptions from ped_geometry_check() on Mac - disklabels. - * Various bug fixes and other things. - -Peter Jones - * Add ped_exception_get_handler() - * /dev/mapper read/write support on Linux (via libdevmapper) - -Darren Lavender - * Fix SIGSEGV in parted 1.6.19 and assertion error in 1.7.0 - * Add support for LUN/device resize detection and option GPT - header corruption - * Fixed off-by-one error in GPT header that allowed for overlap - between LDAs of LastUsableLBA and PartitionEntryLBA in backup GPT - -Olaf Hering - * Fixes for Macintosh disk label code - -Debarshi Ray - * Display disk model and transport type in parted(8). - * '--list/-l' command line switch. - * Introduce 'print devices' and alias 'print list' to 'print all'. - * Alias 'mktable' to 'mklabel'. - * Code and API clean-up, bug fixes, and other miscellaneous stuff. -- cgit v1.2.3 From 0b4538017e5f84a04187012fe88bb3e46f1c5f51 Mon Sep 17 00:00:00 2001 From: Gordon Ross Date: Tue, 2 Sep 2014 15:23:36 -0400 Subject: 5132 mdb loops forever printing a stack backtrace Reviewed by: Richard Lowe Reviewed by: Adam Leventhal Approved by: Garrett D'Amore --- usr/src/cmd/mdb/common/mdb/mdb_err.c | 6 +++--- usr/src/cmd/mdb/common/mdb/mdb_errno.h | 5 ++--- usr/src/cmd/mdb/intel/mdb/mdb_amd64util.c | 30 +++++++++++++++++++++++------- usr/src/cmd/mdb/intel/mdb/mdb_ia32util.c | 27 +++++++++++++++++++++------ 4 files changed, 49 insertions(+), 19 deletions(-) (limited to 'usr/src') diff --git a/usr/src/cmd/mdb/common/mdb/mdb_err.c b/usr/src/cmd/mdb/common/mdb/mdb_err.c index 4c31551cde..beddad2aa2 100644 --- a/usr/src/cmd/mdb/common/mdb/mdb_err.c +++ b/usr/src/cmd/mdb/common/mdb/mdb_err.c @@ -24,8 +24,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include #include #include @@ -114,7 +112,9 @@ static const char *const _mdb_errlist[] = { "boot-loaded kmdb cannot be unloaded", /* EMDB_KNOUNLOAD */ "too many enabled watchpoints for this machine", /* EMDB_WPTOOMANY */ "DTrace is active", /* EMDB_DTACTIVE */ - "boot-loaded module cannot be unloaded" /* EMDB_KMODNOUNLOAD */ + "boot-loaded module cannot be unloaded", /* EMDB_KMODNOUNLOAD */ + "stack frame pointer is invalid" /* EMDB_STKFRAME */ + }; static const int _mdb_nerr = sizeof (_mdb_errlist) / sizeof (_mdb_errlist[0]); diff --git a/usr/src/cmd/mdb/common/mdb/mdb_errno.h b/usr/src/cmd/mdb/common/mdb/mdb_errno.h index 09dd877e82..7dfaff2896 100644 --- a/usr/src/cmd/mdb/common/mdb/mdb_errno.h +++ b/usr/src/cmd/mdb/common/mdb/mdb_errno.h @@ -27,8 +27,6 @@ #ifndef _MDB_ERRNO_H #define _MDB_ERRNO_H -#pragma ident "%Z%%M% %I% %E% SMI" - #ifdef __cplusplus extern "C" { #endif @@ -114,7 +112,8 @@ enum { EMDB_KNOUNLOAD, /* kmdb cannot be unloaded */ EMDB_WPTOOMANY, /* Too many watchpoints */ EMDB_DTACTIVE, /* DTrace is active */ - EMDB_KMODNOUNLOAD /* module can't be unloaded */ + EMDB_KMODNOUNLOAD, /* module can't be unloaded */ + EMDB_STKFRAME /* Bad stack frame pointer */ }; #endif /* _MDB */ diff --git a/usr/src/cmd/mdb/intel/mdb/mdb_amd64util.c b/usr/src/cmd/mdb/intel/mdb/mdb_amd64util.c index 432f22210c..b56a7388e3 100644 --- a/usr/src/cmd/mdb/intel/mdb/mdb_amd64util.c +++ b/usr/src/cmd/mdb/intel/mdb/mdb_amd64util.c @@ -24,8 +24,8 @@ * Use is subject to license terms. */ /* - * Copyright 2013 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2012, Joyent, Inc. All rights reserved. + * Copyright 2014 Nexenta Systems, Inc. All rights reserved. */ #include @@ -220,6 +220,7 @@ mdb_amd64_kvm_stack_iter(mdb_tgt_t *t, const mdb_tgt_gregset_t *gsp, uint_t argc, reg_argc; long fr_argv[32]; int start_index; /* index to save_instr where to start comparison */ + int err; int i; struct { @@ -229,7 +230,7 @@ mdb_amd64_kvm_stack_iter(mdb_tgt_t *t, const mdb_tgt_gregset_t *gsp, uintptr_t fp = gsp->kregs[KREG_RBP]; uintptr_t pc = gsp->kregs[KREG_RIP]; - uintptr_t lastfp; + uintptr_t lastfp = 0; ssize_t size; ssize_t insnsize; @@ -251,11 +252,22 @@ mdb_amd64_kvm_stack_iter(mdb_tgt_t *t, const mdb_tgt_gregset_t *gsp, while (fp != 0) { int args_style = 0; - if (!fp_is_aligned(fp, xpv_panic)) - return (set_errno(EMDB_STKALIGN)); - - if (mdb_tgt_vread(t, &fr, sizeof (fr), fp) != sizeof (fr)) - return (-1); /* errno has been set for us */ + /* + * Ensure progress (increasing fp), and prevent + * endless loop with the same FP. + */ + if (fp <= lastfp) { + err = EMDB_STKFRAME; + goto badfp; + } + if (!fp_is_aligned(fp, xpv_panic)) { + err = EMDB_STKALIGN; + goto badfp; + } + if (mdb_tgt_vread(t, &fr, sizeof (fr), fp) != sizeof (fr)) { + err = EMDB_NOMAP; + goto badfp; + } if ((mdb_tgt_lookup_by_addr(t, pc, MDB_TGT_SYM_FUZZY, NULL, 0, &s, &sip) == 0) && @@ -384,6 +396,10 @@ mdb_amd64_kvm_stack_iter(mdb_tgt_t *t, const mdb_tgt_gregset_t *gsp, } return (0); + +badfp: + mdb_printf("%p [%s]", fp, mdb_strerror(err)); + return (set_errno(err)); } /* diff --git a/usr/src/cmd/mdb/intel/mdb/mdb_ia32util.c b/usr/src/cmd/mdb/intel/mdb/mdb_ia32util.c index 43db94741b..80ce1c7ad2 100644 --- a/usr/src/cmd/mdb/intel/mdb/mdb_ia32util.c +++ b/usr/src/cmd/mdb/intel/mdb/mdb_ia32util.c @@ -24,6 +24,7 @@ */ /* * Copyright (c) 2012, Joyent, Inc. All rights reserved. + * Copyright 2014 Nexenta Systems, Inc. All rights reserved. */ #include @@ -194,6 +195,7 @@ mdb_ia32_kvm_stack_iter(mdb_tgt_t *t, const mdb_tgt_gregset_t *gsp, mdb_tgt_gregset_t gregs; kreg_t *kregs = &gregs.kregs[0]; int got_pc = (gsp->kregs[KREG_EIP] != 0); + int err; struct { uintptr_t fr_savfp; @@ -203,7 +205,7 @@ mdb_ia32_kvm_stack_iter(mdb_tgt_t *t, const mdb_tgt_gregset_t *gsp, uintptr_t fp = gsp->kregs[KREG_EBP]; uintptr_t pc = gsp->kregs[KREG_EIP]; - uintptr_t lastfp; + uintptr_t lastfp = 0; ssize_t size; uint_t argc; @@ -219,16 +221,25 @@ mdb_ia32_kvm_stack_iter(mdb_tgt_t *t, const mdb_tgt_gregset_t *gsp, while (fp != 0) { - if (fp & (STACK_ALIGN - 1)) - return (set_errno(EMDB_STKALIGN)); - + /* + * Ensure progress (increasing fp), and prevent + * endless loop with the same FP. + */ + if (fp <= lastfp) { + err = EMDB_STKFRAME; + goto badfp; + } + if (fp & (STACK_ALIGN - 1)) { + err = EMDB_STKALIGN; + goto badfp; + } if ((size = mdb_tgt_vread(t, &fr, sizeof (fr), fp)) >= (ssize_t)(2 * sizeof (uintptr_t))) { size -= (ssize_t)(2 * sizeof (uintptr_t)); argc = kvm_argcount(t, fr.fr_savpc, size); } else { - bzero(&fr, sizeof (fr)); - argc = 0; + err = EMDB_NOMAP; + goto badfp; } if (got_pc && func(arg, pc, argc, fr.fr_argv, &gregs) != 0) @@ -257,6 +268,10 @@ mdb_ia32_kvm_stack_iter(mdb_tgt_t *t, const mdb_tgt_gregset_t *gsp, } return (0); + +badfp: + mdb_printf("%p [%s]", fp, mdb_strerror(err)); + return (set_errno(err)); } /* -- cgit v1.2.3