Closed fancsali closed 2 years ago
I can reproduce it on arm/i686, but not on aarch64/x86_64.
I can reproduce it on arm/i686, but not on aarch64/x86_64.
Had a look myself, and sounds about right.
Haven't had a chance to try it on architectures other than ARM, though.
I believe this has the same root cause as #9056 (which is in fact not resolved but just worked around), suspecting a bug in Gnulib.
I believe this has the same root cause as #9056 (which is in fact not resolved but just worked around), suspecting a bug in Gnulib.
Not sure what that means in this context: so how do we mitigate this?
I think I have finally found the bug in Gnulib:
--- a/lib/stdio-impl.h
+++ b/lib/stdio-impl.h
@@ -68,8 +68,10 @@
# elif defined __ANDROID__ /* Android */
# ifdef __LP64__
# define _gl_flags_file_t int
+# define _gl_struct_file_off_t int64_t
# else
# define _gl_flags_file_t short
+# define _gl_struct_file_off_t __kernel_off_t
# endif
/* Up to this commit from 2015-10-12
<https://android.googlesource.com/platform/bionic.git/+/f0141dfab10a4b332769d52fa76631a64741297a>
@@ -96,7 +98,7 @@
unsigned char _nbuf[1]; \
struct { unsigned char *_base; size_t _size; } _lb; \
int _blksize; \
- fpos_t _offset; \
+ _gl_struct_file_off_t _offset; \
/* More fields, not relevant here. */ \
} *) fp)
# else
@xtkoba thanks for investigating and fixing the core issue! Do you want to report it to the gnulib developers? Otherwise I can do it, would be nice to get the fix upstream
Problem description
Calling cksum from the coreutils package seems to try to call write() twice emitting the expected output but then also an error message and a non 0 return code.
What steps will reproduce the bug?
Pipe any file to cksum:
What is the expected behavior?
The call should only return the sum and the file size and no error message/code:
Further information
Calling the
busybox
version of the tool works fine:Also, the version numbers of the packages in question:
System information
termux-info: