Bug 15066

Summary: tail with option -c fails on large files
Product: Busybox Reporter: kurien.mathew
Component: OtherAssignee: unassigned
Status: NEW ---    
Severity: normal CC: busybox-cvs
Priority: P5    
Version: 1.34.x   
Target Milestone: ---   
Hardware: All   
OS: Linux   
Host: Target:
Build:

Description kurien.mathew 2022-10-20 04:35:57 UTC
tail from
BusyBox v1.34.1 (2022-06-06 22:12:17 UTC) multi-call binary.
when used with the "-c +<byte-offset>" option on a large file (several GB)
we encounter the error "tail: write error: Bad address". The error is sometimes fatal since retries do not always help progress the offset to EOF

For eg
user@mkd:~/test$ kubectl exec -it recorder-9f955c7d4-fjqpl -c generator -- /bin/sh -c "ls -al /data/content.tar.gz"
-rw-r--r--    1 daemon   daemon   2969605492 Oct 20 00:45 /data/content.tar.gz
user@mkd:~/test$ kubectl exec recorder-9f955c7d4-fjqpl -c generator -- /usr/bin/tail -c +2963709953 /data/content.tar.gz
tail: write error: Bad address
command terminated with exit code 1