Skip to content

There are some suspicions about threads synchronization. It seems there may be data races. #2394

@LLE8

Description

@LLE8

NTCP2.cpp

void NTCP2Session::Terminate ()

if (!m_IntermediateQueue.empty ())

Compare with similar code
std::lock_guard<std::mutex> l(m_IntermediateQueueMutex);

and
std::lock_guard<std::mutex> l(m_IntermediateQueueMutex);

UDPTunnel.cpp

1
void I2PUDPServerTunnel::Stop ()

m_Sessions.clear ();

2
void I2PUDPClientTunnel::Stop ()
m_Sessions.clear();

3
void I2PUDPClientTunnel::HandleRecvFromLocal (const boost::system::error_code & ec, std::size_t transferred)
auto itr = m_Sessions.find (remotePort);

4
void I2PUDPClientTunnel::HandleRecvFromI2PRaw (uint16_t fromPort, uint16_t toPort, const uint8_t * buf, size_t len)
auto itr = m_Sessions.find (toPort);

Compare with similar code
std::lock_guard<std::mutex> lock(m_SessionsMutex);

and
std::lock_guard<std::mutex> lock(m_SessionsMutex);

Datagram.cpp

1
DatagramDestination::~DatagramDestination ()

m_Sessions.clear();

2
void DatagramDestination::CleanUp ()
if (m_Sessions.empty ()) return;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions