Skip to content
New issue

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

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

Already on GitHub? # to your account

Any calls to json::convert_all_numbers_to_string or other functions from the same component are resulting in a crash #41497

Closed
cdesouza-chromium opened this issue Oct 8, 2024 · 1 comment · Fixed by brave/brave-core#25898 or brave/brave-core#25975

Comments

@cdesouza-chromium
Copy link
Contributor

This crash only happens when building on Windows with Debug configuration. Example stack:

[ RUN      ] JsonParser.ConvertAllNumbersToString
Received fatal exception EXCEPTION_ACCESS_VIOLATION
        RtlFreeHeap [0x00007FFE9964AFC5+37]
        std::sys::alloc::windows::impl$0::dealloc [0x00007FF734F2667A+218] (C:\Users\redac\dev\brave-browser\src\third_party\rust-toolchain\lib\rustlib\src\rust\library\std\src\sys\alloc\windows.rs:242)
        std::alloc::__default_lib_allocator::__rdl_dealloc [0x00007FF734F25B8C+76] (C:\Users\redac\dev\brave-browser\src\third_party\rust-toolchain\lib\rustlib\src\rust\library\std\src\alloc.rs:410)
        __rust_dealloc [0x00007FF72B0C4E77+39] (C:\Users\redac\dev\brave-browser\src\build\rust\std\remap_alloc.cc:119)
        alloc::alloc::dealloc [0x00007FF7374E3BE3+67] (C:\Users\redac\dev\brave-browser\src\third_party\rust-toolchain\lib\rustlib\src\rust\library\alloc\src\alloc.rs:118)
        alloc::alloc::impl$1::deallocate [0x00007FF7374E436B+75] (C:\Users\redac\dev\brave-browser\src\third_party\rust-toolchain\lib\rustlib\src\rust\library\alloc\src\alloc.rs:254)
        alloc::raw_vec::RawVecInner<alloc::alloc::Global>::deallocate<alloc::alloc::Global> [0x00007FF73759BD8E+110] (C:\Users\redac\dev\brave-browser\src\third_party\rust-toolchain\lib\rustlib\src\rust\library\alloc\src\raw_vec.rs:754)
        alloc::raw_vec::impl$4::drop<u8,alloc::alloc::Global> [0x00007FF73759A637+23] (C:\Users\redac\dev\brave-browser\src\third_party\rust-toolchain\lib\rustlib\src\rust\library\alloc\src\raw_vec.rs:410)
        core::ptr::drop_in_place<alloc::raw_vec::RawVec<u8,alloc::alloc::Global> > [0x00007FF7374DFD8E+14] (C:\Users\redac\dev\brave-browser\src\third_party\rust-toolchain\lib\rustlib\src\rust\library\core\src\ptr\mod.rs:574)
        core::ptr::drop_in_place<alloc::vec::Vec<u8,alloc::alloc::Global> > [0x00007FF7374DFD1D+29] (C:\Users\redac\dev\brave-browser\src\third_party\rust-toolchain\lib\rustlib\src\rust\library\core\src\ptr\mod.rs:574)
        core::ptr::drop_in_place<alloc::string::String> [0x00007FF7374DFCEE+14] (C:\Users\redac\dev\brave-browser\src\third_party\rust-toolchain\lib\rustlib\src\rust\library\core\src\ptr\mod.rs:574)
        core::mem::manually_drop::ManuallyDrop<alloc::string::String>::drop<alloc::string::String> [0x00007FF7368476EE+14] (C:\Users\redac\dev\brave-browser\src\third_party\rust-toolchain\lib\rustlib\src\rust\library\core\src\mem\manually_drop.rs:151)
        cxx::symbols::rust_string::string_drop [0x00007FF73684BFEE+14] (C:\Users\redac\dev\brave-browser\src\third_party\rust\chromium_crates_io\vendor\cxx-1.0.128\src\symbols\rust_string.rs:86)
        rust::cxxbridge1::String::~String [0x00007FF733729D23+19] (C:\Users\redac\dev\brave-browser\src\third_party\rust\chromium_crates_io\vendor\cxx-1.0.128\src\cxx.cc:128)
        brave_wallet::JsonParser_ConvertAllNumbersToString_Test::TestBody [0x00007FF7287BD312+290] (C:\Users\redac\dev\brave-browser\src\brave\components\json\json_parser_unittest.cc:555)
        testing::internal::HandleExceptionsInMethodIfSupported<testing::Test,void> [0x00007FF72FD0A005+69] (C:\Users\redac\dev\brave-browser\src\third_party\googletest\src\googletest\src\gtest.cc:2698)
        testing::Test::Run [0x00007FF72FD09F83+147] (C:\Users\redac\dev\brave-browser\src\third_party\googletest\src\googletest\src\gtest.cc:2720)
        testing::TestInfo::Run [0x00007FF72FD0AAC7+279] (C:\Users\redac\dev\brave-browser\src\third_party\googletest\src\googletest\src\gtest.cc:2862)
        testing::TestSuite::Run [0x00007FF72FD0B98B+411] (C:\Users\redac\dev\brave-browser\src\third_party\googletest\src\googletest\src\gtest.cc:3039)
        testing::internal::UnitTestImpl::RunAllTests [0x00007FF72FD17B0A+1082] (C:\Users\redac\dev\brave-browser\src\third_party\googletest\src\googletest\src\gtest.cc:5968)
        testing::internal::HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl,bool> [0x00007FF72FD176BB+75] (C:\Users\redac\dev\brave-browser\src\third_party\googletest\src\googletest\src\gtest.cc:2696)
        testing::UnitTest::Run [0x00007FF72FD1753D+317] (C:\Users\redac\dev\brave-browser\src\third_party\googletest\src\googletest\src\gtest.cc:5546)
        RUN_ALL_TESTS [0x00007FF7315450E1+17] (C:\Users\redac\dev\brave-browser\src\third_party\googletest\src\googletest\include\gtest\gtest.h:2334)
        base::TestSuite::RunAllTests [0x00007FF7315450BE+14] (C:\Users\redac\dev\brave-browser\src\base\test\test_suite.cc:643)
        base::TestSuite::Run [0x00007FF731543869+185] (C:\Users\redac\dev\brave-browser\src\base\test\test_suite.cc:421)
        content::UnitTestTestSuite::Run [0x00007FF73B51E7BD+189] (C:\Users\redac\dev\brave-browser\src\content\public\test\unittest_test_suite.cc:190)
        base::internal::DecayedFunctorTraits<int (content::UnitTestTestSuite::*)(),content::UnitTestTestSuite *>::Invoke<int (content::UnitTestTestSuite::*)(),content::UnitTestTestSuite *> [0x00007FF73B51D55A+26] (C:\Users\redac\dev\brave-browser\src\base\functional\bind_internal.h:738)
        base::internal::InvokeHelper<0,base::internal::FunctorTraits<int (content::UnitTestTestSuite::*&&)(),content::UnitTestTestSuite *>,int,0>::MakeItSo<int (content::UnitTestTestSuite::*)(),std::__Cr::tuple<base::internal::UnretainedWrapper<content::UnitTestT [0x00007FF73B51D51B+75] (C:\Users\redac\dev\brave-browser\src\base\functional\bind_internal.h:930)
        base::internal::Invoker<base::internal::FunctorTraits<int (content::UnitTestTestSuite::*&&)(),content::UnitTestTestSuite *>,base::internal::BindState<1,1,0,int (content::UnitTestTestSuite::*)(),base::internal::UnretainedWrapper<content::UnitTestTestSuite, [0x00007FF73B51D4C2+34] (C:\Users\redac\dev\brave-browser\src\base\functional\bind_internal.h:1067)
        base::internal::Invoker<base::internal::FunctorTraits<int (content::UnitTestTestSuite::*&&)(),content::UnitTestTestSuite *>,base::internal::BindState<1,1,0,int (content::UnitTestTestSuite::*)(),base::internal::UnretainedWrapper<content::UnitTestTestSuite, [0x00007FF73B51D43F+47] (C:\Users\redac\dev\brave-browser\src\base\functional\bind_internal.h:980)
        base::OnceCallback<int ()>::Run [0x00007FF73153A515+213] (C:\Users\redac\dev\brave-browser\src\base\functional\callback.h:156)
        base::`anonymous namespace'::RunTestSuite [0x00007FF731539F83+451] (C:\Users\redac\dev\brave-browser\src\base\test\launcher\unit_test_launcher.cc:187)
        base::`anonymous namespace'::LaunchUnitTestsInternal [0x00007FF7315388A3+387] (C:\Users\redac\dev\brave-browser\src\base\test\launcher\unit_test_launcher.cc:267)
        base::LaunchUnitTests [0x00007FF7315385E7+375] (C:\Users\redac\dev\brave-browser\src\base\test\launcher\unit_test_launcher.cc:332)
        main [0x00007FF73B51CD6B+379] (C:\Users\redac\dev\brave-browser\src\brave\test\base\run_all_unittests.cc:35)
        invoke_main [0x00007FF73B52D379+57] (D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:79)
        __scrt_common_main_seh [0x00007FF73B52D4AE+302] (D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288)
        __scrt_common_main [0x00007FF73B52D52E+14] (D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:331)
        mainCRTStartup [0x00007FF73B52D54E+14] (D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_main.cpp:17)
        BaseThreadInitThunk [0x00007FFE9846257D+29]
        RtlUserThreadStart [0x00007FFE9966AF28+40]
cdesouza-chromium added a commit to brave/brave-core that referenced this issue Oct 9, 2024
For some unknown reason this PR has broken the Windows debug use of
`json::convert_all_numbers_to_string` and others.

Resolves brave/brave-browser#41497

This reverts commit a235817.
cdesouza-chromium added a commit to brave/brave-core that referenced this issue Oct 9, 2024
It is not entirely clear what is the underlying mechanism for this
failure, and it should be investigated further. On Windows Debug builds,
any calls to functions like `json::convert_all_numbers_to_string` were
causing a runtime crash. Bisecting our branch has revealed that this
crash started after an entirely unrelated change [1] that in fact seems
quite anodyne.

This change correct the runtime failure with a minimum change.

Resolves brave/brave-browser#41497

[1] #25830
cdesouza-chromium added a commit to brave/brave-core that referenced this issue Oct 9, 2024
It is not entirely clear what is the underlying mechanism for this
failure, and it should be investigated further. On Windows Debug builds,
any calls to functions like `json::convert_all_numbers_to_string` were
causing a runtime crash. Bisecting our branch has revealed that this
crash started after an entirely unrelated change [1] that in fact seems
quite anodyne.

This change correct the runtime failure with a minimum change.

Resolves brave/brave-browser#41497

[1] #25830
cdesouza-chromium added a commit to brave/brave-core that referenced this issue Oct 9, 2024
It is not entirely clear what is the underlying mechanism for this
failure, and it should be investigated further. On Windows Debug builds,
any calls to functions like `json::convert_all_numbers_to_string` were
causing a runtime crash. Bisecting our branch has revealed that this
crash started after an entirely unrelated change [1] that in fact seems
quite anodyne.

This change correct the runtime failure with a minimum change.

Resolves brave/brave-browser#41497

[1] #25830
cdesouza-chromium added a commit to brave/brave-core that referenced this issue Oct 9, 2024
It is not entirely clear what is the underlying mechanism for this
failure, and it should be investigated further. On Windows Debug builds,
any calls to functions like `json::convert_all_numbers_to_string` were
causing a runtime crash. Bisecting our branch has revealed that this
crash started after an entirely unrelated change [1] that in fact seems
quite anodyne.

This change correct the runtime failure with a minimum change.

Resolves brave/brave-browser#41497

[1] #25830
cdesouza-chromium added a commit to brave/brave-core that referenced this issue Oct 9, 2024
It is not entirely clear what is the underlying mechanism for this
failure, and it should be investigated further. On Windows Debug builds,
any calls to functions like `json::convert_all_numbers_to_string` were
causing a runtime crash. Bisecting our branch has revealed that this
crash started after an entirely unrelated change [1] that in fact seems
quite anodyne.

This change correct the runtime failure with a minimum change.

Resolves brave/brave-browser#41497

[1] #25830
@brave-builds brave-builds added this to the 1.72.x - Nightly milestone Oct 9, 2024
@cdesouza-chromium
Copy link
Contributor Author

This issue is ultimately the result of using component builds, and the fact rust's stdlib doesn't properly support them. rust-lang/rust#131468

# for free to join this conversation on GitHub. Already have an account? # to comment