Gnus development mailing list
 help / color / mirror / Atom feed
* Gnus registry woes
@ 2004-06-29  9:21 Norbert Koch
  2004-06-29 18:21 ` Ted Zlatanov
  0 siblings, 1 reply; 7+ messages in thread
From: Norbert Koch @ 2004-06-29  9:21 UTC (permalink / raw)


Hi!

I've had a go at the registry today.  Now, I'm no longer able to save
my Gnus buffers.  I get the following error:

Signaling: (wrong-type-argument natnump -2497)
  gnus-registry-trim((("<20040629090742.GE74930@atrbg11.informatik.tu-muenchen.de>" (...) "nnml:bsd-current") ("<1152675CA9EDD71187130002B3CE5ADA090BA9F4@hoexc010.ukrtelecom.net>" (...) "nnml:bsd-current") ("<87n02msp6d.fsf@free.fr>" (...) "nnml:lilypond")))
  gnus-registry-save()
  run-hooks(gnus-registry-save)
  apply(run-hooks gnus-registry-save)
  gnus-run-hooks(gnus-save-newsrc-hook)
  gnus-save-newsrc-file(nil)
  gnus-group-save-newsrc(nil)
  call-interactively(gnus-group-save-newsrc)


This is the latest and greatest Gnus on a 21.4 (patch 15) "Security
Through Obscurity" XEmacs Lucid.

Any pointers are very welcome,
norbert.



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Gnus registry woes
  2004-06-29  9:21 Gnus registry woes Norbert Koch
@ 2004-06-29 18:21 ` Ted Zlatanov
  2004-06-29 20:51   ` Norbert Koch
  0 siblings, 1 reply; 7+ messages in thread
From: Ted Zlatanov @ 2004-06-29 18:21 UTC (permalink / raw)


On Tue, 29 Jun 2004, viteno@xemacs.org wrote:

> I've had a go at the registry today.  Now, I'm no longer able to save
> my Gnus buffers.  I get the following error:
> 
> Signaling: (wrong-type-argument natnump -2497)
>   gnus-registry-trim((("<20040629090742.GE74930@atrbg11.informatik.tu-muenchen.de>"
>   	(...) "nnml:bsd-current")
>   	("<1152675CA9EDD71187130002B3CE5ADA090BA9F4@hoexc010.ukrtelecom.net>"
>   	(...) "nnml:bsd-current") ("<87n02msp6d.fsf@free.fr>" (...)
>   	"nnml:lilypond")))
>   gnus-registry-save()
>   run-hooks(gnus-registry-save)
>   apply(run-hooks gnus-registry-save)
>   gnus-run-hooks(gnus-save-newsrc-hook)
>   gnus-save-newsrc-file(nil)
>   gnus-group-save-newsrc(nil)
>   call-interactively(gnus-group-save-newsrc)

Here's the function in question:

(defun gnus-registry-trim (alist)
  "Trim alist to size, using gnus-registry-max-entries."
  (if (null gnus-registry-max-entries)
      alist				; just return the alist
    ;; else, when given max-entries, trim the alist
    (let ((timehash (make-hash-table 			    
		     :size 4096
		     :test 'equal)))
      (maphash
       (lambd a(key value)
	 (puthash key (gnus-registry-fetch-extra key 'mtime) timehash))
       gnus-registry-hashtb)

      ;; we use the return value of this setq, which is the trimmed alist
      (setq alist
	    (nthcdr
	     (- (length alist) gnus-registry-max-entries)
	     (sort alist 
		   (lambda (a b)
		     (time-less-p 
		      (cdr (gethash (car a) timehash))
		      (cdr (gethash (car b) timehash))))))))))

So basically we sort the alist and then take only the needed number
of entries from it.

I would guess the natnump error, which I have never seen before, is
coming from an invalid mtime.  Can you trace the error deeper with
(debug) statements inside the lambda function above?  Alternatively,
can you send me your registry file, if the error is repeatable from
it?

Thanks
Ted



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Gnus registry woes
  2004-06-29 18:21 ` Ted Zlatanov
@ 2004-06-29 20:51   ` Norbert Koch
  2004-06-30 15:15     ` Norbert Koch
  2004-06-30 17:52     ` Ted Zlatanov
  0 siblings, 2 replies; 7+ messages in thread
From: Norbert Koch @ 2004-06-29 20:51 UTC (permalink / raw)


"Ted Zlatanov" <tzz@lifelogs.com> writes:

> I would guess the natnump error, which I have never seen before, is
> coming from an invalid mtime.  Can you trace the error deeper with
> (debug) statements inside the lambda function above?  Alternatively,
> can you send me your registry file, if the error is repeatable from
> it?

I think the problem is there *is* no registry file, yet.  Should I
create it (empty)?

I can try to step down expressions, though.

Thanks,
norbert.



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Gnus registry woes
  2004-06-29 20:51   ` Norbert Koch
@ 2004-06-30 15:15     ` Norbert Koch
  2004-06-30 18:00       ` Ted Zlatanov
  2004-06-30 17:52     ` Ted Zlatanov
  1 sibling, 1 reply; 7+ messages in thread
From: Norbert Koch @ 2004-06-30 15:15 UTC (permalink / raw)


Norbert Koch <viteno@xemacs.org> writes:

> "Ted Zlatanov" <tzz@lifelogs.com> writes:
>
>> I would guess the natnump error, which I have never seen before, is
>> coming from an invalid mtime.  Can you trace the error deeper with
>> (debug) statements inside the lambda function above?  Alternatively,
>> can you send me your registry file, if the error is repeatable from
>> it?

> I can try to step down expressions, though.

Okay, I've had a look at it.  The error occurs at the end of the sort
operation.

      (setq alist
	    (nthcdr
	     (- (length alist) gnus-registry-max-entries)
	     (sort alist 
		   (lambda (a b)
		     (time-less-p 
		      (cdr (gethash (car a) timehash))
		      (cdr (gethash (car b) timehash))))))))))
                                                         ^ stepping
                                                         over this paren

Here's my current timehash and alist

#<hash-table test equal size 2/8737 data ("<20040630141326.666947303F@freebsd-current.sentex.ca>" (mtime 16610 55105 533706) "<20040630140742.CAA057303F@freebsd-current.sentex.ca>" (mtime 16610 55105 533085)) 0x10ccb>

((<20040630140742.CAA057303F@freebsd-current.sentex.ca> ((mtime 16610 55105 533085)) nnml:bsd-current) (<20040630141326.666947303F@freebsd-current.sentex.ca> ((mtime 16610 55105 533706)) nnml:bsd-current))


Max entries is set to 2500, I've got two entries.  At this moment the error
is natnump, -2498.

norbert.



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Gnus registry woes
  2004-06-29 20:51   ` Norbert Koch
  2004-06-30 15:15     ` Norbert Koch
@ 2004-06-30 17:52     ` Ted Zlatanov
  1 sibling, 0 replies; 7+ messages in thread
From: Ted Zlatanov @ 2004-06-30 17:52 UTC (permalink / raw)


On Tue, 29 Jun 2004, viteno@xemacs.org wrote:

> "Ted Zlatanov" <tzz@lifelogs.com> writes:
> 
>> I would guess the natnump error, which I have never seen before, is
>> coming from an invalid mtime.  Can you trace the error deeper with
>> (debug) statements inside the lambda function above?  Alternatively,
>> can you send me your registry file, if the error is repeatable from
>> it?
> 
> I think the problem is there *is* no registry file, yet.  Should I
> create it (empty)?

You can, but many others have started with an empty registry and have
not had your error AFAIK.

Ted



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Gnus registry woes
  2004-06-30 15:15     ` Norbert Koch
@ 2004-06-30 18:00       ` Ted Zlatanov
  2004-07-01  5:56         ` Norbert Koch
  0 siblings, 1 reply; 7+ messages in thread
From: Ted Zlatanov @ 2004-06-30 18:00 UTC (permalink / raw)


On Wed, 30 Jun 2004, viteno@xemacs.org wrote:

> Max entries is set to 2500, I've got two entries.  At this moment the error
> is natnump, -2498.

I think I figured out the problem, I don't know how come I never
realized it could happen that the trim length could be negative.
Oops!  It's fixed in CVS, let me know if it works OK for you.

Ted



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Gnus registry woes
  2004-06-30 18:00       ` Ted Zlatanov
@ 2004-07-01  5:56         ` Norbert Koch
  0 siblings, 0 replies; 7+ messages in thread
From: Norbert Koch @ 2004-07-01  5:56 UTC (permalink / raw)


"Ted Zlatanov" <tzz@lifelogs.com> writes:

> I think I figured out the problem, I don't know how come I never
> realized it could happen that the trim length could be negative.
> Oops!  It's fixed in CVS, let me know if it works OK for you.

Yes, it works.  Thanks for the fix,
norbert.



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2004-07-01  5:56 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-06-29  9:21 Gnus registry woes Norbert Koch
2004-06-29 18:21 ` Ted Zlatanov
2004-06-29 20:51   ` Norbert Koch
2004-06-30 15:15     ` Norbert Koch
2004-06-30 18:00       ` Ted Zlatanov
2004-07-01  5:56         ` Norbert Koch
2004-06-30 17:52     ` Ted Zlatanov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).