Project

General

Profile

Feature #7060

mdb -e doesn't properly report exit status for failed writes

Added by Robert Mustacchi almost 4 years ago. Updated almost 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
mdb - modular debugger
Start date:
2016-06-06
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:

Description

When using mdb -ke and using a format character to write to memory, but write permission is lacking, the system happily exits 1. For example:

[root@00-0c-29-ca-c7-23 /var/tmp/rm]# mdb -ke '0xfffffffff78272d5/v 0x02'
mdb: failed to write 2 at address 0xfffffffff78272d5: target is not open for writing
[root@00-0c-29-ca-c7-23 /var/tmp/rm]# echo $?
0

The issue here was that when

write_arglist
ran into an error writing a value, it would print out a message, and then break out of the loop and return an OK status. It should have instead returned an error status to indicate that the write had failed, and which could then get propagated back to the shell when it exited.

History

#1

Updated by Electric Monk almost 4 years ago

  • Status changed from New to Closed

git commit bc07d1fd58f705e3a6d5b418433e42cd8e42b7f1

commit  bc07d1fd58f705e3a6d5b418433e42cd8e42b7f1
Author: Cody Peter Mello <cody.mello@joyent.com>
Date:   2016-06-09T23:46:18.000Z

    7060 mdb -e doesn't properly report exit status for failed writes
    Reviewed by: Joshua M. Clulow <jmc@joyent.com>
    Reviewed by: Patrick Mooney <patrick.mooney@joyent.com>
    Reviewed by: Garrett D'Amore <garrett@damore.org>
    Approved by: Dan McDonald <danmcd@omniti.com>

Also available in: Atom PDF