Hi,

I have several small files where grep'ing for a static string results in 'Value 
too large for defined data type'.

E.g.

$ grep 123456 2fort.bsp
grep: 2fort.bsp: Value too large for defined data type

But grep'ing for a shorter search string succeeds:

$ grep 123 2fort.bsp
grep: 2fort.bsp matches

2fort.bsp has size 2488684 bytes.

This happens on an up-to date Gentoo with kernel 4.12.12 and glibc 2.23. 
Installed grep is version 3.0.

Linux kiste 4.12.12-gentoo #1 SMP Tue Sep 19 20:07:27 CEST 2017 x86_64 Intel(R) 
Xeon(R) CPU E3-1245 v3 @ 3.40GHz
GenuineIntel GNU/Linux



For debugging I downloaded both 3.0 and 3.1 and compiled with

$ CFLAGS="${CFLAGS} -ggdb" CPPFLAGS="${CPPFLAGS} -ggdb" ./configure 
--enable-gcc-warnings
$ make

Both versions show the same failure.

I'd like to help debugging but don't know where I should start looking in the 
source code. Any hint is appreciated.

I also prepared a strace output for grep 3.1 (attached).


Regards,

        Uwe
execve("./grep", ["./grep", "AABBCCDDEEFFGGHHIIJJKK", 
"/mnt/usb/$RECYCLE.BIN/S-1-5-21-3"...], [/* 60 vars */]) = 0
brk(NULL)                               = 0x2107000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0x7fa1ae03e000
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=186395, ...}) = 0
mmap(NULL, 186395, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7fa1ae010000
close(3)                                = 0
open("/lib64/libpcre.so.1", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\240\26\0\0\0\0\0\0"..., 
832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=461024, ...}) = 0
mmap(NULL, 2556392, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 
0x7fa1adbab000
mprotect(0x7fa1adc1b000, 2093056, PROT_NONE) = 0
mmap(0x7fa1ade1a000, 8192, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x6f000) = 0x7fa1ade1a000
close(3)                                = 0
open("/lib64/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0p\7\2\0\0\0\0\0"..., 
832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=1664528, ...}) = 0
mmap(NULL, 3770584, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 
0x7fa1ad812000
mprotect(0x7fa1ad9a2000, 2093056, PROT_NONE) = 0
mmap(0x7fa1adba1000, 24576, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x18f000) = 0x7fa1adba1000
mmap(0x7fa1adba7000, 14552, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7fa1adba7000
close(3)                                = 0
open("/lib64/libpthread.so.0", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0p`\0\0\0\0\0\0"..., 832) 
= 832
fstat(3, {st_mode=S_IFREG|0755, st_size=97736, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0x7fa1ae00f000
mmap(NULL, 2208808, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 
0x7fa1ad5f6000
mprotect(0x7fa1ad60d000, 2093056, PROT_NONE) = 0
mmap(0x7fa1ad80c000, 8192, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x16000) = 0x7fa1ad80c000
mmap(0x7fa1ad80e000, 13352, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7fa1ad80e000
close(3)                                = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0x7fa1ae00e000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0x7fa1ae00d000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0x7fa1ae00c000
arch_prctl(ARCH_SET_FS, 0x7fa1ae00d700) = 0
mprotect(0x7fa1adba1000, 16384, PROT_READ) = 0
mprotect(0x7fa1ad80c000, 4096, PROT_READ) = 0
mprotect(0x7fa1ade1a000, 4096, PROT_READ) = 0
mprotect(0x62e000, 4096, PROT_READ)     = 0
mprotect(0x7fa1ae03f000, 4096, PROT_READ) = 0
munmap(0x7fa1ae010000, 186395)          = 0
set_tid_address(0x7fa1ae00d9d0)         = 31758
set_robust_list(0x7fa1ae00d9e0, 24)     = 0
rt_sigaction(SIGRTMIN, {sa_handler=0x7fa1ad5fbb10, sa_mask=[], 
sa_flags=SA_RESTORER|SA_SIGINFO, sa_restorer=0x7fa1ad606d50}, NULL, 8) = 0
rt_sigaction(SIGRT_1, {sa_handler=0x7fa1ad5fbba0, sa_mask=[], 
sa_flags=SA_RESTORER|SA_RESTART|SA_SIGINFO, sa_restorer=0x7fa1ad606d50}, NULL, 
8) = 0
rt_sigprocmask(SIG_UNBLOCK, [RTMIN RT_1], NULL, 8) = 0
getrlimit(RLIMIT_STACK, {rlim_cur=8192*1024, rlim_max=RLIM64_INFINITY}) = 0
brk(NULL)                               = 0x2107000
brk(0x2128000)                          = 0x2128000
fstat(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 9), ...}) = 0
stat("/dev/null", {st_mode=S_IFCHR|0666, st_rdev=makedev(1, 3), ...}) = 0
openat(AT_FDCWD, 
"/mnt/usb/$RECYCLE.BIN/S-1-5-21-357234412-4253969494-3556977985-1000/$RZ3ZN2C/tfc/maps/2fort.bsp",
 O_RDONLY|O_NOCTTY) = 3
fstat(3, {st_mode=S_IFREG|0777, st_size=2488684, ...}) = 0
read(3, 
"\36\0\0\0\0X%\0\264\217\0\0|\0\0\0\270\203\5\0\264\347%\0\270\21\0\0\244\277\6\0"...,
 32768) = 32768
read(3, 
"\0\0\0\0\0\0\200?\0\0%\304\2\0\0\0\0\0\0\0\0\0\0\0\0\0\200\277\0\0%D"..., 
32768) = 32768
read(3, 
"\375\243\264D\5\0\0\0007\323\241\276w\271\0\277\213\365M?\375\243\264\304\5\0\0\0^\24\241\276"...,
 32768) = 32768
read(3, 
"\0\0\0\0P\204|\2775X(\2768\207cD\4\0\0\0\0\0\0\200e\347y\277\5#^\276"..., 
32768) = 32768
read(3, 
"\0\0\0\0\0\200a\304\0\0\0\0008\324\305\276S\36l?\0\0\0\0L;\324\304\4\0\0\0"...,
 32768) = 32768
read(3, 
"\5\0\0\0T\316\371\275\23\351m\277\317n\262>A\276\327D\4\0\0\0T\316\371=\23\351m?"...,
 32768) = 32768
read(3, 
"\0\0\200?\0\0\0\0\0@*\305\1\0\0\0\0\0\0\0\0\0\200\277\0\0\0\0\0@*E"..., 32768) 
= 32768
read(3, 
"\302\353\346C\5\0\0\0003b\363\275qO)=*\367}?\302\353\346\303\5\0\0\0O\252\261="...,
 32768) = 32768
read(3, 
"\305\330\321>\374R\23\276a\226f?p\317k\303\5\0\0\0G\2511\277A\246n>\226d.\277"...,
 32768) = 32768
read(3, 
"qz\"?\250\362]\304\3\0\0\0\0\0\0\0\0\0\200?\0\0\0\0\0\0\272\303\1\0\0\0"..., 
32768) = 32768
read(3, 
"\4\0\0\0/E^\277\0\0\0\200\354\5\376\276\360$\36D\3\0\0\0/E^?\0\0\0\0"..., 
32768) = 32768
read(3, 
"\0\0\0\0\0\0\0\0\0\200\201\304\0\0\0\0\0\0\200\277\0\0\0\0\0\0\0\0\0\200\201D"...,
 32768) = 32768
read(3, 
"\0\0\0\0\375\377\377\377R\210\0\0\320\377A\376y\375\10\0H\376\240\375\220\26\2\0\0\0\0\0"...,
 32768) = 32768
read(3, 
"\377\377\377\377\320\3\300\n\221\3770\5\330\n\260\377\340,\2\0\0\0\0\0\377\377\377\377\377\377\377\377"...,
 32768) = 32768
read(3, 
"\0\0\360C\0\0005E\0\0\374\303\0\0\360C\0\0001E=J\364\303\0\0\360C\0\0001E"..., 
32768) = 32768
read(3, "\0\0\322\303\0\0008\303\0\0\374D\0\0\322\303\0\0\36\303\0 
\2E\0\0\322\303\0\0\16\303"..., 32768) = 32768
read(3, 
"\0\0X\304\0\0\204\303\0\0@C\0\0\214\304\0\0\200\303\0\0@C\0\0f\304\0\0\200\303"...,
 32768) = 32768
read(3, 
"\0\0\0\0\0\0\370\304ff\346\303\0\0\0\0{\244\370\304ff\346\303\0\0\0\0\0\0\1\305"...,
 32768) = 32768
read(3, "\0\0\360\302\0\0\272D\0\200\314D\0\0 \303\0\0\272D\0\0\315D\0\0 
\303\0\0\272D"..., 32768) = 32768
read(3, 
"\377\377\26\4\370\377\220\4\260\377\320\2\240\4X\0j\10\1\0\350#\0\0\377\377\5\376\370\377\220\4"...,
 32768) = 32768
read(3, 
"\20\377\0\5\20\371\240\377\205\21\1\0<D\0\0>\373\377\377\340\4\250\370\20\377\0\5\20\371\221\377"...,
 32768) = 32768
read(3, 
"\224\32\1\0000\36\0\0\301\16\305\16\0\0`\3660\376\270\0\300\366\221\377\225\32\0\0\2%\0\0"...,
 32768) = 32768
read(3, 
"\26\24(\365\250\4\330\10\370\376\30\5P\tx\377\205#\1\0\10\1\0\0\27\24)\365\250\4\330\10"...,
 32768) = 32768
read(3, 
"\0\0\0\0\0\0\200\277\0\0\310B&\0\0\0\0\0\0\0\0\0\0\0\0\0\200?\0\0\0\0"..., 
32768) = 32768
read(3, 
"\6\0\f\0\0\377\377\377UR\1\0\200(\0\0\260\r\0\0\5\0\360\2\0\377\377\377\246R\1\0"...,
 32768) = 32768
read(3, 
"\217l\4\0\34\26\0\0\4,\0\0\4\0\236\0\0\377\377\377\263l\4\0B\26\1\0\10,\0\0"...,
 32768) = 32768
read(3, 
"\321I\0\0\5\0\f\2\0\377\377\377\210\n\7\0\3025\0\0\326I\0\0\5\0\f\2\0\377\377\377"...,
 32768) = 32768
read(3, 
"\0\377\377\377\261{\t\0*\1\0\0\31g\0\0\4\0\30\0\0\377\377\377\254}\t\0*\1\0\0"...,
 32768) = 32768
read(3, 
"d.\1\0k\205\0\0\4\0\256\0\0\377\377\377\360\245\f\0\252\16\1\0o\205\0\0\4\0r\0"...,
 32768) = 32768
read(3, 
"\4\0\235\4\0\377\377\377l-\17\0\272&\0\0\237\242\0\0\4\0\234\4\0\377\377\377\226-\17\0"...,
 32768) = 32768
read(3, 
"\377\377*\r\16;\0\0\377\377+\r\6;\0\0\377\377,\r\n;\0\0\377\377\376\377p5\0\0"...,
 32768) = 32768
read(3, 
"\377\377\376\3778\10\0\0\377\377\376\377f\30\0\0,\35\376\377d4\0\0\377\377\376\377\356\31\0\0"...,
 32768) = 32768
read(3, "*-\376\377J\23\0\0\377\377\376\377\16#\0\0\376\377,- 
\26\0\0\376\377--\326\22\0\0"..., 32768) = 32768
read(3, 
"\377\377*=\n\t\0\0\377\377+=t\22\0\0\376\377\377\377>\3\0\0\377\377-=\206,\0\0"...,
 32768) = 32768
read(3, 
"R\374\377\377\261\3\0\0\262\3\0\0\263\3\0\0\264\3\0\0\265\3\0\0\266\3\0\0\267\3\0\0"...,
 32768) = 32768
read(3, 
"\222\24\0\0u\353\377\377\223\24\0\0{\353\377\377W\365\377\377\224\24\0\0\225\24\0\0\226\24\0\0"...,
 32768) = 32768
read(3, 
"\310%\0\0005\333\377\377;\333\377\377<\332\377\3779\332\377\377F\332\377\377=\332\377\377=\333\377\377"...,
 32768) = 32768
read(3, 
"\v8\0\0\f8\0\0\r8\0\0\0168\0\0\0178\0\0\243\310\377\377\0208\0\0\0218\0\0"..., 
32768) = 32768
read(3, 
"G\267\377\377J\267\377\377\262\267\377\377E\267\377\377a\267\377\377F\267\377\377\274H\0\0h\267\377\377"...,
 32768) = 32768
read(3, "BY\0\0CY\0\0DY\0\0EY\0\0FY\0\0GY\0\0HY\0\0IY\0\0"..., 32768) = 32768
read(3, 
"\337\21\322\21\333\21\340\21\340\21\341\21\341\21\342\21\342\21\334\21\342\21\343\21\343\21\344\21\344\21\345\21"...,
 32768) = 32768
read(3, "\343\"\332\"\341\"\343\"\273\35\343\"K 
\342\"\342\"\276\35\342\"\343\"\344\"\330\"B\37\344\""..., 32768) = 32768
read(3, 
"\0\0\200\303\0\0\300D\0\0\320\304\0\0\340\302\0\0\0\0\0\0\0\0\0\0\0\0b\24\0\0"...,
 32768) = 32768
read(3, "\24\27\23\23\27\23\23\27\24\24\27''/&&-&&-%%+$$+$$+$$+"..., 32768) = 
32768
read(3, 
"\27\27\34\27\27\34\26\27\33\27\27\33\27\27\33\27\27\34\27\30\34\27\27\33\27\27\34\27\27\34\27\30"...,
 32768) = 32768
read(3, "\31\35\35\30\35\35\30 \37\32 
\37\32\37\37\32\37\36\32\37\36\31\37\36\31\37\37\32\37\37\32 "..., 32768) = 
32768
read(3, "\30\24\37\30\25 \31\25 \31\25 
\31\25\30\17\r\34\24\21\34\24\21\34\26\23\37\30\24\37\30\24"..., 32768) = 32768
read(3, 
"\25\25\22\26\25\22\26\25\22\27\26\22\27\27\23\31\30\24\33\33\26%%\37\25\24\21\25\24\21\25\24"...,
 32768) = 32768
read(3, 
"\16\20\20\r\17\17\f\17\16\f\21\20\16\20\17\r\17\17\f\17\16\f\16\16\f\20\20\r\17\17\f\16"...,
 36864) = 36864
read(3, 
"\250tt\211``qRRaGGT@@Lhh{{{\222\225\225\261\265\265\326\327\327\377\327"..., 
49152) = 49152
read(3, 
"u\377\223u\377\223u\377\223u\377\223u\377\223uqA4\377\223u\377\223u\377\223u\377\223u\377"...,
 65536) = 65536
read(3, 
"\220\246\246\214\241\241\212\237\237m~~w\212\212\201\225\225\213\240\240\224\254\254\233\264\264\240\272\272\243\275"...,
 61440) = 61440
read(3, "pjlngbqkbpkalg\\hbX]ZRlingcage`ge"..., 65536) = 65536
read(3, 
"\223u\377\223u\377\223u\377\223u\377\223u\377\223u\377\223u\377\223u\377\223u\377\223u\377\223u"...,
 57344) = 57344
read(3, "=34=34=34=34=34=34=34=34\0\0\0\0\0\0\0\0"..., 61440) = 61440
read(3, "\"#\37  \35\36\37\34\35\36\33\34\35\33&&!,+%21*54-21*,,"..., 65536) = 
32768
read(3, 0x211f000, 32768)               = -1 EOVERFLOW (Value too large for 
defined data type)
write(2, "./grep: ", 8./grep: )                 = 8
write(2, "/mnt/usb/$RECYCLE.BIN/S-1-5-21-3"..., 
95/mnt/usb/$RECYCLE.BIN/S-1-5-21-357234412-4253969494-3556977985-1000/$RZ3ZN2C/tfc/maps/2fort.bsp)
 = 95
write(2, ": Value too large for defined da"..., 39: Value too large for defined 
data type) = 39
write(2, "\n", 1
)                       = 1
close(3)                                = 0
close(1)                                = 0
close(2)                                = 0
exit_group(2)                           = ?
+++ exited with 2 +++

Reply via email to