Skip to content

[BUG] PR #15931 breaks ttyACM #16004

@jlaitine

Description

@jlaitine

Description / Steps to reproduce the issue

After PR #15931 , I am experiencing USB crashes in the following use case:

  1. Have ttyACM serial connection open between the PC and NuttX device (MPFS 64-bit risc-v)
  2. Continuously send data from PC to the device, and from device to PC
  3. Pull the USB plug

Result:
[CPU0] riscv_exception: EXCEPTION: Load access fault. MCAUSE: 0000000000000005, EPC: 00000000a003490a, MTVAL: 000000014065b788
[CPU0] riscv_exception: PANIC!!! Exception = 0000000000000005
[CPU0] dump_assert_info: Current Version: NuttX 10.4.0 fa125d9 Mar 17 2025 14:27:35 risc-v

Reverting commit c497c5f fixes the issue

Here is some further info:

  • priv->nwrq increases uncontrollably after the USB has been disconnected. Also before disconnecting, it grows beyond CONFIG_CDCACM_NWRREQS
  • priv->nwrq increase causes also debugassert at cdcacm_unbind, if unbinding the connection
  • priv->txfree gets corrupted in cdcacm_sndpacket, here the EP_SUBMIT(ep, req); will cause a call to cdcacm_wrcomplete, which keeps adding the same wrcontainer to the txfree.

The issue is seen in SMP, single-core and in CONFIG_BUILD_KERNEL and in CONFIG_BUILD_FLAT

On which OS does this issue occur?

[OS: Linux]

What is the version of your OS?

Ubuntu 22.04

NuttX Version

master

Issue Architecture

[Arch: risc-v]

Issue Area

[Area: Drivers]

Host information

No response

Verification

  • I have verified before submitting the report.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Arch: risc-vIssues related to the RISC-V (32-bit or 64-bit) architectureArea: DriversDrivers issuesOS: LinuxIssues related to Linux (building system, etc)Type: BugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions