Also note the original sample did not crash; but the problem with the original sample is that the transaction handler was a simple function, not a lambda.
If I convert the transaction handler to a form using the lambda (std::function<void(firebase::database::MutableData* data)>), such as applying the attached diff, the crash happens:
TEST: Run transaction.
** Message: Remote error from secret service: org.freedesktop.Secret.Error.IsLocked: Cannot create an item in a locked collection
WARNING: Secret store failed, please make sure libsecret is installed.
Transaction function executing.
Thread 5 "desktop_testapp" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffeeffd700 (LWP 28828)]
0x00007ffff735fcdf in std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::string const&) ()
from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
(gdb) where
#0 0x00007ffff735fcdf in std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::string const&) ()
from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#1 0x00000000008b228a in std::basic_string<char, std::char_traits<char>, std::allocator<char> > std::operator+<char, std::char_traits<char>, std::allocator<char> >(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, char const*) ()
#2 0x00000000009167d1 in firebase::Path::GetChild(std::string const&) const ()
#3 0x000000000080ab13 in firebase::database::internal::MutableDataInternal::Child(char const*) ()
#4 0x00000000007ef398 in firebase::database::MutableData::Child(char const*) ()
#5 0x00000000007d85bd in <lambda(firebase::database::MutableData*)>::operator()(firebase::database::MutableData *) const (__closure=0xf22790, data=0x7fffe0023c10)
at /share/software/firebase_sdk/quickstart-cpp.git/database/testapp/src/common_main.cc:452
#6 0x00000000007e0e4b in std::_Function_handler<firebase::database::TransactionResult(firebase::database::MutableData*), common_main(int, char const**)::<lambda(firebase::database::MutableData*)> >::_M_invoke(const std::_Any_data &, firebase::database::MutableData *&&) (__functor=...,
__args#0=@0x7fffeeffc9f0: 0x7fffe0023c10) at /usr/include/c++/9/bits/std_function.h:285
#7 0x00000000007ee905 in std::function<firebase::database::TransactionResult (firebase::database::MutableData*)>::operator()(firebase::database::MutableData*) const ()
#8 0x00000000007ee291 in firebase::database::CallStdFunction(firebase::database::MutableData*, void*) ()
#9 0x000000000083cad9 in firebase::database::internal::Repo::StartTransaction(firebase::Path const&, firebase::database::TransactionResult (*)(firebase::database::MutableData*, void*), void*, void (*)(void*), bool, firebase::ReferenceCountedFutureImpl*, firebase::SafeFutureHandle<firebase::database::DataSnapshot>) ()
#10 0x00000000008045e6 in firebase::database::internal::DatabaseReferenceInternal::RunTransaction(firebase::database::TransactionResult (*)(firebase::database::MutableData*, void*), void*, void (*)(void*), bool)::{lambda(firebase::database::internal::Repo*, firebase::Path, firebase::database::TransactionResult (*)(firebase::database::MutableData*, void*), void*, void (*)(void*), bool, firebase::ReferenceCountedFutureImpl*, firebase::SafeFutureHandle<firebase::database::DataSnapshot>)#1}::operator()(firebase::database::internal::Repo*, firebase::Path, firebase::database::TransactionResult (*)(firebase::database::MutableData*, void*), void*, void (*)(void*), bool, firebase::ReferenceCountedFutureImpl*, firebase::SafeFutureHandle<firebase::database::DataSnapshot>) const ()
#11 0x000000000080464b in firebase::database::internal::DatabaseReferenceInternal::RunTransaction(firebase::database::TransactionResult (*)(firebase::database::MutableData*, void*), void*, void (*)(void*), bool)::{lambda(firebase::database::internal::Repo*, firebase::Path, firebase::database::TransactionResult (*)(firebase::database::MutableData*, void*), void*, void (*)(void*), bool, firebase::ReferenceCountedFutureImpl*, firebase::SafeFutureHandle<firebase::database::DataSnapshot>)#1}::_FUN(firebase::database::internal::Repo*, firebase::Path, firebase::database::TransactionResult (*)(firebase::database::MutableData*, void*), void*, void (*)(void*), bool, firebase::ReferenceCountedFutureImpl*, firebase::SafeFutureHandle<firebase::database::DataSnapshot>) ()
#12 0x0000000000809d68 in void firebase::callback::CallbackVariadic<firebase::database::internal::Repo*, firebase::Path, firebase::database::TransactionResult (*)(firebase::database::MutableData*, void*), void*, void (*)(void*), bool, firebase::ReferenceCountedFutureImpl*, firebase::SafeFutureHandle<firebase::database::DataSnapshot> >::RunInternal<0, 1, 2, 3, 4, 5, 6, 7>(firebase::callback::IntegerSequence<0, 1, 2, 3, 4, 5, 6, 7>) ()
#13 0x00000000008095e7 in firebase::callback::CallbackVariadic<firebase::database::internal::Repo*, firebase::Path, firebase::database::TransactionResult (*)(firebase::database::MutableData*, void*), void*, void (*)(void*), bool, firebase::ReferenceCountedFutureImpl*, firebase::SafeFutureHandle<firebase::database::DataSnapshot> >::Run() ()
#14 0x000000000091c6cb in firebase::scheduler::Scheduler::TriggerCallback(firebase::SharedPtr<firebase::scheduler::Scheduler::RequestData> const&) ()
#15 0x000000000091c4c7 in firebase::scheduler::Scheduler::WorkerThreadRoutine(void*) ()
#16 0x0000000000920de4 in void std::_Bind_simple<void (*(void*))(void*)>::_M_invoke<0ul>(std::_Index_tuple<0ul>) ()
#17 0x0000000000920c49 in std::_Bind_simple<void (*(void*))(void*)>::operator()() ()
#18 0x0000000000920b7a in std::thread::_Impl<std::_Bind_simple<void (*(void*))(void*)> >::_M_run() ()
#19 0x00007ffff73474ee in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#20 0x00007ffff7bc16ba in start_thread (arg=0x7fffeeffd700) at pthread_create.c:333
#21 0x00007ffff6a9341d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109