Subject: bug#69748: Does diff not work on big enough files?

From: Robert Boyer <[email-masked]>
Date: Tue, 12 Mar 2024 10:17:35 -0500

I am not sure whether to call this a bug, but it is a difficulty for me.
It is simply incredible to me that diff might not work!
If one cannot count on diff to work, is there anything one can count on? Does
diff just not work on big enough files? Apparently yes.

> diff the-primes-below-10000000000.lisp billion-primes.txt
diff: the-primes-below-10000000000.lisp: Cannot allocate memory
> ls -l the-primes-below-10000000000.lisp billion-primes.txt
-rw-r----- 1 bob chronos-access  501959790 Mar 10 14:08 billion-primes.txt
-rw-r----- 1 bob chronos-access 5403267048 Mar 12 09:55
the-primes-below-10000000000.lisp

> free
               total        used        free      shared  buff/cache
available
Mem:         6736088     1458180     5060628       16568      217280
5277908
Swap:              0           0           0

I am running on a $300 Lenovo Chromebook using their default Gnu Linux.

Bob

> cat /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 156
model name : Intel(R) Celeron(R) N4500 @ 1.10GHz
stepping : 0
microcode : 0x1
cpu MHz : 1113.600
cache size : 4096 KB
physical id : 0
siblings : 2
core id : 0
cpu cores : 2
apicid : 0
initial apicid : 0
fpu : yes
fpu_exception : yes
cpuid level : 27
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat
pse36 clflush mmx fxsr sse sse2 ss ht syscall nx rdtscp lm constant_tsc
arch_perfmon rep_good nopl xtopology nonstop_tsc cpuid tsc_known_freq pni
pclmulqdq vmx ssse3 cx16 sse4_1 sse4_2 x2apic movbe popcnt
tsc_deadline_timer aes xsave rdrand hypervisor lahf_lm 3dnowprefetch
cpuid_fault ssbd ibrs ibpb stibp ibrs_enhanced tpr_shadow vnmi flexpriority
ept vpid ept_ad fsgsbase tsc_adjust smep erms rdseed smap clflushopt clwb
sha_ni xsaveopt xsavec xgetbv1 xsaves arat umip gfni rdpid movdiri
movdir64b md_clear arch_capabilities
vmx flags : vnmi preemption_timer posted_intr invvpid ept_x_only ept_ad
ept_1gb flexpriority apicv tsc_offset vtpr mtf vapic ept vpid
unrestricted_guest vapic_reg vid shadow_vmcs pml
bugs : spectre_v1 spectre_v2 spec_store_bypass swapgs srbds mmio_stale_data
bogomips : 2227.20
clflush size : 64
cache_alignment : 64
address sizes : 39 bits physical, 48 bits virtual
power management:

processor : 1
vendor_id : GenuineIntel
cpu family : 6
model : 156
model name : Intel(R) Celeron(R) N4500 @ 1.10GHz
stepping : 0
microcode : 0x1
cpu MHz : 1113.600
cache size : 4096 KB
physical id : 0
siblings : 2
core id : 1
cpu cores : 2
apicid : 1
initial apicid : 1
fpu : yes
fpu_exception : yes
cpuid level : 27
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat
pse36 clflush mmx fxsr sse sse2 ss ht syscall nx rdtscp lm constant_tsc
arch_perfmon rep_good nopl xtopology nonstop_tsc cpuid tsc_known_freq pni
pclmulqdq vmx ssse3 cx16 sse4_1 sse4_2 x2apic movbe popcnt
tsc_deadline_timer aes xsave rdrand hypervisor lahf_lm 3dnowprefetch
cpuid_fault ssbd ibrs ibpb stibp ibrs_enhanced tpr_shadow vnmi flexpriority
ept vpid ept_ad fsgsbase tsc_adjust smep erms rdseed smap clflushopt clwb
sha_ni xsaveopt xsavec xgetbv1 xsaves arat umip gfni rdpid movdiri
movdir64b md_clear arch_capabilities
vmx flags : vnmi preemption_timer posted_intr invvpid ept_x_only ept_ad
ept_1gb flexpriority apicv tsc_offset vtpr mtf vapic ept vpid
unrestricted_guest vapic_reg vid shadow_vmcs pml
bugs : spectre_v1 spectre_v2 spec_store_bypass swapgs srbds mmio_stale_data
bogomips : 2227.20
clflush size : 64
cache_alignment : 64
address sizes : 39 bits physical, 48 bits virtual
power management: