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

Data race in NYdbWorkload::NLog::TLogGenerator::GenerateRandomRows #13714

Open
iddqdex opened this issue Jan 22, 2025 · 0 comments
Open

Data race in NYdbWorkload::NLog::TLogGenerator::GenerateRandomRows #13714

iddqdex opened this issue Jan 22, 2025 · 0 comments
Assignees
Labels
area/cli CLI related issues QA

Comments

@iddqdex
Copy link
Collaborator

iddqdex commented Jan 22, 2025

[Прогон] (https://github.com/ydb-platform/ydb/actions/runs/12897511712), tsan ydb/tests/stress/log/tests/test_workload.py.TestYdbLogWorkload*

std::normal_distribution не threadsafe:

WARNING: ThreadSanitizer: data race (pid=118499)
  Write of size 8 at 0x7284000042f8 by thread T46:
    #0 double std::__y1::normal_distribution<double>::operator()<std::__y1::mersenne_twister_engine<unsigned long, 32ul, 624ul, 397ul, 31ul, 2567483615ul, 11ul, 4294967295ul, 7ul, 2636928640ul, 15ul, 4022730752ul, 18ul, 1812433253ul>>(std::__y1::mersenne_twister_engine<unsigned long, 32ul, 624ul, 397ul, 31ul, 2567483615ul, 11ul, 4294967295ul, 7ul, 2636928640ul, 15ul, 4022730752ul, 18ul, 1812433253ul>&, std::__y1::normal_distribution<double>::param_type const&) <null> (ydb+0x4f97361) (BuildId: d002af9c05c6e8d7c5d83bb8d99a2fd29bb57318)
    #1 NYdbWorkload::NLog::TLogGenerator::GenerateRandomRows() <null> (ydb+0x4f8f447) (BuildId: d002af9c05c6e8d7c5d83bb8d99a2fd29bb57318)
    #2 NYdbWorkload::NLog::TLogGenerator::GetWorkload(int) <null> (ydb+0x4f8f061) (BuildId: d002af9c05c6e8d7c5d83bb8d99a2fd29bb57318)
    #3 NYdb::NConsoleClient::TWorkloadCommand::WorkerFn(int, NYdbWorkload::IWorkloadQueryGenerator&, int) <null> (ydb+0x811dd04) (BuildId: d002af9c05c6e8d7c5d83bb8d99a2fd29bb57318)
    #4 <null> <null> (ydb+0x812770e) (BuildId: d002af9c05c6e8d7c5d83bb8d99a2fd29bb57318)
    #5 <null> <null> (ydb+0x81733f3) (BuildId: d002af9c05c6e8d7c5d83bb8d99a2fd29bb57318)
    #6 <null> <null> (ydb+0x817452d) (BuildId: d002af9c05c6e8d7c5d83bb8d99a2fd29bb57318)
    #7 NPar::TLocalExecutor::TImpl::HostWorkerThread(void*) <null> (ydb+0x816ed5f) (BuildId: d002af9c05c6e8d7c5d83bb8d99a2fd29bb57318)
    #8 <null> <null> (ydb+0x377cb0c) (BuildId: d002af9c05c6e8d7c5d83bb8d99a2fd29bb57318)
    #9 <null> <null> (ydb+0x353a1be) (BuildId: d002af9c05c6e8d7c5d83bb8d99a2fd29bb57318)

  Previous write of size 8 at 0x7284000042f8 by thread T45:
    #0 double std::__y1::normal_distribution<double>::operator()<std::__y1::mersenne_twister_engine<unsigned long, 32ul, 624ul, 397ul, 31ul, 2567483615ul, 11ul, 4294967295ul, 7ul, 2636928640ul, 15ul, 4022730752ul, 18ul, 1812433253ul>>(std::__y1::mersenne_twister_engine<unsigned long, 32ul, 624ul, 397ul, 31ul, 2567483615ul, 11ul, 4294967295ul, 7ul, 2636928640ul, 15ul, 4022730752ul, 18ul, 1812433253ul>&, std::__y1::normal_distribution<double>::param_type const&) <null> (ydb+0x4f97235) (BuildId: d002af9c05c6e8d7c5d83bb8d99a2fd29bb57318)
    #1 NYdbWorkload::NLog::TLogGenerator::GenerateRandomRows() <null> (ydb+0x4f8f447) (BuildId: d002af9c05c6e8d7c5d83bb8d99a2fd29bb57318)
    #2 NYdbWorkload::NLog::TLogGenerator::GetWorkload(int) <null> (ydb+0x4f8f061) (BuildId: d002af9c05c6e8d7c5d83bb8d99a2fd29bb57318)
    #3 NYdb::NConsoleClient::TWorkloadCommand::WorkerFn(int, NYdbWorkload::IWorkloadQueryGenerator&, int) <null> (ydb+0x811dd04) (BuildId: d002af9c05c6e8d7c5d83bb8d99a2fd29bb57318)
    #4 <null> <null> (ydb+0x812770e) (BuildId: d002af9c05c6e8d7c5d83bb8d99a2fd29bb57318)
    #5 <null> <null> (ydb+0x81733f3) (BuildId: d002af9c05c6e8d7c5d83bb8d99a2fd29bb57318)
    #6 <null> <null> (ydb+0x817452d) (BuildId: d002af9c05c6e8d7c5d83bb8d99a2fd29bb57318)
    #7 NPar::TLocalExecutor::TImpl::HostWorkerThread(void*) <null> (ydb+0x816ed5f) (BuildId: d002af9c05c6e8d7c5d83bb8d99a2fd29bb57318)
    #8 <null> <null> (ydb+0x377cb0c) (BuildId: d002af9c05c6e8d7c5d83bb8d99a2fd29bb57318)
    #9 <null> <null> (ydb+0x353a1be) (BuildId: d002af9c05c6e8d7c5d83bb8d99a2fd29bb57318)

  Location is heap block of size 5032 at 0x728400003c00 allocated by main thread:
    #0 operator new(unsigned long) <null> (ydb+0x35ba4b7) (BuildId: d002af9c05c6e8d7c5d83bb8d99a2fd29bb57318)
    #1 NYdbWorkload::NLog::TLogWorkloadParams::CreateGenerator() const <null> (ydb+0x4f95222) (BuildId: d002af9c05c6e8d7c5d83bb8d99a2fd29bb57318)
    #2 NYdb::NConsoleClient::TWorkloadCommandRun::Run(NYdb::NConsoleClient::TClientCommand::TConfig&) <null> (ydb+0x8120a4c) (BuildId: d002af9c05c6e8d7c5d83bb8d99a2fd29bb57318)
    #3 NYdb::NConsoleClient::TClientCommand::ValidateAndRun(NYdb::NConsoleClient::TClientCommand::TConfig&) <null> (ydb+0x50c26e1) (BuildId: d002af9c05c6e8d7c5d83bb8d99a2fd29bb57318)
    #4 NYdb::NConsoleClient::TClientCommandTree::Run(NYdb::NConsoleClient::TClientCommand::TConfig&) <null> (ydb+0x50c526b) (BuildId: d002af9c05c6e8d7c5d83bb8d99a2fd29bb57318)
    #5 NYdb::NConsoleClient::TClientCommand::ValidateAndRun(NYdb::NConsoleClient::TClientCommand::TConfig&) <null> (ydb+0x50c26e1) (BuildId: d002af9c05c6e8d7c5d83bb8d99a2fd29bb57318)
    #6 NYdb::NConsoleClient::TClientCommandTree::Run(NYdb::NConsoleClient::TClientCommand::TConfig&) <null> (ydb+0x50c526b) (BuildId: d002af9c05c6e8d7c5d83bb8d99a2fd29bb57318)
    #7 NYdb::NConsoleClient::TClientCommand::ValidateAndRun(NYdb::NConsoleClient::TClientCommand::TConfig&) <null> (ydb+0x50c26e1) (BuildId: d002af9c05c6e8d7c5d83bb8d99a2fd29bb57318)
    #8 NYdb::NConsoleClient::TClientCommandTree::Run(NYdb::NConsoleClient::TClientCommand::TConfig&) <null> (ydb+0x50c526b) (BuildId: d002af9c05c6e8d7c5d83bb8d99a2fd29bb57318)
    #9 NYdb::NConsoleClient::TClientCommand::ValidateAndRun(NYdb::NConsoleClient::TClientCommand::TConfig&) <null> (ydb+0x50c26e1) (BuildId: d002af9c05c6e8d7c5d83bb8d99a2fd29bb57318)
    #10 NYdb::NConsoleClient::TClientCommandTree::Run(NYdb::NConsoleClient::TClientCommand::TConfig&) <null> (ydb+0x50c526b) (BuildId: d002af9c05c6e8d7c5d83bb8d99a2fd29bb57318)
    #11 NYdb::NConsoleClient::TClientCommandRootCommon::Run(NYdb::NConsoleClient::TClientCommand::TConfig&) <null> (ydb+0x50ae1ec) (BuildId: d002af9c05c6e8d7c5d83bb8d99a2fd29bb57318)
    #12 NYdb::NConsoleClient::TYCloudClientCommandRoot::Run(NYdb::NConsoleClient::TClientCommand::TConfig&) <null> (ydb+0x509b8bf) (BuildId: d002af9c05c6e8d7c5d83bb8d99a2fd29bb57318)
    #13 NYdb::NConsoleClient::TClientCommand::ValidateAndRun(NYdb::NConsoleClient::TClientCommand::TConfig&) <null> (ydb+0x50c26e1) (BuildId: d002af9c05c6e8d7c5d83bb8d99a2fd29bb57318)
    #14 NYdb::NConsoleClient::TClientCommand::Process(NYdb::NConsoleClient::TClientCommand::TConfig&) <null> (ydb+0x50c1e3d) (BuildId: d002af9c05c6e8d7c5d83bb8d99a2fd29bb57318)
    #15 NYdb::NConsoleClient::NewYCloudClient(int, char**) <null> (ydb+0x509bcae) (BuildId: d002af9c05c6e8d7c5d83bb8d99a2fd29bb57318)
    #16 main <null> (ydb+0x3517530) (BuildId: d002af9c05c6e8d7c5d83bb8d99a2fd29bb57318)

  Thread T46 'ParLocalExecuto' (tid=118546, running) created by main thread at:
    #0 pthread_create <null> (ydb+0x353a25b) (BuildId: d002af9c05c6e8d7c5d83bb8d99a2fd29bb57318)
    #1 TThread::Start() <null> (ydb+0x377bc39) (BuildId: d002af9c05c6e8d7c5d83bb8d99a2fd29bb57318)
    #2 NPar::TLocalExecutor::RunAdditionalThreads(int) <null> (ydb+0x816f496) (BuildId: d002af9c05c6e8d7c5d83bb8d99a2fd29bb57318)
    #3 NYdb::NConsoleClient::TWorkloadCommand::RunWorkload(NYdbWorkload::IWorkloadQueryGenerator&, int) <null> (ydb+0x811f476) (BuildId: d002af9c05c6e8d7c5d83bb8d99a2fd29bb57318)
    #4 NYdb::NConsoleClient::TWorkloadCommandRun::Run(NYdb::NConsoleClient::TClientCommand::TConfig&) <null> (ydb+0x8120a76) (BuildId: d002af9c05c6e8d7c5d83bb8d99a2fd29bb57318)
    #5 NYdb::NConsoleClient::TClientCommand::ValidateAndRun(NYdb::NConsoleClient::TClientCommand::TConfig&) <null> (ydb+0x50c26e1) (BuildId: d002af9c05c6e8d7c5d83bb8d99a2fd29bb57318)
    #6 NYdb::NConsoleClient::TClientCommandTree::Run(NYdb::NConsoleClient::TClientCommand::TConfig&) <null> (ydb+0x50c526b) (BuildId: d002af9c05c6e8d7c5d83bb8d99a2fd29bb57318)
    #7 NYdb::NConsoleClient::TClientCommand::ValidateAndRun(NYdb::NConsoleClient::TClientCommand::TConfig&) <null> (ydb+0x50c26e1) (BuildId: d002af9c05c6e8d7c5d83bb8d99a2fd29bb57318)
    #8 NYdb::NConsoleClient::TClientCommandTree::Run(NYdb::NConsoleClient::TClientCommand::TConfig&) <null> (ydb+0x50c526b) (BuildId: d002af9c05c6e8d7c5d83bb8d99a2fd29bb57318)
    #9 NYdb::NConsoleClient::TClientCommand::ValidateAndRun(NYdb::NConsoleClient::TClientCommand::TConfig&) <null> (ydb+0x50c26e1) (BuildId: d002af9c05c6e8d7c5d83bb8d99a2fd29bb57318)
    #10 NYdb::NConsoleClient::TClientCommandTree::Run(NYdb::NConsoleClient::TClientCommand::TConfig&) <null> (ydb+0x50c526b) (BuildId: d002af9c05c6e8d7c5d83bb8d99a2fd29bb57318)
    #11 NYdb::NConsoleClient::TClientCommand::ValidateAndRun(NYdb::NConsoleClient::TClientCommand::TConfig&) <null> (ydb+0x50c26e1) (BuildId: d002af9c05c6e8d7c5d83bb8d99a2fd29bb57318)
    #12 NYdb::NConsoleClient::TClientCommandTree::Run(NYdb::NConsoleClient::TClientCommand::TConfig&) <null> (ydb+0x50c526b) (BuildId: d002af9c05c6e8d7c5d83bb8d99a2fd29bb57318)
    #13 NYdb::NConsoleClient::TClientCommandRootCommon::Run(NYdb::NConsoleClient::TClientCommand::TConfig&) <null> (ydb+0x50ae1ec) (BuildId: d002af9c05c6e8d7c5d83bb8d99a2fd29bb57318)
    #14 NYdb::NConsoleClient::TYCloudClientCommandRoot::Run(NYdb::NConsoleClient::TClientCommand::TConfig&) <null> (ydb+0x509b8bf) (BuildId: d002af9c05c6e8d7c5d83bb8d99a2fd29bb57318)
    #15 NYdb::NConsoleClient::TClientCommand::ValidateAndRun(NYdb::NConsoleClient::TClientCommand::TConfig&) <null> (ydb+0x50c26e1) (BuildId: d002af9c05c6e8d7c5d83bb8d99a2fd29bb57318)
    #16 NYdb::NConsoleClient::TClientCommand::Process(NYdb::NConsoleClient::TClientCommand::TConfig&) <null> (ydb+0x50c1e3d) (BuildId: d002af9c05c6e8d7c5d83bb8d99a2fd29bb57318)
    #17 NYdb::NConsoleClient::NewYCloudClient(int, char**) <null> (ydb+0x509bcae) (BuildId: d002af9c05c6e8d7c5d83bb8d99a2fd29bb57318)
    #18 main <null> (ydb+0x3517530) (BuildId: d002af9c05c6e8d7c5d83bb8d99a2fd29bb57318)

  Thread T45 'ParLocalExecuto' (tid=118545, running) created by main thread at:
    #0 pthread_create <null> (ydb+0x353a25b) (BuildId: d002af9c05c6e8d7c5d83bb8d99a2fd29bb57318)
    #1 TThread::Start() <null> (ydb+0x377bc39) (BuildId: d002af9c05c6e8d7c5d83bb8d99a2fd29bb57318)
    #2 NPar::TLocalExecutor::RunAdditionalThreads(int) <null> (ydb+0x816f496) (BuildId: d002af9c05c6e8d7c5d83bb8d99a2fd29bb57318)
    #3 NYdb::NConsoleClient::TWorkloadCommand::RunWorkload(NYdbWorkload::IWorkloadQueryGenerator&, int) <null> (ydb+0x811f476) (BuildId: d002af9c05c6e8d7c5d83bb8d99a2fd29bb57318)
    #4 NYdb::NConsoleClient::TWorkloadCommandRun::Run(NYdb::NConsoleClient::TClientCommand::TConfig&) <null> (ydb+0x8120a76) (BuildId: d002af9c05c6e8d7c5d83bb8d99a2fd29bb57318)
    #5 NYdb::NConsoleClient::TClientCommand::ValidateAndRun(NYdb::NConsoleClient::TClientCommand::TConfig&) <null> (ydb+0x50c26e1) (BuildId: d002af9c05c6e8d7c5d83bb8d99a2fd29bb57318)
    #6 NYdb::NConsoleClient::TClientCommandTree::Run(NYdb::NConsoleClient::TClientCommand::TConfig&) <null> (ydb+0x50c526b) (BuildId: d002af9c05c6e8d7c5d83bb8d99a2fd29bb57318)
    #7 NYdb::NConsoleClient::TClientCommand::ValidateAndRun(NYdb::NConsoleClient::TClientCommand::TConfig&) <null> (ydb+0x50c26e1) (BuildId: d002af9c05c6e8d7c5d83bb8d99a2fd29bb57318)
    #8 NYdb::NConsoleClient::TClientCommandTree::Run(NYdb::NConsoleClient::TClientCommand::TConfig&) <null> (ydb+0x50c526b) (BuildId: d002af9c05c6e8d7c5d83bb8d99a2fd29bb57318)
    #9 NYdb::NConsoleClient::TClientCommand::ValidateAndRun(NYdb::NConsoleClient::TClientCommand::TConfig&) <null> (ydb+0x50c26e1) (BuildId: d002af9c05c6e8d7c5d83bb8d99a2fd29bb57318)
    #10 NYdb::NConsoleClient::TClientCommandTree::Run(NYdb::NConsoleClient::TClientCommand::TConfig&) <null> (ydb+0x50c526b) (BuildId: d002af9c05c6e8d7c5d83bb8d99a2fd29bb57318)
    #11 NYdb::NConsoleClient::TClientCommand::ValidateAndRun(NYdb::NConsoleClient::TClientCommand::TConfig&) <null> (ydb+0x50c26e1) (BuildId: d002af9c05c6e8d7c5d83bb8d99a2fd29bb57318)
    #12 NYdb::NConsoleClient::TClientCommandTree::Run(NYdb::NConsoleClient::TClientCommand::TConfig&) <null> (ydb+0x50c526b) (BuildId: d002af9c05c6e8d7c5d83bb8d99a2fd29bb57318)
    #13 NYdb::NConsoleClient::TClientCommandRootCommon::Run(NYdb::NConsoleClient::TClientCommand::TConfig&) <null> (ydb+0x50ae1ec) (BuildId: d002af9c05c6e8d7c5d83bb8d99a2fd29bb57318)
    #14 NYdb::NConsoleClient::TYCloudClientCommandRoot::Run(NYdb::NConsoleClient::TClientCommand::TConfig&) <null> (ydb+0x509b8bf) (BuildId: d002af9c05c6e8d7c5d83bb8d99a2fd29bb57318)
    #15 NYdb::NConsoleClient::TClientCommand::ValidateAndRun(NYdb::NConsoleClient::TClientCommand::TConfig&) <null> (ydb+0x50c26e1) (BuildId: d002af9c05c6e8d7c5d83bb8d99a2fd29bb57318)
    #16 NYdb::NConsoleClient::TClientCommand::Process(NYdb::NConsoleClient::TClientCommand::TConfig&) <null> (ydb+0x50c1e3d) (BuildId: d002af9c05c6e8d7c5d83bb8d99a2fd29bb57318)
    #17 NYdb::NConsoleClient::NewYCloudClient(int, char**) <null> (ydb+0x509bcae) (BuildId: d002af9c05c6e8d7c5d83bb8d99a2fd29bb57318)
    #18 main <null> (ydb+0x3517530) (BuildId: d002af9c05c6e8d7c5d83bb8d99a2fd29bb57318)

SUMMARY: ThreadSanitizer: data race (/home/runner/.ya/build/build_root/7cil/000015/ydb/apps/ydb/ydb+0x4f97361) (BuildId: d002af9c05c6e8d7c5d83bb8d99a2fd29bb57318) in double std::__y1::normal_distribution<double>::operator()<std::__y1::mersenne_twister_engine<unsigned long, 32ul, 624ul, 397ul, 31ul, 2567483615ul, 11ul, 4294967295ul, 7ul, 2636928640ul, 15ul, 4022730752ul, 18ul, 1812433253ul>>(std::__y1::mersenne_twister_engine<unsigned long, 32ul, 624ul, 397ul, 31ul, 2567483615ul, 11ul, 4294967295ul, 7ul, 2636928640ul, 15ul, 4022730752ul, 18ul, 1812433253ul>&, std::__y1::normal_distribution<double>::param_type const&)
==================
@iddqdex iddqdex added area/cli CLI related issues QA labels Jan 22, 2025
iddqdex added a commit to iddqdex/ydb that referenced this issue Jan 23, 2025
@maximyurchuk maximyurchuk assigned iddqdex and unassigned maximyurchuk Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/cli CLI related issues QA
Projects
None yet
Development

No branches or pull requests

2 participants