Skip to content
Snippets Groups Projects
  1. Jul 28, 2020
  2. Jul 21, 2020
  3. Jul 14, 2020
  4. Jul 07, 2020
    • Nat Goodspeed's avatar
      DRTVWR-476, SL-13555: Don't crash if user closes viewer during login. · 87da08b1
      Nat Goodspeed authored
      Ever since February 2010, the body of the login coroutine function has been
      enclosed in try/catch (...), with an llerrs message to try to crash more
      informatively than the runtime's unhandled-exception termination. Over the
      years this evolved to LL_ERRS and then to CRASH_ON_UNHANDLED_EXCEPTION.
      
      This persisted despite the August 2016 addition of generic catch clauses in
      the LLCoros::toplevel() function to serve the same purpose, and despite the
      subsequent introduction of the LLCoros::Stop family of exceptions to
      deliberately throw into waiting coroutines on viewer shutdown.
      
      That's exactly what was happening. When the user closed the viewer while
      waiting for the response from login.cgi, the waiting operation threw
      LLCoros::Stopping, which was caught by that CRASH_ON_UNHANDLED_EXCEPTION,
      which crashed the viewer with LL_ERRS rather than propagating up to the
      toplevel() and cleanly terminating the coroutine.
      
      Change CRASH_ON_UNHANDLED_EXCEPTION() to LOG_UNHANDLED_EXCEPTION() and
      re-throw so toplevel() can handle.
      87da08b1
  5. Jul 01, 2020
  6. Jun 26, 2020
  7. Jun 25, 2020
    • Nat Goodspeed's avatar
      DRTVWR-476, SL-13512: Make suspendUntilTimeout() notice shutdown. · 1231cb45
      Nat Goodspeed authored
      Specifically, the shutdown crash reported in SL-13512 was due to
      LLExperienceCache::idleCoro() looping on suspendUntilTimeout(), failing to
      notice in its slumbers that the viewer was shutting down around it.
      
      Make suspendUntilTimeout() internally call suspendUntilEventOnWithTimeout(),
      which already listens for "LLApp" state-change events and throws Stopping when
      LLApp enters its shutdown sequence.
      1231cb45
  8. Jun 23, 2020
  9. Jun 15, 2020
  10. May 27, 2020
  11. May 20, 2020
  12. May 14, 2020
    • Nat Goodspeed's avatar
      DRTVWR-476: Wrap boost::fibers::mutex et al. with LLCoros aliases. · 98dfba0d
      Nat Goodspeed authored
      Specifically:
      
      LLCoros::Mutex means boost::fibers::mutex
      LLCoros::LockType means std::unique_lock<boost::fibers::mutex>
      LLCoros::ConditionVariable means boost::fibers::condition_variable
      LLCoros::cv_status means boost::fibers::cv_status
      
      So as not to drag in all of boost::fibers::mutex.hpp or condition_variable.hpp
      for each consumer of llcoros.h, instead #define LLCOROS_MUTEX_HEADER and
      LLCOROS_CONDVAR_HEADER. Those who need them can #include the relevant macro.
      
      Update llcond.h and llthreadsafequeue.h accordingly.
      98dfba0d
    • Nat Goodspeed's avatar
      DRTVWR-476: Make LLSDFormatter::OPTIONS_PRETTY_BINARY uppercase · a83da3a4
      Nat Goodspeed authored
      for compatibility with Python llbase.llsd.parse().
      
      The Python parse() currently requires uppercase hex digits for b16"hex"
      coding; lowercase hex digits cause it to raise LLSDParseError.
      a83da3a4
    • Nat Goodspeed's avatar
      DRTVWR-476: Fix LLError::Log::classname(T*) template function. · 6e5242f0
      Nat Goodspeed authored
      First, the signature classname(const T*) was wrong: that function could only
      accept a pointer to const T. The expression classname(someptr) where someptr
      was a pointer to non-const SomeType displayed "SomeType*" because it could
      only match classname(const T&), where T was SomeType*.
      
      classname(T* const) is what we should have written, meaning "const pointer to
      T" rather than "pointer to const T."
      
      Second, the previous implementation failed to handle the case in which the
      pointer was nullptr.
      6e5242f0
  13. May 13, 2020
    • Nat Goodspeed's avatar
      DRTVWR-476: Default LLSDNotationFormatter now OPTIONS_PRETTY_BINARY. · 066fb5da
      Nat Goodspeed authored
      LLSDNotationFormatter (also LLSDNotationStreamer that uses it, plus
      operator<<(std::ostream&, const LLSD&) that uses LLSDNotationStreamer) is most
      useful for displaying LLSD to a human, e.g. for logging. Having the default
      dump raw binary bytes into the log file is not only suboptimal, it can
      truncate the output if one of those bytes is '\0'. (This is a problem with the
      logging subsystem, but that's a story for another day.)
      
      Use OPTIONS_PRETTY_BINARY wherever there is a default LLSDFormatter
      ::EFormatterOptions argument.
      
      Also, allow setting LLSDFormatter subclass boolalpha(), realFormat() and
      format(options) using optional constructor arguments. Naturally, each subclass
      that supports this must accept and forward these constructor arguments to its
      LLSDFormatter base class constructor.
      
      Fix a couple bugs in LLSDNotationFormatter::format_impl() for an LLSD::Binary
      value with OPTIONS_PRETTY_BINARY:
      - The code unconditionally emitted a b(len) type prefix followed by either raw
        binary or hex, depending on the option flag. OPTIONS_PRETTY_BINARY caused it
        to emit "0x" before the hex representation of the data. This is wrong in
        that it can't be read back by either the C++ or the Python LLSD parser.
        Correct OPTIONS_PRETTY_BINARY formatting consists of b16"hex digits" rather
        than b(len)"raw bytes".
      - Although the code did set hex mode, it didn't set either the field width or
        the fill character, so that a byte value less than 16 would emit a single
        digit rather than two.
      
      Instead of having one LLSDFormatter::format() method with an optional options
      argument, declare two overloads. The format() overload without options passes
      the mOptions data member to the overload accepting options.
      
      Refactor the LLSDFormatter family, hoisting the recursive format_impl() method
      (accepting level) to a pure virtual method at LLSDFormatter base-class level.
      Most subclasses therefore need not override either base-class format() method,
      only format_impl(). In fact the short format() overload isn't even virtual.
      
      Consistently use LLSDFormatter::EFormatterOptions enum as the options
      parameter wherever such options are accepted.
      066fb5da
  14. May 06, 2020
  15. Apr 20, 2020
  16. Apr 13, 2020
  17. Apr 03, 2020
    • Nat Goodspeed's avatar
      DRTVWR-476: Facilitate debugging test programs with logging. · 962ccb4f
      Nat Goodspeed authored
      On Mac, even if you run a test program with --debug or set LOGTEST=DEBUG, it
      won't log to stderr if you're filtering build output or running the build in
      an emacs compile buffer. This is because, on Mac, a viewer launched by mouse
      rather than from the command line is passed a stderr stream that ultimately
      gets logged to the system Console. The shouldLogToStderr() function is
      intended to avoid spamming the Console with the (voluminous) viewer log
      output. It tests whether stderr isatty() and, if not, suppresses calling
      LLError::logToStderr().
      
      This makes debugging test programs using log output trickier than necessary.
      Change shouldLogToStderr() to permit logging when either stderr isatty() or is
      a pipe. The original intention is preserved in that empirically, a viewer
      launched by mouse is passed a stderr stream identified as a character device
      rather than as a pipe.
      
      Also introduce SetEnv, a class that facilitates setting (e.g.) LOGTEST=DEBUG
      for specific test programs without setting it for all test programs in the
      build. Using the constructor for a static object means you can set environment
      variables before main() is entered, which is important because it's the main()
      function in test.cpp that acts on the LOGTEST and LOGFAIL environment
      variables.
      
      These changes make it unnecessary to retain the temporary change in test.cpp
      to force LOGTEST to DEBUG.
      962ccb4f
    • Nat Goodspeed's avatar
  18. Mar 26, 2020
    • Nat Goodspeed's avatar
      DRTVWR-476: Apparently it can take more than 2s for threads to chat. · b793ab86
      Nat Goodspeed authored
      llmainthreadtask_test builds in a Sync timeout to keep build-time tests from
      hanging. That timeout was set to 2000ms, which seems as though it ought to be
      plenty enough time for a process with only 2 threads to exchange data between
      them. But on TeamCity EC2 Windows build hosts, sometimes we hit that timeout
      and fail. Extend it to try to improve the robustness of builds, even though
      the possibility of a production viewer blocking for that long for anything
      seems worrisome. (Fortunately the production viewer does not use Sync.)
      b793ab86
  19. Mar 25, 2020
Loading