Project

General

Profile

Bug #10854

empty struct array confuses CTF

Added by John Levon 7 months ago. Updated 6 months ago.

Status:
New
Priority:
Low
Assignee:
-
Category:
-
Start date:
2019-04-25
Due date:
% Done:

0%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage

Description

As reported by Serapheim. Using GCC7:

$ cat a.c
int q[] = {};
$ /home/gk/src/gcc/proto.strap/usr/gcc/7/bin/gcc -gdwarf-2 -c -o a.o a.c
$ ctfconvert a.o
ctfconvert: failed to get unsigned attribute for type: DW_DLE_ATTR_FORM_BAD

At a guess, it's because of this:

 <2><26>: Abbrev Number: 3 (DW_TAG_subrange_type)
    <27>   DW_AT_type        : <0x2d>
    <2b>   DW_AT_upper_bound : -1

Related issues

Has duplicate illumos gate - Bug #10922: libctf apparently erroneously assumes upper-bound of array size is non-negativeClosed2019-05-06

Actions

History

#1

Updated by John Levon 6 months ago

To answer richlowe's question in #10922 - we probably want to explicitly special case -1 here...

#2

Updated by Gergő Mihály Doma 6 months ago

  • Has duplicate Bug #10922: libctf apparently erroneously assumes upper-bound of array size is non-negative added

Also available in: Atom PDF