Closed Bug 446245 Opened 17 years ago Closed 17 years ago

mxr search results typically give line numbers off by 8 lines

Categories

(Webtools Graveyard :: MXR, defect)

x86
Windows XP
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 442822

People

(Reporter: nelson, Assigned: bear)

References

()

Details

When searching source files for regular expressions, the results give line numbers that are fictitious. It's common for all the line numbers give in a file to be off by 7 or 8 lines. Basic line counting shouldn't be this hard. Example: http://mxr.mozilla.org/security/search?string=slot.*session.*=&find=nss/lib&regexp=1 reports there is a line that matches in file /security/nss/lib/pk11wrap/pk11slot.c (View change log or blame annotations) at line 705 -- slot->session = rwsession; But the cited line is actually line 697, not line 705. This is not due to frequent/recent changes in file contents. That file hasn't changed in a long time.
from memory this is a bug in glimpse: [timeless@landfill mxr-test]$ /usr/local/glimpse-4.18.1p/bin/glimpse -i -H /var/www/html/mxr/lxr-root/lxr-data/security -y -n -F nss/lib -e 'slot.*session.*=' /var/www/html/mxr/lxr-root/lxr-data/security/mozilla/security/nss/lib/pk11wrap/pk11auth.c: 135: if (slot->session != CK_INVALID_SESSION) { /var/www/html/mxr/lxr-root/lxr-data/security/mozilla/security/nss/lib/pk11wrap/p
Whiteboard: DUPEME
(In reply to comment #2) > from memory this is a bug in glimpse: If it was a bug in glimpse, lxr would be showing this problem, too. Why is lxr not showing this issue?
What reed said. LXR and MXR are on the same box using the same copy of glimpse.
[root@dm-webtools03 data]# /usr/bin/glimpse -i -H /data/lxr-data/security -y -n -F nss/lib -e 'slot.*session.*=' /data/lxr-data/security/mozilla/security/nss/lib/pk11wrap/pk11slot.c: 363: slot->sessionLock = mod->isThreadSafe ? ... /data/lxr-data/security/mozilla/security/nss/lib/pk11wrap/pk11auth.c: 135: if (slot->session != CK_INVALID_SESSION) { [root@dm-webtools03 data]# /usr/bin/glimpse -i -H /data/mxr-data/security -y -n -F nss/lib -e 'slot.*session.*=' /data/mxr-data/security/mozilla/security/nss/lib/pk11wrap/pk11slot.c: 363: slot->sessionLock = mod->isThreadSafe ? ... /data/mxr-data/security/mozilla/security/nss/lib/pk11wrap/pk11auth.c: 135: if (slot->session != CK_INVALID_SESSION) { Look fine to me...
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → DUPLICATE
Whiteboard: DUPEME
No longer blocks: 445051
for reference here's output from a trusted client: [timeless@landfill mxr-test]$ grep -n 'slot->session != CK_INVALID_SESSION' /var/www/html/mxr/lxr-root/lxr-data/security/mozilla/security/nss/lib/pk11wrap/pk11auth.c 127: if (slot->session != CK_INVALID_SESSION) { and here's testing misterssl's lxr links: http://lxr.mozilla.org/security/search?string=slot.*session.*=&find=nss/lib&regexp=1 scroll down to: /security/nss/lib/pk11wrap/pk11auth.c, line 135 -- if (slot->session != CK_INVALID_SESSION) { clicking the link: http://lxr.mozilla.org/security/source/security/nss/lib/pk11wrap/pk11auth.c#135 135 } which is the same incorrect answer that mxr gave....
oh, and the problem line from comment 0 can also be seen in LXR (I'm not sure why I picked the problem in 135, it must have been luck of the draw): http://lxr.mozilla.org/security/search?string=slot.*session.*=&find=nss/lib&regexp=1 /security/nss/lib/pk11wrap/pk11slot.c, line 705 -- slot->session = rwsession;
Where is it written that MXR must use glimpse? grep and egrep can do the job with regular expressions just fine. If glimpse cannot, and it's not easy to get glimpse fixed, then mxr should use something other than glimpse for the tasks it cannot do.
Status: RESOLVED → REOPENED
Resolution: DUPLICATE → ---
we have a protocol. first come first served. your bug didn't come first. don't reopen it. at some point glimpse could be replaced, but it's not very high on my todo list.
Status: REOPENED → RESOLVED
Closed: 17 years ago17 years ago
Resolution: --- → DUPLICATE
Product: Webtools → Webtools Graveyard
You need to log in before you can comment on or make changes to this bug.