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

[18001] FastDDS crashes when encapsulation kind of serialized data is unknown #3422

Closed
1 task done
squizz617 opened this issue Mar 31, 2023 · 1 comment · Fixed by #3528
Closed
1 task done

[18001] FastDDS crashes when encapsulation kind of serialized data is unknown #3422

squizz617 opened this issue Mar 31, 2023 · 1 comment · Fixed by #3528
Labels
bug Issue to report a bug

Comments

@squizz617
Copy link
Contributor

squizz617 commented Mar 31, 2023

Is there an already existing issue for this?

  • I have searched the existing issues

Expected behavior

FastDDS should gracefully handle an unknown encapsulation kind.

Current behavior

FastDDS crashes (abort) - Unexpected CDR type received:

$ ./DDSSecureHelloWorldExample subscriber
Starting
Waiting for Data, press Enter to stop the DataReader.
Subscriber matched.
terminate called after throwing an instance of 'eprosima::fastcdr::exception::BadParamException'
  what():  Unexpected CDR type received in Cdr::read_encapsulation
[1]    1931236 abort      ./DDSSecureHelloWorldExample subscriber

Steps to reproduce

  1. Run a subscriber process
  2. My endpoint goes through PDP and EDP with the subscriber
  3. When writers/readers and topic are matched, my endpoint sends the following DATA submessage to the matched subscriber:
submessageId: DATA (0x15)
    Flags: 0x05, Data present, Endianness bit
    octetsToNextHeader: 48
    0000 0000 0000 0000 = Extra flags: 0x0000
    Octets to inline QoS: 16
    readerEntityId: 0x00000104 (Application-defined reader (no key): 0x000001)
    writerEntityId: 0x00000103 (Application-defined writer (no key): 0x000001)
    [Topic Information (from Discovery)]
    writerSeqNumber: 1
    serializedData
        encapsulation kind: Unknown (0x00ff)
        encapsulation options: 0x0000
        serializedData: 000000000d0000004d65737361676520697320310000000

Note: encapsulation kind is 0xff (should have been 0x01).

Please refer to the attached tcpdump fastdds-assert.pcap.zip for further details. Packet 358 triggers this.

Fast DDS version/commit

v2.9.1

Platform/Architecture

Ubuntu Focal 20.04 amd64

Transport layer

UDPv4

Additional context

No response

XML configuration file

No response

Relevant log output

No response

Network traffic capture

No response

@squizz617 squizz617 added the triage Issue pending classification label Mar 31, 2023
@jsan-rt jsan-rt removed the triage Issue pending classification label Apr 5, 2023
@JLBuenoLopez JLBuenoLopez added the bug Issue to report a bug label Apr 11, 2023
@JLBuenoLopez
Copy link
Contributor

Hi @squizz617,

Fast CDR read_encapsulation method is documented to throw besides NotEnoughMemoryException, also BadParamException. The code generated by Fast DDS-Gen only captures the first exception so I am opening a ticket also in that repository. But Fast DDS also calls this method without capturing every exception (here for instace). Instead of capturing a specific Fast CDR exception, any exception should be captured as it is done here.

@MiguelCompany MiguelCompany changed the title FastDDS crashes when encapsulation kind of serialized data is unknown [18001] FastDDS crashes when encapsulation kind of serialized data is unknown May 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue to report a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants