flâneur

Nikhil Raghav

0 followers · 602 views

on the atlas — 3

highlights — 17

  • The push model is efficient when there are only a few update messages due to the traffic overhead. The node with the latest message sends the message to a random subset of other nodes in the push model [8].
    Gossip Protocol Explained - High Scalability -
  • address the above problem, we offer a lightweight version in Option 2, in which we only report NilAway errors for changed code in the service. These errors are directly reported in a non-blocking way on every differential code revision (i.e., a pull request) of the onboarded service
    NilAway: Practical Nil Panic Detection for Go | Uber Blog
  • two options of error reporting: (1) comprehensive and blocking, and (2) stop-the-bleed and non-blocking.
    NilAway: Practical Nil Panic Detection for Go | Uber Blog
  • error reporting is, however, in the testing phase, where nil panic errors are only reported for services in the Go monorepo that are onboarded onto NilAway.
    NilAway: Practical Nil Panic Detection for Go | Uber Blog
  • a small overhead (less than 5%) to the normal build process.
    NilAway: Practical Nil Panic Detection for Go | Uber Blog
  • designed NilAway to construct the global implication graph incrementally by leveraging build cache, avoiding expensive re-building of the dependencies
    NilAway: Practical Nil Panic Detection for Go | Uber Blog
  • Error Engine accumulates the information from both the Analyzer Engine and the Inference Engine, and marks each potential nil flow (intra- and inter-procedural) as safe or unsaf
    NilAway: Practical Nil Panic Detection for Go | Uber Blog
  • Inference Engine is responsible for collecting witnessed nilability values for different program sites and propagating this information through inter-procedural flows by building the implication grap
    NilAway: Practical Nil Panic Detection for Go | Uber Blog
  • Analyzer Engine is responsible for identifying all potential nil flows within a function independently (
    NilAway: Practical Nil Panic Detection for Go | Uber Blog
  • Analyzer Engine, the Inference Engine, and the Error Engine
    NilAway: Practical Nil Panic Detection for Go | Uber Blog
  • NilAway is implemented as an analyzer that can be used as an independent tool or, optionally, can also be easily integrated into a build system, such as Bazel, with existing analyzer drivers, such as nogo
    NilAway: Practical Nil Panic Detection for Go | Uber Blog
  • uses the go/analysis
    NilAway: Practical Nil Panic Detection for Go | Uber Blog
  • in Java, Uber has developed NullAway. NullAway requires the code to be annotated with @Nullable annotations to guarantee NPE freedom during compile time. This limits the feasibility of directly adapting a NullAway-like technique for our purpose, since, unlike Java, Go does not have language support for annotations.
    NilAway: Practical Nil Panic Detection for Go | Uber Blog
  • in general, for practical static type systems, with or without global inference of types, there will always exist error-free programs that do not satisfy a valid static typing. In the case of NilAway, note that the above algorithm doesn’t capture cases where subtle inter-procedural invariants in the execution of the program would prevent the nil to nonnil flow from happening at runtime. For example, in Figure 3, it is possible that some shared program state is set up such that whenever c.ok() is called from conn.RemoteAddr(), it always returns true, in which case no nil panic exists in that co…
    NilAway: Practical Nil Panic Detection for Go | Uber Blog
  • main idea is that nilability flows in code can be modeled as a system of global typing constraints, which can then be solved using a 2-SAT algorithm to determine potential contradictions. At a high level, we capture both nilable and nonnil constraints at various program sites for struct fields, function parameters, and return values. An example of a nilable constraint is return x, where x is an uninitialized pointer, while the dereference, *x, is an example of a nonnil constraint. We then build a global implication graph modeling these program site-specific constraints. Finally, we traverse th…
    NilAway: Practical Nil Panic Detection for Go | Uber Blog
  • There exists an automated tool, nilness, offered by the Go distribution for detecting nil panics. This nilness checker is a lightweight static analysis technique that reports only simple errors, such as obvious sites of nil dereferences (e.g., if x == nil { print(*x) }). However, such simple checks fail to capture the complex nil flows in real programs
    NilAway: Practical Nil Panic Detection for Go | Uber Blog
  • problematic when the field c.rwc of interface type net.Conn is assigned with the struct net.conn, since its concrete implementation of RemoteAddr() can return a nil value if the connection c is found to be not OK (shown in Figure 3). Specifically, RemoteAddr() can return a nil interface value on L225, leading to a nil panic when a method is called (.String() here) on it, since the nil value contains no pointer to any concrete method that can be invoked.
    NilAway: Practical Nil Panic Detection for Go | Uber Blog