[Lldb-commits] [PATCH] D37651: Fix for bug 34532 - A few rough corners related to post-mortem debugging (core/minidump)

Zachary Turner via lldb-commits lldb-commits at lists.llvm.org
Tue Sep 12 13:35:09 PDT 2017


4ad5334bfcff803f3765e444785b8f9d3a73c683: Don't pass a null StringRef.
 simple.
f7b079263a751fdf3adea8e549803aaf92d465f8: Maybe fix it instead, as the
comment suggests?
f3647763b02ddef65c6244f91939d997f7733ecd: Probably fine since you don't
have control over the code of the plugin.
f67e0b92fbd9e0bc0267ae5210478c85a44b8afc: Probably fine since you're at the
mercy of the system
0ac65423e2ba99a42b246d191520ff13bdca5cb0: There's no indication here why
the TypeSP might be empty.  Is it bad debug info?  If so it should be easy
to construct a test.  If the answer is "I don't know", then this doesn't
really fix anything.
7043340bc58b0d751fcf66001f62cbf0d9527623: Probably fine, debug info is bad.
d7019a8d5ccd5dfdb79d74312ef449b734627ec3: Seems easy to write a test for.
That said, I would argue that the function should return a reference and
the person calling the function ensure that we *do* have a TypeSystem for
the specified language.  There are plenty of places where the function is
already called with the knowledge that a TypeSystem exists.  In those
cases, the function absolutely should assert.  By moving the responsibility
up and clearly documenting it, you allow

On Tue, Sep 12, 2017 at 1:23 PM Jim Ingham <jingham at apple.com> wrote:

> Huh, yeah I don't see any of these bugs as making your point.  These are
> all fixes so I don't see how they argue that we're willfully ignoring
> anything.  To the extent that they deal with asserts they fixes for lldb
> not remembering that it has to tread carefully to avoid triggering other
> asserts elsewhere.
>
> Jim
>
> > On Sep 12, 2017, at 1:17 PM, Zachary Turner <zturner at google.com> wrote:
> >
> > (Some of those look like correct fixes btw, since they deal with user
> input)
> >
> > On Tue, Sep 12, 2017 at 1:16 PM Zachary Turner <zturner at google.com>
> wrote:
> > On Tue, Sep 12, 2017 at 1:04 PM Jim Ingham <jingham at apple.com> wrote:
> >
> > I don't see any evidence for lldb suffering from "a huge class of bugs
> that we are willfully ignoring..." particularly ones that would be easily
> caught if we just had more asserts.  Can you give some examples?
> >
> > Probably all of these, for starters:
> >
> > D:\src\llvm-mono>git log --grep "Don't crash" lldb
> > commit 4ad5334bfcff803f3765e444785b8f9d3a73c683
> > Author: Greg Clayton <gclayton at apple.com>
> > Date:   Mon Jul 24 16:47:04 2017 +0000
> >
> >     Don't crash when hostname is empty. StringRef will assert and kill
> your program.
> >
> > commit f7b079263a751fdf3adea8e549803aaf92d465f8
> > Author: Sean Callanan <scallanan at apple.com>
> > Date:   Fri Aug 26 18:12:39 2016 +0000
> >
> >     Don't crash when trying to capture persistent variables in a block.
> >
> >     Reports an error instead.  We can fix this later to make persistent
> variables
> >     work, but right now we hit an LLVM assertion if we get this wrong.
> >
> >     <rdar://problem/27770298>
> >
> > commit f3647763b02ddef65c6244f91939d997f7733ecd
> > Author: Greg Clayton <gclayton at apple.com>
> > Date:   Mon May 16 20:07:38 2016 +0000
> >
> >     Don't crash when OS plug-in returns None from any of the functions
> we might call.
> >
> >     <rdar://problem/24489419>
> >
> > commit f67e0b92fbd9e0bc0267ae5210478c85a44b8afc
> > Author: Greg Clayton <gclayton at apple.com>
> > Date:   Thu May 12 22:36:47 2016 +0000
> >
> >     Don't crash when a process' task port goes bad.
> >
> >     <rdar://problem/26256049>
> >
> > commit 0ac65423e2ba99a42b246d191520ff13bdca5cb0
> > Author: Greg Clayton <gclayton at apple.com>
> > Date:   Tue Mar 15 21:58:28 2016 +0000
> >
> >     Don't crash if the TypeSP is empty.
> >
> > commit 7043340bc58b0d751fcf66001f62cbf0d9527623
> > Author: Greg Clayton <gclayton at apple.com>
> > Date:   Fri Feb 12 00:07:16 2016 +0000
> >
> >     Don't crash if we have a DIE that has a DW_AT_ranges attribute and
> yet the SymbolFileDWARF doesn't have a DebugRanges. If this happens print a
> nice error message to prompt the user to file a bug and attach the
> offending DWARF file so we can get the correct compiler fixed.
> >
> >     <rdar://problem/24458016>
> >
> > commit 0d1591d3b74d518b9edd7482f65976092c14e951
> > Author: Greg Clayton <gclayton at apple.com>
> > Date:   Wed Oct 28 20:49:34 2015 +0000
> >
> >     Don't crash when opening a fuzzed mach-o file that has bad dyld trie
> data.
> >
> >     <rdar://problem/21991784>
> >
> > commit d7019a8d5ccd5dfdb79d74312ef449b734627ec3
> > Author: Greg Clayton <gclayton at apple.com>
> > Date:   Fri Aug 14 23:15:48 2015 +0000
> >
> >     Don't crash if we don't have a type system for a language.
> >
> > commit b5838b5a4870ba8f620e7a5733038f02f45b1a78
> > Author: Greg Clayton <gclayton at apple.com>
> > Date:   Thu Aug 13 23:16:15 2015 +0000
> >
> >     Don't crash when we have a .a file that contains an object with a 16
> character name. Any calls to std::string::erase must be bounds checked.
> >
> >     <rdar://problem/22260988>
> >
> > commit 4234fd5de6adb471728df83670ebbe0ae3c7ee68
> > Author: Greg Clayton <gclayton at apple.com>
> > Date:   Tue Aug 11 21:01:32 2015 +0000
> >
> >     Don't crash if the file we want to touch doesn't exist.
> >
> > commit b385164c734997af6367271d33dc1c4618bfb754
> > Author: Greg Clayton <gclayton at apple.com>
> > Date:   Mon Jul 13 22:08:16 2015 +0000
> >
> >     Don't crash if we are unable to get the member type.
> >
> >     <rdar://problem/21624447>
> >
> > commit a5deec8dc9a9e7fd977049f6fb5977796906e8ca
> > Author: Sean Callanan <scallanan at apple.com>
> > Date:   Thu May 28 20:06:40 2015 +0000
> >
> >     Don't crash if we don't have a process and need
> >     to check for alternate manglings.
> >
> > commit 4427526ffa55675b623702452ff6e13c33c79763
> > Author: Greg Clayton <gclayton at apple.com>
> > Date:   Fri May 15 22:31:18 2015 +0000
> >
> >     Don't crash if we have bad debug info that has a DW_TAG_inheritance
> with a bad DW_AT_type reference. Emit an error with instructions to file a
> bug.
> >
> >     <rdar://problem/20944860>
> >
> > commit 4506ae8792a5b726133a58d1bc887313bceccd93
> > Author: Greg Clayton <gclayton at apple.com>
> > Date:   Fri May 15 22:20:29 2015 +0000
> >
> >     Don't crash if a function has no name by calling 'strcmp(name,
> "main")'.
> >
> >     <rdar://problem/20925061>
> >
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20170912/5e4fbbbe/attachment-0001.html>


More information about the lldb-commits mailing list