uutils / uutils/coreutils

bug(ptx): using /dev/nvme-fabrics will leads to corrupted outputs

Open
#13,031 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

U - ptx
Dominant language
Rust
Stars
24.1k
Forks
2k
Avg merge
1d 5h
Merged PRs (30d)
365

Description

Hi, uutils mainteners

we found another yet issue, when using /dev/nvme-fabrics, as on our test confirmed

relunsec@relunsec:~/software/coreutils/target/debug$ sudo ./ptx /dev/nvme-fabrics 
                        instance=-1,   cntlid/
                                    /   concat,recovery_delay=%d
                                    /   ctrl_loss_tmo/
                                    /   d/
                                    /   d/
                                    /   d/
                                    /   d/
                                    /   d/
                                    /   d/
                                    /   d/
                                    /   d/
                                    /   d/
                                    /   d/
                                    /   d/
                                    /   d
                                    /   data_digest/
                                    /   dhchap_ctrl_secret/
                                    /   dhchap_secret/
                                    /   disable_sqflow/
                                    /   discovery/
                                    /   duplicate_connect/
                                    /   fast_io_fail_tmo/
                                    /   hdr_digest/
                                    /   host_iface/
                                    /   host_traddr/
                                    /   hostid/
                                    /   hostnqn/
                                       instance/
                                    /   keep_alive_tmo/
                                    /   keyring/
                                    /   nqn/
                                    /   nr_io_queues/
                                    /   nr_poll_queues/
                                    /   nr_write_queues/
                                    /   queue_size/
                                    /   reconnect_delay/
                                    /   recovery_delay=%d
   instance=-1,cntlid=-1,transport=%   s/
                                    /   s/
                                    /   s/
                                    /   s/
                                    /   s/
                                    /   s/
                                    /   s/
                                    /   s/
                                    /   s/
                                    /   s,tls,concat,recovery_delay=%d
                                    /   tls,concat,recovery_delay=%d
                                    /   tls_key/
                                    /   tos/
                                    /   traddr/
              instance=-1,cntlid=-1,   transport/
                                    /   trsvcid/
relunsec@relunsec:~/software/coreutils/target/debug$ 

vs

relunsec@relunsec:~/software/coreutils/target/debug$ sudo gnuptx /dev/nvme-fabrics 
     delay=%d,ctrl_loss_tmo=%d,keep_   alive_tmo=%d,hostnqn=%s,host_/    /_
   trsvcid=%s,nqn=/     instance=-1,   cntlid=-1,transport=%s,traddr=%s,
      =%s,dhchap_ctrl_secret=%s,tls,   concat,recovery_delay=%d    /_secret
     /_iface=%s,hostid=%s,duplicate_   connect,disable_sqflow,hdr_digest,/
     /_queues=%d,reconnect_delay=%d,   ctrl_loss_tmo=%d,keep_alive_tmo=%d/
   _/     /,dhchap_secret=%s,dhchap_   ctrl_secret=%s,tls,concat,recovery
    /,trsvcid=%s,nqn=%s,queue_size=%   d,nr_io_queues=%d,reconnect_delay=/
    /%s,queue_size=%d,nr_io_queues=%   d,reconnect_delay=%d,ctrl_loss_tmo/
    /_io_queues=%d,reconnect_delay=%   d,ctrl_loss_tmo=%d,keep_alive_tmo=/
          /_delay=%d,ctrl_loss_tmo=%   d,keep_alive_tmo=%d,hostnqn=%s,/
      /_loss_tmo=%d,keep_alive_tmo=%   d,hostnqn=%s,host_traddr=%s,host_/
     /,data_digest,nr_write_queues=%   d,nr_poll_queues=%d,tos=%d,keyring/
        /_queues=%d,nr_poll_queues=%   d,tos=%d,keyring=%d,tls_key=%d,/
        /=%d,nr_poll_queues=%d,tos=%   d,keyring=%d,tls_key=%d,fast_io_/
    /poll_queues=%d,tos=%d,keyring=%   d,tls_key=%d,fast_io_fail_tmo=%d,/
    /=%d,tos=%d,keyring=%d,tls_key=%   d,fast_io_fail_tmo=%d,discovery,/
     d,tls_key=%d,fast_io_fail_tmo=%   d,discovery,dhchap_secret=%s,/   /=%
     =%s,tls,concat,recovery_delay=%   d                      /_ctrl_secret
        /,disable_sqflow,hdr_digest,   data_digest,nr_write_queues=%d,nr_/
     /=%d,nr_io_queues=%d,reconnect_   delay=%d,ctrl_loss_tmo=%d,keep_/
     _secret=%s,tls,concat,recovery_   delay=%d              /s,dhchap_ctrl
     ,fast_io_fail_tmo=%d,discovery,   dhchap_secret=%s,dhchap_ctrl_/   /%d
    /=%d,discovery,dhchap_secret=%s,   dhchap_ctrl_secret=%s,tls,concat,/
       /_connect,disable_sqflow,hdr_   digest,data_digest,nr_write_queues/
    /disable_sqflow,hdr_digest,data_   digest,nr_write_queues=%d,nr_poll_/
    /%s,hostid=%s,duplicate_connect,   disable_sqflow,hdr_digest,data_/
    /tls_key=%d,fast_io_fail_tmo=%d,   discovery,dhchap_secret=%s,dhchap_/
       /=%s,host_iface=%s,hostid=%s,   duplicate_connect,disable_sqflow,/
     ,keyring=%d,tls_key=%d,fast_io_   fail_tmo=%d,discovery,dhchap_/   /%d
     d,tos=%d,keyring=%d,tls_key=%d,   fast_io_fail_tmo=%d,discovery,/   /%
           /_connect,disable_sqflow,   hdr_digest,data_digest,nr_write_/
     d,keep_alive_tmo=%d,hostnqn=%s,   host_traddr=%s,host_iface=%s,/   /=%
     /=%d,hostnqn=%s,host_traddr=%s,   host_iface=%s,hostid=%s,duplicate_/
     s,host_traddr=%s,host_iface=%s,   hostid=%s,duplicate_connect,/    /=%
    /_loss_tmo=%d,keep_alive_tmo=%d,   hostnqn=%s,host_traddr=%s,host_/
     hostnqn=%s,host_traddr=%s,host_   iface=%s,hostid=%s,duplicate_/   /d,
   ,traddr=%s,trsvcid=%s,nqn=%/        instance=-1,cntlid=-1,transport=%s
       /=%s,nqn=%s,queue_size=%d,nr_   io_queues=%d,reconnect_delay=%d,/
    /=%d,keyring=%d,tls_key=%d,fast_   io_fail_tmo=%d,discovery,dhchap_/
        /_delay=%d,ctrl_loss_tmo=%d,   keep_alive_tmo=%d,hostnqn=%s,host_/
         /=%d,tos=%d,keyring=%d,tls_   key=%d,fast_io_fail_tmo=%d,/
      /=%d,nr_poll_queues=%d,tos=%d,   keyring=%d,tls_key=%d,fast_io_fail/
       /=%d,reconnect_delay=%d,ctrl_   loss_tmo=%d,keep_alive_tmo=%d,/
   %d/    /=%s,traddr=%s,trsvcid=%s,   nqn=%s,queue_size=%d,nr_io_queues=
   ,/     /=%s,nqn=%s,queue_size=%d,   nr_io_queues=%d,reconnect_delay=%d
    /_sqflow,hdr_digest,data_digest,   nr_write_queues=%d,nr_poll_queues=/
    /data_digest,nr_write_queues=%d,   nr_poll_queues=%d,tos=%d,keyring=%/
     /_digest,nr_write_queues=%d,nr_   poll_queues=%d,tos=%d,keyring=%d,/
     %s,traddr=%s,trsvcid=%s,nqn=%s,   queue_size=%d,nr_io_queues=%d,/   /=
    /=%s,nqn=%s,queue_size=%d,nr_io_   queues=%d,reconnect_delay=%d,ctrl_/
      /_digest,data_digest,nr_write_   queues=%d,nr_poll_queues=%d,tos=%d/
       /,nr_write_queues=%d,nr_poll_   queues=%d,tos=%d,keyring=%d,tls_/
    /,queue_size=%d,nr_io_queues=%d,   reconnect_delay=%d,ctrl_loss_tmo=%/
         _ctrl_secret=%s,tls,concat,   recovery_delay=%d        /=%s,dhchap
          /=-1,cntlid=-1,transport=%   s,traddr=%s,trsvcid=%s,nqn=%s,/
    /cntlid=-1,transport=%s,traddr=%   s,trsvcid=%s,nqn=%s,queue_size=%d,/
            /=%s,traddr=%s,trsvcid=%   s,nqn=%s,queue_size=%d,nr_io_/
     /=%s,traddr=%s,trsvcid=%s,nqn=%   s,queue_size=%d,nr_io_queues=%d,/
    /=%d,keep_alive_tmo=%d,hostnqn=%   s,host_traddr=%s,host_iface=%s,/
     tmo=%d,hostnqn=%s,host_traddr=%   s,host_iface=%s,hostid=%s,/       /_
    /=%s,host_traddr=%s,host_iface=%   s,hostid=%s,duplicate_connect,/
   ,/    /=%s,host_iface=%s,hostid=%   s,duplicate_connect,disable_sqflow
      /=%d,discovery,dhchap_secret=%   s,dhchap_ctrl_secret=%s,tls,concat/
    /_secret=%s,dhchap_ctrl_secret=%   s,tls,concat,recovery_delay=%d
     /_fail_tmo=%d,discovery,dhchap_   secret=%s,dhchap_ctrl_secret=%s,/
     /,dhchap_secret=%s,dhchap_ctrl_   secret=%s,tls,concat,recovery_/
       /=%s,trsvcid=%s,nqn=%s,queue_   size=%d,nr_io_queues=%d,reconnect_/
     /=%s,duplicate_connect,disable_   sqflow,hdr_digest,data_digest,nr_/
      /_queues=%d,tos=%d,keyring=%d,   tls_key=%d,fast_io_fail_tmo=%d,/
         /=%s,dhchap_ctrl_secret=%s,   tls,concat,recovery_delay=%d
    /d,reconnect_delay=%d,ctrl_loss_   tmo=%d,keep_alive_tmo=%d,hostnqn=%/
    /%d,ctrl_loss_tmo=%d,keep_alive_   tmo=%d,hostnqn=%s,host_traddr=%s,/
       /=%d,tls_key=%d,fast_io_fail_   tmo=%d,discovery,dhchap_secret=%s,/
      /_queues=%d,nr_poll_queues=%d,   tos=%d,keyring=%d,tls_key=%d,fast_/
        /=-1,cntlid=-1,transport=%s,   traddr=%s,trsvcid=%s,nqn=%s,queue_/
     /_alive_tmo=%d,hostnqn=%s,host_   traddr=%s,host_iface=%s,hostid=%s,/
   nqn=%/     instance=-1,cntlid=-1,   transport=%s,traddr=%s,trsvcid=%s,
        /=-1,transport=%s,traddr=%s,   trsvcid=%s,nqn=%s,queue_size=%d,nr/
        /,hdr_digest,data_digest,nr_   write_queues=%d,nr_poll_queues=%d,/

there was massive difference between the two, outputs of the uu corrupted and wrong, while the gnu one correct

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the reported difference with the ptx binary and /dev/nvme-fabrics, then compare its output with GNU ptx as shown in the issue. Trace the ptx entry point and existing tests, if present, to identify how the input is formatted. Done means the Rust implementation produces correct, non-corrupted output for this input and includes a regression check.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.