[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
findutils-4.1 locate crashing
From: |
Steve Murphy |
Subject: |
findutils-4.1 locate crashing |
Date: |
Tue, 3 Apr 2001 07:24:26 -0600 (MDT) |
Hello--
I'm writing to report a crash in locate. It's related to the locate
database, and seems to be platform independent; at least, I crash
under both linux and solaris 2.5.1.
I form the database (updatedb) under solaris 2.5.1.
It seems to be crashing when it searching thru one of the longer
filenams in:
/export/home/murf/.enlightenment/cached/bgsel
/export/home/murf/.enlightenment/cached/pager
/export/home/murf/.enlightenment/cached/pager/GRAD_BRUSHED_METAL_BG_VERTICAL_GRADIENT_DARK_BRUSHED.61.48.0GBmu10000000g0000000000000000EVk100000w00k6P0U3000000000000000000
/export/home/murf/.enlightenment/cached/pager/GRAD_BRUSHED_METAL_BG_VERTICAL_GRADIENT_LIGHT_BRUSHED.61.48.0GBmu10000000g0000000000000000AVk100000w00k6P0U3000000000000000000
/export/home/murf/.enlightenment/cached/pager/GRAD_BRUSHED_METAL_BG_VERTICAL_GRADIENT_LIGHT_BRUSHED.60.48.0GBmu10000000g0000000000000000AVk100000w00k6P0U3000000000000000000
/export/home/murf/.enlightenment/cached/pager/GRAD_BRUSHED_METAL_BG_VERTICAL_GRADIENT_DARK_BRUSHED.60.48.0GBmu10000000g0000000000000000EVk100000w00k6P0U3000000000000000000
/export/home/murf/.enlightenment/cached/pager/GRAD_BRUSHED_METAL_BG_VERTICAL_GRADIENT_DARK_BRUSHED.48.40.0GBmu10000000g0000000000000000EVk100000w00k6P0U3000000000000000000
/export/home/murf/.enlightenment/cached/pager/GRAD_BRUSHED_METAL_BG_VERTICAL_GRADIENT_LIGHT_BRUSHED.40.32.0GBmu10000000g0000000000000000AVk100000w00k6P0U3000000000000000000
/export/home/murf/.enlightenment/cached/pager/GRAD_BRUSHED_METAL_BG_VERTICAL_GRADIENT_DARK_BRUSHED.40.32.0GBmu10000000g0000000000000000EVk100000w00k6P0U3000000000000000000
/export/home/murf/.enlightenment/.initialized
/export/home/murf/.enlightenment/user_theme.cfg
I can send the datafile (from updatedb) on request; I didn't want to
stuff the mailbox if you aren't interested in it.
stack trace:
(gdb) where
#0 0x1210c in getstr (lineptr=0xeffff388, n=0xeffff384, stream=0x23080,
terminator=116 't', offset=65569) at getline.c:95
#1 0x10f2c in locate (pathpart=0xeffff766 "si2tocfi",
dbfile=0x23218 "/usr/local/var/locatedb") at locate.c:277
#2 0x111f4 in main (argc=2, argv=0xeffff5fc) at locate.c:398
Here is a session with gdb; the locate was compiled with -O -g; it
kind of rambles, but I AM unfamiliar with the algorithms...I note that
terminator seems corrupted, and it is not obvious why we are dying on
line 95.:
(gdb) run si2tocfi
Starting program: /usr/local/bin/locate si2tocfi
Program received signal SIGSEGV, Segmentation fault.
0x1210c in getstr (lineptr=0xeffff388, n=0xeffff384, stream=0x23080,
terminator=116 't', offset=65569) at getline.c:95
95 getline.c: No such file or directory.
(gdb) dir /usr2/archives/findutils-4.1/locate/
Source directories searched: /usr2/archives/findutils-4.1/locate:$cdir:$cwd
(gdb) where
#0 0x1210c in getstr (lineptr=0xeffff388, n=0xeffff384, stream=0x23080,
terminator=116 't', offset=65569) at getline.c:95
#1 0x10f2c in locate (pathpart=0xeffff766 "si2tocfi",
dbfile=0x23218 "/usr/local/var/locatedb") at locate.c:277
#2 0x111f4 in main (argc=2, argv=0xeffff5fc) at locate.c:398
(gdb) up
#1 0x10f2c in locate (pathpart=0xeffff766 "si2tocfi",
dbfile=0x23218 "/usr/local/var/locatedb") at locate.c:277
277 nread = getstr (&path, &pathsize, fp, '\0', count);
(gdb) down
#0 0x1210c in getstr (lineptr=0xeffff388, n=0xeffff384, stream=0x23080,
terminator=116 't', offset=65569) at getline.c:95
95 getline.c: No such file or directory.
(gdb) dir /usr2/archives/findutils-4.1/lib
Source directories searched:
/usr2/archives/findutils-4.1/lib:/usr2/archives/findutils-4.1/locate:$cdir:$cwd
(gdb) up
#1 0x10f2c in locate (pathpart=0xeffff766 "si2tocfi",
dbfile=0x23218 "/usr/local/var/locatedb") at locate.c:277
277 nread = getstr (&path, &pathsize, fp, '\0', count);
(gdb) down
#0 0x1210c in getstr (lineptr=0xeffff388, n=0xeffff384, stream=0x23080,
terminator=116 't', offset=65569) at getline.c:95
95 if (c == EOF || ferror (stream))
(gdb) p c
No symbol "c" in current context.
(gdb) l
90 return -1;
91 read_pos = *n - nchars_avail + *lineptr;
92 assert(*n - nchars_avail == read_pos - *lineptr);
93 }
94
95 if (c == EOF || ferror (stream))
96 {
97 /* Return partial line, if any. */
98 if (read_pos == *lineptr)
99 return -1;
(gdb) p read_pos
$1 = 0x35eb1 <Address 0x35eb1 out of bounds>
(gdb) p n
$2 = (unsigned int *) 0xeffff384
(gdb) p *n
$3 = 2052
(gdb) p *n
$6 = 2052
(gdb) p nchars_avail
$7 = -63517
(gdb) p read_pos
$8 = 0x35eb1 <Address 0x35eb1 out of bounds>
(gdb) p read_pos-*lineptr
$10 = 65569
(gdb) p *n-nchars_avail
$11 = 65569
(gdb) p c
No symbol "c" in current context.
(gdb) p *lineptr
$12 = 0x25e90
"/export/home/murf/.enlightenment/cached/pager/GRAD_BRUSHED_METAL_BG_VERTICAL_GRADIENT_LIGHT_BRUSHED.61.48.0GBmu10000000g",
'0' <repeats 16 times>, "AVk100000w00k6P0U3", '0' <repeats 18 times>
(gdb) where
#0 0x1210c in getstr (lineptr=0xeffff388, n=0xeffff384, stream=0x23080,
terminator=116 't', offset=65569) at getline.c:95
#1 0x10f2c in locate (pathpart=0xeffff766 "si2tocfi",
dbfile=0x23218 "/usr/local/var/locatedb") at locate.c:277
#2 0x111f4 in main (argc=2, argv=0xeffff5fc) at locate.c:398
(gdb) l
100 else
101 break;
102 }
103
104 *read_pos++ = c;
105 nchars_avail--;
106
107 if (c == terminator)
108 /* Return the line. */
109 break;
(gdb) l 95
90 return -1;
91 read_pos = *n - nchars_avail + *lineptr;
92 assert(*n - nchars_avail == read_pos - *lineptr);
93 }
94
95 if (c == EOF || ferror (stream))
96 {
97 /* Return partial line, if any. */
98 if (read_pos == *lineptr)
99 return -1;
(gdb) p stream
$13 = (FILE *) 0x23080
(gdb) p ferror
$14 = {<text variable, no debug info>} 0xef6f2fa8 <ferror>
(gdb) p ferror(stream)
$15 = 0
(gdb) where
#0 0x1210c in getstr (lineptr=0xeffff388, n=0xeffff384, stream=0x23080,
terminator=116 't', offset=65569) at getline.c:95
#1 0x10f2c in locate (pathpart=0xeffff766 "si2tocfi",
dbfile=0x23218 "/usr/local/var/locatedb") at locate.c:277
#2 0x111f4 in main (argc=2, argv=0xeffff5fc) at locate.c:398
(gdb) ptype size_t
type = unsigned int
(gdb) p *n
$16 = 2052
(gdb) up
#1 0x10f2c in locate (pathpart=0xeffff766 "si2tocfi",
dbfile=0x23218 "/usr/local/var/locatedb") at locate.c:277
277 nread = getstr (&path, &pathsize, fp, '\0', count);
(gdb) l
272 count += c - 256;
273 else
274 count += c;
275
276 /* Overlay the old path with the remainder of the new. */
277 nread = getstr (&path, &pathsize, fp, '\0', count);
278 if (nread < 0)
279 break;
280 c = getc (fp);
281 s = path + count + nread - 2; /* Move to the last char in
path. */
(gdb) p pathsize
$17 = 2052
(gdb) down
#0 0x1210c in getstr (lineptr=0xeffff388, n=0xeffff384, stream=0x23080,
terminator=116 't', offset=65569) at getline.c:95
95 if (c == EOF || ferror (stream))
(gdb) p terminator
$18 = 116 't'
(gdb) up
#1 0x10f2c in locate (pathpart=0xeffff766 "si2tocfi",
dbfile=0x23218 "/usr/local/var/locatedb") at locate.c:277
277 nread = getstr (&path, &pathsize, fp, '\0', count);
(gdb) p &path
$20 = (char **) 0xeffff388
(gdb) down
#0 0x1210c in getstr (lineptr=0xeffff388, n=0xeffff384, stream=0x23080,
terminator=116 't', offset=65569) at getline.c:95
95 if (c == EOF || ferror (stream))
(gdb) up
#1 0x10f2c in locate (pathpart=0xeffff766 "si2tocfi",
dbfile=0x23218 "/usr/local/var/locatedb") at locate.c:277
277 nread = getstr (&path, &pathsize, fp, '\0', count);
(gdb) p &pathsize
$21 = (unsigned int *) 0xeffff384
(gdb) where
#0 0x1210c in getstr (lineptr=0xeffff388, n=0xeffff384, stream=0x23080,
terminator=116 't', offset=65569) at getline.c:95
#1 0x10f2c in locate (pathpart=0xeffff766 "si2tocfi",
dbfile=0x23218 "/usr/local/var/locatedb") at locate.c:277
#2 0x111f4 in main (argc=2, argv=0xeffff5fc) at locate.c:398
(gdb) p fp
$22 = (FILE *) 0x23080
(gdb) up
#2 0x111f4 in main (argc=2, argv=0xeffff5fc) at locate.c:398
398 found |= locate (argv[optind], e);
(gdb) l
393 for (; optind < argc; optind++)
394 {
395 char *e;
396 next_element (dbpath); /* Initialize. */
397 while ((e = next_element ((char *) NULL)) != NULL)
398 found |= locate (argv[optind], e);
399 }
400
401 exit (!found);
402 }
(gdb) down
#1 0x10f2c in locate (pathpart=0xeffff766 "si2tocfi",
dbfile=0x23218 "/usr/local/var/locatedb") at locate.c:277
277 nread = getstr (&path, &pathsize, fp, '\0', count);
(gdb) p count
$23 = 65569
--
murf: Steve Murphy, VP Technology
57 Lane 17 Electronic Tools Company
Cody, Wyoming work: (307)754-8154
home: (307)754-5675
email: address@hidden
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- findutils-4.1 locate crashing,
Steve Murphy <=