<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">The first one is a nice example of what we don't want to crash on. Before the switch to StringRef, hostname could be NULL. After it, StringRef handily crashed for us instead of dutifully just setting itself to the empty string. I say this is exactly the kind of crash we don't want. But thanks to StringRefs assertive behavior, this became a crash when it never should have. <div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Sep 12, 2017, at 1:16 PM, Zachary Turner <<a href="mailto:zturner@google.com" class="">zturner@google.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><br class=""><br class=""><div class="gmail_quote"><div dir="ltr" class="">On Tue, Sep 12, 2017 at 1:04 PM Jim Ingham <<a href="mailto:jingham@apple.com" class="">jingham@apple.com</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br class="">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?<br class=""></blockquote><div class=""><br class=""></div><div class="">Probably all of these, for starters:</div><div class=""><br class=""></div><div class=""><div class="">D:\src\llvm-mono>git log --grep "Don't crash" lldb</div><div class="">commit 4ad5334bfcff803f3765e444785b8f9d3a73c683</div><div class="">Author: Greg Clayton <<a href="mailto:gclayton@apple.com" class="">gclayton@apple.com</a>></div><div class="">Date:   Mon Jul 24 16:47:04 2017 +0000</div><div class=""><br class=""></div><div class="">    Don't crash when hostname is empty. StringRef will assert and kill your program.</div><div class=""><br class=""></div><div class="">commit f7b079263a751fdf3adea8e549803aaf92d465f8</div><div class="">Author: Sean Callanan <<a href="mailto:scallanan@apple.com" class="">scallanan@apple.com</a>></div><div class="">Date:   Fri Aug 26 18:12:39 2016 +0000</div><div class=""><br class=""></div><div class="">    Don't crash when trying to capture persistent variables in a block.</div><div class=""><br class=""></div><div class="">    Reports an error instead.  We can fix this later to make persistent variables</div><div class="">    work, but right now we hit an LLVM assertion if we get this wrong.</div><div class=""><br class=""></div><div class="">    <<a href="rdar://problem/27770298" class="">rdar://problem/27770298</a>></div><div class=""><br class=""></div><div class="">commit f3647763b02ddef65c6244f91939d997f7733ecd</div><div class="">Author: Greg Clayton <<a href="mailto:gclayton@apple.com" class="">gclayton@apple.com</a>></div><div class="">Date:   Mon May 16 20:07:38 2016 +0000</div><div class=""><br class=""></div><div class="">    Don't crash when OS plug-in returns None from any of the functions we might call.</div><div class=""><br class=""></div><div class="">    <<a href="rdar://problem/24489419" class="">rdar://problem/24489419</a>></div><div class=""><br class=""></div><div class="">commit f67e0b92fbd9e0bc0267ae5210478c85a44b8afc</div><div class="">Author: Greg Clayton <<a href="mailto:gclayton@apple.com" class="">gclayton@apple.com</a>></div><div class="">Date:   Thu May 12 22:36:47 2016 +0000</div><div class=""><br class=""></div><div class="">    Don't crash when a process' task port goes bad.</div><div class=""><br class=""></div><div class="">    <<a href="rdar://problem/26256049" class="">rdar://problem/26256049</a>></div><div class=""><br class=""></div><div class="">commit 0ac65423e2ba99a42b246d191520ff13bdca5cb0</div><div class="">Author: Greg Clayton <<a href="mailto:gclayton@apple.com" class="">gclayton@apple.com</a>></div><div class="">Date:   Tue Mar 15 21:58:28 2016 +0000</div><div class=""><br class=""></div><div class="">    Don't crash if the TypeSP is empty.</div><div class=""><br class=""></div><div class="">commit 7043340bc58b0d751fcf66001f62cbf0d9527623</div><div class="">Author: Greg Clayton <<a href="mailto:gclayton@apple.com" class="">gclayton@apple.com</a>></div><div class="">Date:   Fri Feb 12 00:07:16 2016 +0000</div><div class=""><br class=""></div><div class="">    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.</div><div class=""><br class=""></div><div class="">    <<a href="rdar://problem/24458016" class="">rdar://problem/24458016</a>></div><div class=""><br class=""></div><div class="">commit 0d1591d3b74d518b9edd7482f65976092c14e951</div><div class="">Author: Greg Clayton <<a href="mailto:gclayton@apple.com" class="">gclayton@apple.com</a>></div><div class="">Date:   Wed Oct 28 20:49:34 2015 +0000</div><div class=""><br class=""></div><div class="">    Don't crash when opening a fuzzed mach-o file that has bad dyld trie data.</div><div class=""><br class=""></div><div class="">    <<a href="rdar://problem/21991784" class="">rdar://problem/21991784</a>></div><div class=""><br class=""></div><div class="">commit d7019a8d5ccd5dfdb79d74312ef449b734627ec3</div><div class="">Author: Greg Clayton <<a href="mailto:gclayton@apple.com" class="">gclayton@apple.com</a>></div><div class="">Date:   Fri Aug 14 23:15:48 2015 +0000</div><div class=""><br class=""></div><div class="">    Don't crash if we don't have a type system for a language.</div><div class=""><br class=""></div><div class="">commit b5838b5a4870ba8f620e7a5733038f02f45b1a78</div><div class="">Author: Greg Clayton <<a href="mailto:gclayton@apple.com" class="">gclayton@apple.com</a>></div><div class="">Date:   Thu Aug 13 23:16:15 2015 +0000</div><div class=""><br class=""></div><div class="">    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.</div><div class=""><br class=""></div><div class="">    <<a href="rdar://problem/22260988" class="">rdar://problem/22260988</a>></div><div class=""><br class=""></div><div class="">commit 4234fd5de6adb471728df83670ebbe0ae3c7ee68</div><div class="">Author: Greg Clayton <<a href="mailto:gclayton@apple.com" class="">gclayton@apple.com</a>></div><div class="">Date:   Tue Aug 11 21:01:32 2015 +0000</div><div class=""><br class=""></div><div class="">    Don't crash if the file we want to touch doesn't exist.</div><div class=""><br class=""></div><div class="">commit b385164c734997af6367271d33dc1c4618bfb754</div><div class="">Author: Greg Clayton <<a href="mailto:gclayton@apple.com" class="">gclayton@apple.com</a>></div><div class="">Date:   Mon Jul 13 22:08:16 2015 +0000</div><div class=""><br class=""></div><div class="">    Don't crash if we are unable to get the member type.</div><div class=""><br class=""></div><div class="">    <<a href="rdar://problem/21624447" class="">rdar://problem/21624447</a>></div><div class=""><br class=""></div><div class="">commit a5deec8dc9a9e7fd977049f6fb5977796906e8ca</div><div class="">Author: Sean Callanan <<a href="mailto:scallanan@apple.com" class="">scallanan@apple.com</a>></div><div class="">Date:   Thu May 28 20:06:40 2015 +0000</div><div class=""><br class=""></div><div class="">    Don't crash if we don't have a process and need</div><div class="">    to check for alternate manglings.</div><div class=""><br class=""></div><div class="">commit 4427526ffa55675b623702452ff6e13c33c79763</div><div class="">Author: Greg Clayton <<a href="mailto:gclayton@apple.com" class="">gclayton@apple.com</a>></div><div class="">Date:   Fri May 15 22:31:18 2015 +0000</div><div class=""><br class=""></div><div class="">    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.</div><div class=""><br class=""></div><div class="">    <<a href="rdar://problem/20944860" class="">rdar://problem/20944860</a>></div><div class=""><br class=""></div><div class="">commit 4506ae8792a5b726133a58d1bc887313bceccd93</div><div class="">Author: Greg Clayton <<a href="mailto:gclayton@apple.com" class="">gclayton@apple.com</a>></div><div class="">Date:   Fri May 15 22:20:29 2015 +0000</div><div class=""><br class=""></div><div class="">    Don't crash if a function has no name by calling 'strcmp(name, "main")'.</div><div class=""><br class=""></div><div class="">    <<a href="rdar://problem/20925061" class="">rdar://problem/20925061</a>></div></div><div class=""><br class=""></div></div></div>
</div></blockquote></div><br class=""></div></body></html>