Skip to content

[BUG] fd numbers also truncated in -F fd *output for other programs* #311

@stephane-chazelas

Description

@stephane-chazelas

Describe the bug

I can (sort of) understand the truncation of the fd number (and asterisk alerting about it) in:

$ bash -c 'ulimit -n 20000; exec 12345<> /dev/null; lsof -w -ap "$$" /dev/null; exit'
COMMAND  PID     USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
bash    9385 chazelas *345u   CHR    1,3      0t0    5 /dev/null

Where the FD column has a fixed limited width that hadn't accounted for fds one day possibly be greater than 999 decades ago

But IMO, it doesn't make sense in the output for other programs where there's no reason for the width to be limited:

$ bash -c 'ulimit -n 20000; exec 12345<> /dev/null; lsof -w -F fd -ap "$$" /dev/null; exit'
p9431
f*345

Expected:

$ bash -c 'ulimit -n 20000; exec 12345<> /dev/null; lsof -w -F fd -ap "$$" /dev/null; exit'
p9431
f12345

(reproduced with lsof from Ubuntu 22.04 and current git HEAD (e30113e)).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions