This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Avoid segfault on invalid directory table
- From: Padraig Brady <pbrady at fb dot com>
- To: Pedro Alves <palves at redhat dot com>, <gdb-patches at sourceware dot org>
- Date: Fri, 24 Mar 2017 10:38:05 -0700
- Subject: Re: [PATCH] Avoid segfault on invalid directory table
- Authentication-results: sourceware.org; auth=none
- Authentication-results: sourceware.org; dkim=none (message not signed) header.d=none;sourceware.org; dmarc=none action=none header.from=fb.com;
- References: <6c10a81a-b9fe-cd6b-0adc-85fc7b596c1d@fb.com> <649c643d-59b8-d727-569c-cf7fe8a0fbdd@redhat.com>
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:99
On 03/24/2017 08:26 AM, Pedro Alves wrote:
> Hi Pádraig,
>
> On 03/24/2017 04:09 AM, Padraig Brady wrote:
>> gdb was segfaulting during backtrace on a binary here,
>> where fe->dir_index parsed from the dwarf info was seen to
>> access beyond the provided include_dirs array.
>> The attached bounds the access to entries actually written to the array,
>> and was verified to output the backtrace correctly.
>>
> Thanks, I pushed it.
>
> Note that AFAICS, Facebook has as couple copyright assignments in place,
> but none covers you for GDB. The patch was sufficiently small that it
> shouldn't be a problem this time. But it'd be appreciated if that
> was sorted out if you plan on contributing more.
>
> And also, could you give this patch a try? :
>
> https://urldefense.proofpoint.com/v2/url?u=https-3A__sourceware.org_ml_gdb-2Dpatches_2017-2D03_msg00444.html&d=DwIDaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=IRyzGZVy_JZ1hqY1erVdUg&m=vs5e-LmOdHODMsuSCzBW-ZmATTGCvlUF_g5zTPBZOrg&s=xgu4H5IZ76MWdl6vuMFxqYhOV_jshZnaDrB6bw6Gd94&e=
>
> (I see now that I mistakenly named you as author of that commit.
> Sorry about that. I've fixed it locally. :-) )
That patch produces a good backtrace against the problematic binary.
cheers,
Pádraig