Is there an already existing issue for this?
Expected behavior
TimedEvent should accept any positive double interval, including values representing "no deadline" (i.e., effectively infinite). Passing std::numeric_limits<double>::max() as a timer interval should result in an extremely large — but well-defined — timer period, without invoking undefined behavior. The conversion from milliseconds to microseconds should be guarded against floating-point overflow before casting to int64_t.
Current behavior
Every DataWriter creation triggers a UBSan runtime error:
runtime error: inf is outside the range of representable values of type 'long'
DataWriterImpl::configure_deadline_timer_() unconditionally passes DBL_MAX to the TimedEvent constructor. Inside the constructor, DBL_MAX * 1000 overflows to inf, and the subsequent static_cast<int64_t>(inf) is undefined behavior per C++17.
Steps to reproduce
- Build Fast-DDS v3.5.0 with
-fsanitize=undefined (UBSan)
- Start a
DomainParticipant and Publisher
- Create any
DataWriter with default QoS — the UBSan error fires immediately during DataWriterImpl::enable()
Fast DDS version/commit
v3.5.0 (tag v3.5.0, branch master)
Fast-CDR v2.3.5
Platform/Architecture
Ubuntu Focal 20.04 amd64
Transport layer
UDPv4
Additional context
No response
XML configuration file
Relevant log output
Network traffic capture
No response
Is there an already existing issue for this?
Expected behavior
TimedEventshould accept any positivedoubleinterval, including values representing "no deadline" (i.e., effectively infinite). Passingstd::numeric_limits<double>::max()as a timer interval should result in an extremely large — but well-defined — timer period, without invoking undefined behavior. The conversion from milliseconds to microseconds should be guarded against floating-point overflow before casting toint64_t.Current behavior
Every
DataWritercreation triggers a UBSan runtime error:DataWriterImpl::configure_deadline_timer_()unconditionally passesDBL_MAXto theTimedEventconstructor. Inside the constructor,DBL_MAX * 1000overflows toinf, and the subsequentstatic_cast<int64_t>(inf)is undefined behavior per C++17.Steps to reproduce
-fsanitize=undefined(UBSan)DomainParticipantandPublisherDataWriterwith default QoS — the UBSan error fires immediately duringDataWriterImpl::enable()Fast DDS version/commit
v3.5.0 (tag
v3.5.0, branchmaster)Fast-CDR v2.3.5
Platform/Architecture
Ubuntu Focal 20.04 amd64
Transport layer
UDPv4
Additional context
No response
XML configuration file
Relevant log output
Network traffic capture
No response