Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump json5 from 2.2.0 to 2.2.3 in /website #8

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dependabot[bot]
Copy link

@dependabot dependabot bot commented on behalf of github Jan 8, 2023

Bumps json5 from 2.2.0 to 2.2.3.

Release notes

Sourced from json5's releases.

v2.2.3

v2.2.2

  • Fix: Properties with the name __proto__ are added to objects and arrays. (#199) This also fixes a prototype pollution vulnerability reported by Jonathan Gregson! (#295).

v2.2.1

Changelog

Sourced from json5's changelog.

v2.2.3 [code, diff]

v2.2.2 [code, diff]

  • Fix: Properties with the name __proto__ are added to objects and arrays. (#199) This also fixes a prototype pollution vulnerability reported by Jonathan Gregson! (#295).

v2.2.1 [code, diff]

Commits
  • c3a7524 2.2.3
  • 94fd06d docs: update CHANGELOG for v2.2.3
  • 3b8cebf docs(security): use GitHub security advisories
  • f0fd9e1 docs: publish a security policy
  • 6a91a05 docs(template): bug -> bug report
  • 14f8cb1 2.2.2
  • 10cc7ca docs: update CHANGELOG for v2.2.2
  • 7774c10 fix: add proto to objects and arrays
  • edde30a Readme: slight tweak to intro
  • 97286f8 Improve example in readme
  • Additional commits viewable in compare view

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
  • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
  • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
  • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
  • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

You can disable automated security fix PRs for this repo from the Security Alerts page.

Bumps [json5](https://github.com/json5/json5) from 2.2.0 to 2.2.3.
- [Release notes](https://github.com/json5/json5/releases)
- [Changelog](https://github.com/json5/json5/blob/main/CHANGELOG.md)
- [Commits](json5/json5@v2.2.0...v2.2.3)

---
updated-dependencies:
- dependency-name: json5
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
@dependabot dependabot bot added the dependencies Pull requests that update a dependency file label Jan 8, 2023
korbin pushed a commit that referenced this pull request Aug 27, 2024
* Fix crash on mixes_in_class_methods for undeclared

The crash looked like this:

    Exception::raise(): Should never happen

    Backtrace:
      #3 0xccda75 sorbet::core::ClassOrModule::isClass()
      #4 0x13de160 sorbet::resolver::(anonymous namespace)::ResolveConstantsWalk::resolveClassMethodsJob<>()
      #5 0x13d2407 sorbet::resolver::(anonymous namespace)::ResolveConstantsWalk::resolveConstants<>()
      #6 0x13d0a15 sorbet::resolver::Resolver::run()
      #7 0xeaf34b sorbet::realmain::pipeline::resolve()
      #8 0xb1b1ae sorbet::realmain::realmain()
      #9 0xb15a22 main
      #10 0x7ffff7c65083 __libc_start_main
      #11 0xb1592e _start

* Fix error message
korbin pushed a commit that referenced this pull request Aug 27, 2024
* Add a failing test

    + exec test/lsp_test_runner --single_test=test/testdata/lsp/go_to_type_definition.rb
    Pausing
    Resuming
    [doctest] doctest version is "2.4.1"
    [doctest] run with "--help" for options
    [2022-08-01 22:09:09.445] [fatalFallback] [error] Exception::raise(): ./core/TypePtr.h:223 enforced condition store != 0 has failed: (no message provided)

    [2022-08-01 22:09:09.490] [fatalFallback] [error] Backtrace:
      #3 0xc859b2
      #4 0xdbc197 sorbet::core::TypePtr::tag()
      #5 0xef9fe7 sorbet::realmain::lsp::(anonymous namespace)::locsForType()::$_13::operator()()
      #6 0xef95d3 sorbet::typecaseHelper<>()
      #7 0xef8f85 sorbet::typecase<>()
      #8 0xef8b0a sorbet::realmain::lsp::(anonymous namespace)::locsForType()
      #9 0xef859f sorbet::realmain::lsp::TypeDefinitionTask::runRequest()
      #10 0xda699c sorbet::realmain::lsp::LSPRequestTask::run()
      #11 0xf160f4 sorbet::realmain::lsp::(anonymous namespace)::TypecheckerTask::run()
      sorbet#12 0xf1454e sorbet::realmain::lsp::LSPTypecheckerCoordinator::asyncRunInternal()
      sorbet#13 0xf14620 sorbet::realmain::lsp::LSPTypecheckerCoordinator::syncRun()
      sorbet#14 0xf12d44 sorbet::realmain::lsp::LSPLoop::runTask()
      sorbet#15 0xf12698 sorbet::realmain::lsp::LSPLoop::processRequests()
      sorbet#16 0xf0410d sorbet::realmain::lsp::SingleThreadedLSPWrapper::getLSPResponsesFor()
      sorbet#17 0xcbf398 sorbet::test::getLSPResponsesFor()
      sorbet#18 0xcbcece sorbet::test::getLSPResponsesFor()
      sorbet#19 0xcf1709 sorbet::test::TypeDefAssertion::check()
      sorbet#20 0xbbff18 sorbet::test::_DOCTEST_ANON_FUNC_71()
      sorbet#21 0x1d060a9 doctest::Context::run()
      sorbet#22 0xbc2380 main
      sorbet#23 0x7f162d27c083 __libc_start_main
      sorbet#24 0xbb34ae _start

    [2022-08-01 22:09:09.496] [fatalFallback] [error] Backtrace:
      #3 0x1d8f6e8 std::terminate()
      #4 0xbcb94b
      #5 0xdbc1c9
      #6 0xef9fe7 sorbet::realmain::lsp::(anonymous namespace)::locsForType()::$_13::operator()()
      #7 0xef95d3 sorbet::typecaseHelper<>()
      #8 0xef8f85 sorbet::typecase<>()
      #9 0xef8b0a sorbet::realmain::lsp::(anonymous namespace)::locsForType()
      #10 0xef859f sorbet::realmain::lsp::TypeDefinitionTask::runRequest()
      #11 0xda699c sorbet::realmain::lsp::LSPRequestTask::run()
      sorbet#12 0xf160f4 sorbet::realmain::lsp::(anonymous namespace)::TypecheckerTask::run()
      sorbet#13 0xf1454e sorbet::realmain::lsp::LSPTypecheckerCoordinator::asyncRunInternal()
      sorbet#14 0xf14620 sorbet::realmain::lsp::LSPTypecheckerCoordinator::syncRun()
      sorbet#15 0xf12d44 sorbet::realmain::lsp::LSPLoop::runTask()
      sorbet#16 0xf12698 sorbet::realmain::lsp::LSPLoop::processRequests()
      sorbet#17 0xf0410d sorbet::realmain::lsp::SingleThreadedLSPWrapper::getLSPResponsesFor()
      sorbet#18 0xcbf398 sorbet::test::getLSPResponsesFor()
      sorbet#19 0xcbcece sorbet::test::getLSPResponsesFor()
      sorbet#20 0xcf1709 sorbet::test::TypeDefAssertion::check()
      sorbet#21 0xbbff18 sorbet::test::_DOCTEST_ANON_FUNC_71()
      sorbet#22 0x1d060a9 doctest::Context::run()
      sorbet#23 0xbc2380 main
      sorbet#24 0x7f162d27c083 __libc_start_main
      sorbet#25 0xbb34ae _start

    libc++abi: terminate_handler unexpectedly returned
    ===============================================================================
    test/lsp_test_runner.cc:497:
    TEST CASE:  LSPTest

    test/lsp_test_runner.cc:497: FATAL ERROR: test case CRASHED: SIGABRT - Abort (abnormal termination) signal

* Set type to untyped if null
korbin pushed a commit that referenced this pull request Aug 27, 2024
* Add a failing test

    * thread #1, name = 'lsp_test_runner', stop reason = signal SIGSEGV: invalid address (fault address: 0x0)
      * frame #0: 0x0000000000e3d2c5 lsp_test_runner`absl::inlined_vector_internal::Storage<sorbet::core::SymbolRef, 1ul, std::__1::allocator<sorbet::core::SymbolRef>>::GetIsAllocated(this=0x0000000000000000) const at inlined_vector.h:353:40
        frame #1: 0x0000000000eabec9 lsp_test_runner`absl::InlinedVector<sorbet::core::SymbolRef, 1ul, std::__1::allocator<sorbet::core::SymbolRef>>::data(this=0x0000000000000000) const at inlined_vector.h:305:21
        frame #2: 0x0000000000eabb3a lsp_test_runner`absl::InlinedVector<sorbet::core::SymbolRef, 1ul, std::__1::allocator<sorbet::core::SymbolRef>>::operator=(this=0x00007fffffff6fe8, other=0x0000000000000000) at inlined_vector.h:465:40
        frame #3: 0x0000000000ea879f lsp_test_runner`sorbet::realmain::lsp::(anonymous namespace)::matchesQuery(ctx=Context @ 0x00007fffffff7100, lit=0x00000000035c0cc0, lspQuery=0x0000000002d0bfd0, symbolBeforeDealias=(_id = 24890)) at DefLocSaver.cc:121:24
        frame #4: 0x0000000000ea8357 lsp_test_runner`sorbet::realmain::lsp::DefLocSaver::postTransformConstantLit(this=0x00007fffffff86b8, ctx=Context @ 0x00007fffffff7148, tree=0x0000000002be4140) at DefLocSaver.cc:144:5
        frame #5: 0x0000000000e682da lsp_test_runner`decltype(self=0x00007fffffff86b8, args=0x00007fffffff7380, args=0x0000000002be4140) sorbet::ast::MapFunctions<(sorbet::ast::TreeMapKind)1>::CALL_MEMBER_impl_postTransformConstantLit<sorbet::realmain::lsp::DefLocSaver, true>::call<sorbet::core::Context&, sorbet::ast::ExpressionPtr&>(sorbet::realmain::lsp::DefLocSaver&, sorbet::core::Context&, sorbet::ast::ExpressionPtr&) at treemap.h:168:5
        frame #6: 0x0000000000e65ce8 lsp_test_runner`sorbet::ast::TreeMapper<sorbet::realmain::lsp::DefLocSaver, sorbet::core::Context, (sorbet::ast::TreeMapKind)1, (sorbet::ast::TreeMapDepthKind)0>::mapConstantLit(this=0x00007fffffff8648, v=0x0000000002be4140, ctx=Context @ 0x00007fffffff7380) at treemap.h:417:9
        frame #7: 0x0000000000e64515 lsp_test_runner`sorbet::ast::TreeMapper<sorbet::realmain::lsp::DefLocSaver, sorbet::core::Context, (sorbet::ast::TreeMapKind)1, (sorbet::ast::TreeMapDepthKind)0>::mapIt(this=0x00007fffffff8648, what=0x0000000002be4140, ctx=Context @ 0x00007fffffff7780) at treemap.h:569:28
        frame #8: 0x0000000000e649a0 lsp_test_runner`sorbet::ast::TreeMapper<sorbet::realmain::lsp::DefLocSaver, sorbet::core::Context, (sorbet::ast::TreeMapKind)1, (sorbet::ast::TreeMapDepthKind)0>::mapSend(this=0x00007fffffff8648, v=0x0000000002c9d308, ctx=Context @ 0x00007fffffff7bd0) at treemap.h:372:13
        frame #9: 0x0000000000e63c11 lsp_test_runner`sorbet::ast::TreeMapper<sorbet::realmain::lsp::DefLocSaver, sorbet::core::Context, (sorbet::ast::TreeMapKind)1, (sorbet::ast::TreeMapDepthKind)0>::mapIt(this=0x00007fffffff8648, what=0x0000000002c9d308, ctx=Context @ 0x00007fffffff7c50) at treemap.h:491:28
        frame #10: 0x0000000000e64dd4 lsp_test_runner`sorbet::ast::TreeMapper<sorbet::realmain::lsp::DefLocSaver, sorbet::core::Context, (sorbet::ast::TreeMapKind)1, (sorbet::ast::TreeMapDepthKind)0>::mapClassDef(this=0x00007fffffff8648, v=0x0000000002bc0fa0, ctx=Context @ 0x00007fffffff8070) at treemap.h:249:13
        frame #11: 0x0000000000e63c75 lsp_test_runner`sorbet::ast::TreeMapper<sorbet::realmain::lsp::DefLocSaver, sorbet::core::Context, (sorbet::ast::TreeMapKind)1, (sorbet::ast::TreeMapDepthKind)0>::mapIt(this=0x00007fffffff8648, what=0x0000000002bc0fa0, ctx=Context @ 0x00007fffffff80f0) at treemap.h:494:28
        frame sorbet#12: 0x0000000000e65e78 lsp_test_runner`sorbet::ast::TreeMapper<sorbet::realmain::lsp::DefLocSaver, sorbet::core::Context, (sorbet::ast::TreeMapKind)1, (sorbet::ast::TreeMapDepthKind)0>::mapInsSeq(this=0x00007fffffff8648, v=0x000000000246d3e0, ctx=Context @ 0x00007fffffff82f0) at treemap.h:438:13
        frame sorbet#13: 0x0000000000e645c6 lsp_test_runner`sorbet::ast::TreeMapper<sorbet::realmain::lsp::DefLocSaver, sorbet::core::Context, (sorbet::ast::TreeMapKind)1, (sorbet::ast::TreeMapDepthKind)0>::mapIt(this=0x00007fffffff8648, what=0x000000000246d3e0, ctx=Context @ 0x00007fffffff8638) at treemap.h:582:28
        frame sorbet#14: 0x0000000000e6397a lsp_test_runner`void sorbet::ast::TreeWalk::apply<sorbet::core::Context, sorbet::realmain::lsp::DefLocSaver>(ctx=Context @ 0x00007fffffff8680, func=0x00007fffffff86b8, to=0x000000000246d3e0) at treemap.h:622:20
        frame sorbet#15: 0x0000000000e52acc lsp_test_runner`sorbet::realmain::lsp::(anonymous namespace)::tryApplyDefLocSaver(gs=0x0000000002d0bf90, indexedCopies=size=1) at LSPTypechecker.cc:621:9
        frame sorbet#16: 0x0000000000e5235d lsp_test_runner`sorbet::realmain::lsp::LSPTypechecker::query(this=0x0000000002472050, q=0x00007fffffff8ca8, filesForQuery=size=1, workers=0x000000000246e9c0) const at LSPTypechecker.cc:643:5
        frame sorbet#17: 0x0000000000e53e1b lsp_test_runner`sorbet::realmain::lsp::LSPTypecheckerDelegate::query(this=0x0000000002bc27c0, q=0x00007fffffff8ca8, filesForQuery=size=1) const at LSPTypechecker.cc:770:24
        frame sorbet#18: 0x0000000000e42128 lsp_test_runner`sorbet::realmain::lsp::LSPQuery::byLoc(config=0x000000000246bcd8, typechecker=0x0000000002bc27c0, uri="file:///Users/jez/stripe/sorbet/test/testdata/lsp/hover_static_field_alias_to_nothing.rb", pos=0x0000000002bc0500, forMethod=TextDocumentHover, errorIfFileIsUntyped=true) at LSPQuery.cc:89:24
        frame sorbet#19: 0x0000000000f74ee0 lsp_test_runner`sorbet::realmain::lsp::HoverTask::runRequest(this=0x0000000002d373d0, typechecker=0x0000000002bc27c0) at hover.cc:44:19
        frame sorbet#20: 0x0000000000e3226c lsp_test_runner`sorbet::realmain::lsp::LSPRequestTask::run(this=0x0000000002d373d0, typechecker=0x0000000002bc27c0) at LSPTask.cc:222:21
        frame sorbet#21: 0x0000000000fbf3e4 lsp_test_runner`sorbet::realmain::lsp::(anonymous namespace)::TypecheckerTask::run(this=0x0000000002bc0028) at LSPTypecheckerCoordinator.cc:58:19
        frame sorbet#22: 0x0000000000fbda0e lsp_test_runner`sorbet::realmain::lsp::LSPTypecheckerCoordinator::asyncRunInternal(this=0x0000000002471db0, task=std::__1::shared_ptr<sorbet::core::lsp::Task>::element_type @ 0x0000000002bc0028 strong=2 weak=1) at LSPTypecheckerCoordinator.cc:129:15
        frame sorbet#23: 0x0000000000fbdae0 lsp_test_runner`sorbet::realmain::lsp::LSPTypecheckerCoordinator::syncRun(this=0x0000000002471db0, task=nullptr) at LSPTypecheckerCoordinator.cc:137:5
        frame sorbet#24: 0x0000000000fb34f8 lsp_test_runner`sorbet::realmain::lsp::LSPLoop::runTask(this=0x0000000002471d28, task=nullptr) at LSPLoop.cc:263:26
        frame sorbet#25: 0x0000000000fb2e38 lsp_test_runner`sorbet::realmain::lsp::LSPLoop::processRequests(this=0x0000000002471d28, messages=<unavailable>) at LSPLoop.cc:218:13
        frame sorbet#26: 0x0000000000fa3d6d lsp_test_runner`sorbet::realmain::lsp::SingleThreadedLSPWrapper::getLSPResponsesFor(this=0x000000000246ea10, messages=size=0) at wrapper.cc:68:14
        frame sorbet#27: 0x0000000000d2afd7 lsp_test_runner`sorbet::test::getLSPResponsesFor(wrapper=0x000000000246ea10, messages=size=0) at lsp.cc:490:27
        frame sorbet#28: 0x0000000000d2894e lsp_test_runner`sorbet::test::getLSPResponsesFor(wrapper=0x000000000246ea10, message=nullptr) at lsp.cc:530:12
        frame sorbet#29: 0x0000000000d664a3 lsp_test_runner`sorbet::test::HoverAssertion::check(this=0x0000000001eada28, sourceFileContents=0x00007fffffffc018, wrapper=0x000000000246ea10, nextId=0x00007fffffffbf24, errorPrefix="") at position_assertions.cc:1318:22
        frame sorbet#30: 0x0000000000d66224 lsp_test_runner`sorbet::test::HoverAssertion::checkAll(assertions=size=2, sourceFileContents=0x00007fffffffc018, wrapper=0x000000000246ea10, nextId=0x00007fffffffbf24, errorPrefix="") at position_assertions.cc:1280:30
        frame sorbet#31: 0x0000000000c29f46 lsp_test_runner`sorbet::test::DOCTEST_ANON_FUNC_58() at lsp_test_runner.cc:842:5
        frame sorbet#32: 0x0000000001de1180 lsp_test_runner`doctest::Context::run(this=0x00007fffffffcd58) at doctest.h:6930:21
        frame sorbet#33: 0x0000000000c2bcd0 lsp_test_runner`main(argc=2, argv=0x00007fffffffd258) at lsp_test_runner.cc:976:20
        frame sorbet#34: 0x00007ffff7c29d90 libc.so.6`__libc_start_call_main(main=(lsp_test_runner`main at lsp_test_runner.cc:959), argc=2, argv=0x00007fffffffd258) at libc_start_call_main.h:58:16
        frame sorbet#35: 0x00007ffff7c29e40 libc.so.6`__libc_start_main_impl(main=(lsp_test_runner`main at lsp_test_runner.cc:959), argc=2, argv=0x00007fffffffd258, init=<unavailable>, fini=<unavailable>, rtld_fini=<unavailable>, stack_end=0x00007fffffffd248) at libc-start.c:392:3
        frame sorbet#36: 0x0000000000c1ac85 lsp_test_runner`_start + 37

* Fix failing test
korbin pushed a commit that referenced this pull request Aug 27, 2024
* Add failing test

    ❯ sorbet test/testdata/definition_validator/superclass_class_loc__1.rb test/testdata/definition_validator/superclass_class_loc__2.rbi
    msg="Bad offset2Pos off" path="test/testdata/definition_validator/superclass_class_loc__1.rb" off="778""
    source="# typed: true\n\nmodule Parent\nend\n\nclass Child < Parent\nend\n"
    Exception::raise(): core/Loc.cc:43 enforced condition false has failed: (no message provided)

    Backtrace:
      #3 0xbb3f32
      #4 0x1a5b870 sorbet::core::Loc::offset2Pos()
      #5 0x1a5bbda sorbet::core::Loc::position()
      #6 0x1a5da17 sorbet::core::Loc::filePosToString()
      #7 0x19df6b8 sorbet::core::Error::toString()
      #8 0x19f292e sorbet::core::ErrorQueue::pushError()
      #9 0x1a3e882 sorbet::core::GlobalState::_error()
      #10 0x19e11c0 sorbet::core::ErrorBuilder::~ErrorBuilder()
      #11 0x1288d5a sorbet::definition_validator::(anonymous namespace)::validateSuperClass()
      sorbet#12 0x12861b6 sorbet::definition_validator::(anonymous namespace)::ValidateWalk::preTransformClassDef()
      sorbet#13 0x1285f6a sorbet::ast::MapFunctions<>::CALL_MEMBER_impl_preTransformClassDef<>::call<>()
      sorbet#14 0x1284c0f sorbet::ast::TreeMapper<>::mapClassDef()
      sorbet#15 0x1283d55 sorbet::ast::TreeMapper<>::mapIt()
      sorbet#16 0x1285a58 sorbet::ast::TreeMapper<>::mapInsSeq()
      sorbet#17 0x12846a6 sorbet::ast::TreeMapper<>::mapIt()
      sorbet#18 0x12839fa sorbet::ast::TreeWalk::apply<>()
      sorbet#19 0x12838db sorbet::definition_validator::runOne()
      sorbet#20 0xf5e8b0 sorbet::realmain::pipeline::(anonymous namespace)::typecheckOne()
      sorbet#21 0xf5e50d sorbet::realmain::pipeline::typecheck()::$_5::operator()()
      sorbet#22 0xf5e19d std::__1::__invoke<>()
      sorbet#23 0xf5e14d std::__1::__invoke_void_return_wrapper<>::__call<>()
      sorbet#24 0xf5e11d std::__1::__function::__alloc_func<>::operator()()
      sorbet#25 0xf5d2e9 std::__1::__function::__func<>::operator()()
      sorbet#26 0x1753d52 std::__1::__function::__value_func<>::operator()()
      sorbet#27 0x174a5f5 std::__1::function<>::operator()()
      sorbet#28 0x1bf5d7a sorbet::WorkerPoolImpl::multiplexJob()::$_2::operator()()
      sorbet#29 0x1bf5d1d std::__1::__invoke<>()
      sorbet#30 0x1bf5ccd std::__1::__invoke_void_return_wrapper<>::__call<>()
      sorbet#31 0x1bf5c9d std::__1::__function::__alloc_func<>::operator()()
      sorbet#32 0x1bf4ea9 std::__1::__function::__func<>::operator()()
      sorbet#33 0x1bfa5b2 std::__1::__function::__value_func<>::operator()()
      sorbet#34 0x1bf91d5 std::__1::function<>::operator()()
      sorbet#35 0x1bf313d sorbet::WorkerPoolImpl::WorkerPoolImpl()::$_0::operator()()
      sorbet#36 0x1bf307d std::__1::__invoke<>()
      sorbet#37 0x1bf302d std::__1::__invoke_void_return_wrapper<>::__call<>()
      sorbet#38 0x1bf2ffd std::__1::__function::__alloc_func<>::operator()()
      sorbet#39 0x1bf2219 std::__1::__function::__func<>::operator()()
      sorbet#40 0x1753d52 std::__1::__function::__value_func<>::operator()()
      sorbet#41 0x174a5f5 std::__1::function<>::operator()()
      sorbet#42 0x1bfdd53 Joinable::trampoline()
      sorbet#43 0x7f5e1d694b43
      sorbet#44 0x7f5e1d726a00

* Fix failing test
korbin pushed a commit that referenced this pull request Aug 27, 2024
* Pull in sorbet/bazel-toolchain#8

Required to make Clang 15 available.

* llvm toolchain: 12.0.0 → 15.0.7

* Silence this warning globally

* Fix "unused but set variable" warnings

* Stop linking against mimalloc on macOS release builds

* Fix path to sanitizer archives

Clang moved these at some point.

Note that we only ever ran the sanitize build on x86_64--it never ran
over arm64 builds.

That might be nice to add some day, but I'm not blocking on it.

* Add doc on how to build and publish LLVM

* tools/scripts/format_cxx.sh

* Silence some warning for abseil for now

* Backport a patch from upstream to fix -Warray-parameter warning

I couldn't get this silenced by adding `--copt=-Wno-array-parameter`
because it looks like abseil builds this with a bunch of specific
warning flags, and those take precedence over ours.

The issue is fixed upstream, and when we upgrade we'll get this change
for free, but as mentioned in the previous commit we can't upgrade
abseil until after we upgrade clang.

* Ignore unknown warnings on emscripten build

* Defer throwing an exception until all threads have exited

In clang 15, the sanitizer was catching a stack-use-after-return error
from this multithreaded codepath. The test which caught this was

    //test/cli:test_folder-input-not-found

(Because it is multithreaded, the bug only manifested about 30% of the
time, depending on the order that threads were scheduled by the OS.)

The bug was that we were attempting to (atomically) write to
`pendingJobs` from children threads after the function that spawned
those threads exited.

A sequence of steps that could happen:

- A worker thread would realize that the input was not a directory. It
  would return a result requesting that the parent thread throw an
  exception, and queue up a bunch of jobs that would have the effect of
  shutting down the other threads.

- The parent thread would get scheduled first. It would see that a child
  asked to throw, and it would throw, in effect returning from the
  function before all children were done.

- The children would wake up and attempt to decrement the `pendingJobs`
  variable in the worker threads' closure by reference. That stack slot
  is not there anymore because the enclosing function raised.

The fix is simply wait for all the threads to finish, and only raise the
requested exception after we're sure that all the children threads have
finished processing and shut down.

For posterity, this is what the test failure looked like

    +=================================================================
    +==1781049==ERROR: AddressSanitizer: stack-use-after-return on address 0x7f435a57c140 at pc 0x55cac4f42fd8 bp 0x7f43420ef940 sp 0x7f43420ef938
    +WRITE of size 8 at 0x7f435a57c140 thread T7 (options.findFil)
    +    #0 0x55cac4f42fd7 in unsigned long std::__1::__cxx_atomic_fetch_add[abi:v15007]<unsigned long>(std::__1::__cxx_atomic_base_impl<unsigned long>*, unsigned long, std::__1::memory_order) realmain.cc
    +    #1 0x55cac6e4d9b8 in std::__1::__atomic_base<unsigned long, true>::operator+=[abi:v15007](unsigned long) common.cc
    +    #2 0x55cac6e3f5a6 in std::__1::__function::__func<appendFilesInDir(std::__1::basic_string_view<char, std::__1::char_traits<char>>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, absl::flat_hash_set<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, absl::container_internal::StringHash, absl::container_internal::StringHashEq::Eq, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>> const&, sorbet::WorkerPool&, bool, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>>&, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>> const&, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>> const&)::$_0, std::__1::allocator<appendFilesInDir(std::__1::basic_string_view<char, std::__1::char_traits<char>>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, absl::flat_hash_set<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, absl::container_internal::StringHash, absl::container_internal::StringHashEq::Eq, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>> const&, sorbet::WorkerPool&, bool, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>>&, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>> const&, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>> const&)::$_0>, void ()>::operator()() common.cc
    +    #3 0x55cac629c0e1 in std::__1::__function::__value_func<void ()>::operator()[abi:v15007]() const driver.cc
    +    #4 0x55cac6265778 in std::__1::function<void ()>::operator()() const (/pay/home/jez/.cache/bazel/_bazel_jez/2cc40ac946cd09178597ebd947795951/execroot/com_stripe_ruby_typer/bazel-out/k8-dbg/bin/main/sorbet+0x43e7778) (BuildId: c972efcad340ab8e0e5ea671063eb36b)
    +    #5 0x55cac6ed26ac in std::__1::__function::__func<sorbet::WorkerPoolImpl::multiplexJob(std::__1::basic_string_view<char, std::__1::char_traits<char>>, std::__1::function<void ()>)::$_2, std::__1::allocator<sorbet::WorkerPoolImpl::multiplexJob(std::__1::basic_string_view<char, std::__1::char_traits<char>>, std::__1::function<void ()>)::$_2>, bool ()>::operator()() WorkerPoolImpl.cc
    +    #6 0x55cac6ed12c5 in std::__1::__function::__func<sorbet::WorkerPoolImpl::WorkerPoolImpl(int, spdlog::logger&)::$_0, std::__1::allocator<sorbet::WorkerPoolImpl::WorkerPoolImpl(int, spdlog::logger&)::$_0>, void ()>::operator()() WorkerPoolImpl.cc
    +    #7 0x55cac629c0e1 in std::__1::__function::__value_func<void ()>::operator()[abi:v15007]() const driver.cc
    +    #8 0x55cac6265778 in std::__1::function<void ()>::operator()() const (/pay/home/jez/.cache/bazel/_bazel_jez/2cc40ac946cd09178597ebd947795951/execroot/com_stripe_ruby_typer/bazel-out/k8-dbg/bin/main/sorbet+0x43e7778) (BuildId: c972efcad340ab8e0e5ea671063eb36b)
    +    #9 0x55cac6ee3e33 in Joinable::trampoline(void*) (/pay/home/jez/.cache/bazel/_bazel_jez/2cc40ac946cd09178597ebd947795951/execroot/com_stripe_ruby_typer/bazel-out/k8-dbg/bin/main/sorbet+0x5065e33) (BuildId: c972efcad340ab8e0e5ea671063eb36b)
    +    #10 0x7f435c953608 in start_thread (/lib/x86_64-linux-gnu/libpthread.so.0+0x8608) (BuildId: c6d0d79d906d62bb768421fc6dada0d5e729f177)
    +    #11 0x7f435c84c352 in __clone (/lib/x86_64-linux-gnu/libc.so.6+0x11f352) (BuildId: 87b331c034a6458c64ce09c03939e947212e18ce)
    +
    +Address 0x7f435a57c140 is located in stack of thread T0 at offset 320 in frame
    +    #0 0x55cac6e3bb4c in appendFilesInDir(std::__1::basic_string_view<char, std::__1::char_traits<char>>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, absl::flat_hash_set<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, absl::container_internal::StringHash, absl::container_internal::StringHashEq::Eq, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>> const&, sorbet::WorkerPool&, bool, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>>&, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>> const&, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>> const&) (/pay/home/jez/.cache/bazel/_bazel_jez/2cc40ac946cd09178597ebd947795951/execroot/com_stripe_ruby_typer/bazel-out/k8-dbg/bin/main/sorbet+0x4fbdb4c) (BuildId: c972efcad340ab8e0e5ea671063eb36b)
    +
    +  This frame has 20 object(s):
    +    [32, 40) '__p.addr.i.i.i.i'
    +    [64, 65) '__af.i.i.i'
    +    [80, 104) '__hold.i.i.i'
    +    [144, 160) 'ref.tmp.i.i.i'
    +    [176, 177) 'ref.tmp.i'
    +    [192, 208) 'basePath'
    +    [224, 225) 'recursive.addr'
    +    [240, 244) 'numWorkers'
    +    [256, 272) 'jobq'
    +    [288, 304) 'resultq'
    +    [320, 328) 'pendingJobs' <== Memory access at offset 320 is inside this variable
    +    [352, 384) 'ref.tmp24'
    +    [416, 464) 'agg.tmp41'
    +    [496, 584) 'agg.tmp42'
    +    [624, 656) 'threadResult'
    +    [688, 704) 'ref.tmp73'
    +    [720, 728) 'ref.tmp89'
    +    [752, 832) '__enforceTimer'
    +    [864, 880) 'agg.tmp199'
    +    [896, 904) 'ref.tmp225'
    +HINT: this may be a false positive if your program uses some custom stack unwind mechanism, swapcontext or vfork
    +      (longjmp and C++ exceptions *are* supported)
    +SUMMARY: AddressSanitizer: stack-use-after-return realmain.cc in unsigned long std::__1::__cxx_atomic_fetch_add[abi:v15007]<unsigned long>(std::__1::__cxx_atomic_base_impl<unsigned long>*, unsigned long, std::__1::memory_order)
    +Shadow bytes around the buggy address:
    +  0x0fe8eb4a77d0: f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5
    +  0x0fe8eb4a77e0: f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5
    +  0x0fe8eb4a77f0: f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5
    +  0x0fe8eb4a7800: f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5
    +  0x0fe8eb4a7810: f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5
    +=>0x0fe8eb4a7820: f5 f5 f5 f5 f5 f5 f5 f5[f5]f5 f5 f5 f5 f5 f5 f5
    +  0x0fe8eb4a7830: f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5
    +  0x0fe8eb4a7840: f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5
    +  0x0fe8eb4a7850: f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5
    +  0x0fe8eb4a7860: f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5
    +  0x0fe8eb4a7870: f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5
    +Shadow byte legend (one shadow byte represents 8 application bytes):
    +  Addressable:           00
    +  Partially addressable: 01 02 03 04 05 06 07
    +  Heap left redzone:       fa
    +  Freed heap region:       fd
    +  Stack left redzone:      f1
    +  Stack mid redzone:       f2
    +  Stack right redzone:     f3
    +  Stack after return:      f5
    +  Stack use after scope:   f8
    +  Global redzone:          f9
    +  Global init order:       f6
    +  Poisoned by user:        f7
    +  Container overflow:      fc
    +  Array cookie:            ac
    +  Intra object redzone:    bb
    +  ASan internal:           fe
    +  Left alloca redzone:     ca
    +  Right alloca redzone:    cb
    +Thread T7 (options.findFil) created by T0 here:
    +    #0 0x55cac4eadd9c in pthread_create (/pay/home/jez/.cache/bazel/_bazel_jez/2cc40ac946cd09178597ebd947795951/execroot/com_stripe_ruby_typer/bazel-out/k8-dbg/bin/main/sorbet+0x302fd9c) (BuildId: c972efcad340ab8e0e5ea671063eb36b)
    +    #1 0x55cac6ee4267 in runInAThread(std::__1::basic_string_view<char, std::__1::char_traits<char>>, std::__1::function<void ()>, std::__1::optional<int>) (/pay/home/jez/.cache/bazel/_bazel_jez/2cc40ac946cd09178597ebd947795951/execroot/com_stripe_ruby_typer/bazel-out/k8-dbg/bin/main/sorbet+0x5066267) (BuildId: c972efcad340ab8e0e5ea671063eb36b)
    +    #2 0x55cac6ecf33f in sorbet::WorkerPoolImpl::WorkerPoolImpl(int, spdlog::logger&) (/pay/home/jez/.cache/bazel/_bazel_jez/2cc40ac946cd09178597ebd947795951/execroot/com_stripe_ruby_typer/bazel-out/k8-dbg/bin/main/sorbet+0x505133f) (BuildId: c972efcad340ab8e0e5ea671063eb36b)
    +    #3 0x55cac6ece73c in sorbet::WorkerPool::create(int, spdlog::logger&) (/pay/home/jez/.cache/bazel/_bazel_jez/2cc40ac946cd09178597ebd947795951/execroot/com_stripe_ruby_typer/bazel-out/k8-dbg/bin/main/sorbet+0x505073c) (BuildId: c972efcad340ab8e0e5ea671063eb36b)
    +    #4 0x55cac6a300a6 in sorbet::realmain::options::readOptions(sorbet::realmain::options::Options&, std::__1::vector<std::__1::unique_ptr<sorbet::pipeline::semantic_extension::SemanticExtension, std::__1::default_delete<sorbet::pipeline::semantic_extension::SemanticExtension>>, std::__1::allocator<std::__1::unique_ptr<sorbet::pipeline::semantic_extension::SemanticExtension, std::__1::default_delete<sorbet::pipeline::semantic_extension::SemanticExtension>>>>&, int, char**, std::__1::vector<sorbet::pipeline::semantic_extension::SemanticExtensionProvider*, std::__1::allocator<sorbet::pipeline::semantic_extension::SemanticExtensionProvider*>> const&, std::__1::shared_ptr<spdlog::logger>) (/pay/home/jez/.cache/bazel/_bazel_jez/2cc40ac946cd09178597ebd947795951/execroot/com_stripe_ruby_typer/bazel-out/k8-dbg/bin/main/sorbet+0x4bb20a6) (BuildId: c972efcad340ab8e0e5ea671063eb36b)
    +    #5 0x55cac4f0379c in sorbet::realmain::realmain(int, char**) (/pay/home/jez/.cache/bazel/_bazel_jez/2cc40ac946cd09178597ebd947795951/execroot/com_stripe_ruby_typer/bazel-out/k8-dbg/bin/main/sorbet+0x308579c) (BuildId: c972efcad340ab8e0e5ea671063eb36b)
    +    #6 0x55cac4eff162 in main (/pay/home/jez/.cache/bazel/_bazel_jez/2cc40ac946cd09178597ebd947795951/execroot/com_stripe_ruby_typer/bazel-out/k8-dbg/bin/main/sorbet+0x3081162) (BuildId: c972efcad340ab8e0e5ea671063eb36b)
    +    #7 0x7f435c751082 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24082) (BuildId: 87b331c034a6458c64ce09c03939e947212e18ce)
    +
    +==1781049==ABORTING
    ================================================================================
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants