OS-7694: ctfdump -c drops last type

Details

Issue Type:Bug
Priority:4 - Normal
Status:Resolved
Created at:2019-04-01T10:41:03.547Z
Updated at:2019-05-03T13:28:22.759Z

People

Created by:Former user
Reported by:Former user
Assigned to:Former user

Resolution

Fixed: A fix for this issue is checked into the tree and tested.
(Resolution Date: 2019-04-17T16:00:46.930Z)

Fix Versions

2019-04-25 Queen of Jordan (Release Date: 2019-04-25)

Description

diff --git a/usr/src/cmd/ctfdump/ctfdump.c b/usr/src/cmd/ctfdump/ctfdump.c
index ec879fcc06..06e94ffc52 100644
--- a/usr/src/cmd/ctfdump/ctfdump.c
+++ b/usr/src/cmd/ctfdump/ctfdump.c
@@ -991,7 +991,7 @@ ctfdump_source(void)
 
        qsort(idnames, max_id, sizeof (ctf_idname_t), idname_compare);
 
-       for (size_t i = 0; i < max_id; i++) {
+       for (size_t i = 0; i <= max_id; i++) {
                if (idnames[i].ci_id != 0)
                        ctfsrc_type(idnames[i].ci_id, idnames[i].ci_name);
        }

max_id in this case is a valid entry, not an array size.

Comments

Comment by Former user
Created at 2019-04-17T00:41:17.915Z

To test along with OS-7700 I checked a few times that the last type was included in the ctfdump -c output.


Comment by Jira Bot
Created at 2019-04-17T15:55:43.308Z

illumos-joyent commit adeaa2b6918d69fe48c140f0ca1779a3275f195f (branch master, by John Levon)

OS-7689 ctfdump -c goes off the rails with a missing parent
OS-7694 ctfdump -c drops last type
OS-7700 GCC7-derived CTF can double qualifiers on arrays
OS-7733 should ignore DW_TAG_subprogram with DW_AT_declaration tags
Reviewed by: Robert Mustacchi <rm@joyent.com>
Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>
Reviewed by: Jason King <jason.king@joyent.com>
Approved by: Jerry Jelinek <jerry.jelinek@joyent.com>