Bug 436648 - overeager database rebuild
Summary: overeager database rebuild
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: cscope
Version: 9
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: Neil Horman
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-03-08 19:55 UTC by Frank Ch. Eigler
Modified: 2008-07-09 21:50 UTC (History)
0 users

Fixed In Version: 15.6-2.fc9
Clone Of:
Environment:
Last Closed: 2008-07-09 21:50:37 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
patch to fix samelist function (815 bytes, patch)
2008-03-10 18:15 UTC, Neil Horman
no flags Details | Diff

Description Frank Ch. Eigler 2008-03-08 19:55:35 UTC
Description of problem:
cscope recomputes some index data at startup, even with up-to-date
index files (cscope.*.out) and an unchanged source file tree.

Version-Release number of selected component (if applicable):
cscope-15.5-15.4.fc7

How reproducible:
always

Steps to Reproduce:
1. run cscope -R -q on some big source tree
2. quit cscope
3. rerun cscope -R -q

  
Actual results:
cscope does some reindexing work again; probably the "-q" part

Expected results:
cscope should reuse old index files

Comment 1 Neil Horman 2008-03-08 23:28:05 UTC
How are you sure that reindexing is occuring?  Are you just observing disk
activity?  If so, thats expected, as cscope goes through the file list to check
file metadata and be sure that no index update is needed.  I just tried this
version on my system here on a kernel tree, and thats the only filesystem
activity I see from a strace.

Comment 2 Frank Ch. Eigler 2008-03-09 01:37:00 UTC
In my case, strace shows the huge list of lstat/gedent/etc checks, but
then we get to this ...

lstat("/usr/include", {st_mode=S_IFDIR|0755, st_size=20480, ...}) = 0
rt_sigaction(SIGTSTP, {SIG_IGN}, {0x3b1b013fe0, [], SA_RESTORER|SA_RESTART,
0x3b0c230f30}, 8) = 0
select(1, [0], NULL, NULL, {0, 0})      = 0 (Timeout)
select(1, [0], NULL, NULL, {0, 0})      = 0 (Timeout)
write(1, "\33[HBuilding cross-reference...\33["..., 33Building
cross-reference...) = 33
rt_sigaction(SIGTSTP, {0x3b1b013fe0, [], SA_RESTORER|SA_RESTART, 0x3b0c230f30},
NULL, 8) = 0
[...]
open("ncscope.out", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 5
fcntl(5, F_SETFD, FD_CLOEXEC)           = 0
open("/var/tmp/cscope.20392/cscope.1", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 6
fcntl(6, F_SETFD, FD_CLOEXEC)           = 0
fstat(5, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
mmap(NULL, 1048576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
0x2aaaaabed000
gettimeofday({1205024680, 984453}, NULL) = 0
[...]
write(6, "anup_procfs_example !!!G! \nMODUL"..., 4096) = 4096
read(4, "c\n->\n\304_ru\302\232g\n, c->\n\304_\241\335\263d\n, c->\n"..., 8192)
= 8192


Comment 3 Neil Horman 2008-03-10 18:15:17 UTC
Created attachment 297483 [details]
patch to fix samelist function

oops, you're right, I see it now.  The samelist function wasn't pulling in
newlines during its search properly, and as such was always failing, forcing a
db rebuild.  Who knows how long thats been there.  This is the fix.  I'll be
pushing this upstream as well.	Thanks for the catch Frank!

Comment 4 Bug Zapper 2008-05-14 05:52:21 UTC
Changing version to '9' as part of upcoming Fedora 9 GA.
More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 5 Frank Ch. Eigler 2008-07-04 17:24:25 UTC
It seems like cscope-16.6-1.fc9 running consecutive "cscope -R -q" jobs against
an unmodified linux kernel tree cause the same kind of undesired recomputation.

Comment 6 Neil Horman 2008-07-07 20:10:11 UTC
Thats odd, I don't know where this fix wen't.  It appears to be missing from the
repository.  How odd, we'll I'll get it pushed in again.  Thanks framk!

Comment 7 Neil Horman 2008-07-08 14:57:34 UTC
Actually, I take that back, I do see the fix in there, but its not always
working (not sure why).   It only works occasionally for me, looking into why
 

Comment 8 Neil Horman 2008-07-08 15:54:59 UTC
ahh, found the issue, I'm missing a subsequent patch from upstream that
corrected an additional corner case with this.  I'll post the fix shortly.

Comment 9 Neil Horman 2008-07-08 16:58:00 UTC
fixed in -2.f10/-2.f9.  Thanks Frank!

Comment 10 Fedora Update System 2008-07-08 18:21:36 UTC
cscope-15.6-2.fc9 has been submitted as an update for Fedora 9

Comment 11 Fedora Update System 2008-07-09 21:50:35 UTC
cscope-15.6-2.fc9 has been pushed to the Fedora 9 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.