Subject: [sup-talk] Crash on startup, "wrong id called on nil"

From: [email-masked] (Michael Gurski)
Date: Thu, 7 Feb 2008 12:27:26 -0500

It's been a while since I launched sup, and updating today from
master, I get a crash on startup:

--- RuntimeError from thread: load threads for thread-index-mode
wrong id called on nil

IIRC, this was also happening maybe a month or so ago, and I just
didn't have the time to deal with it then.  Dumping the index,
rebuilding, etc, seem to not affect this at all.

The full exception log is:

$ cat sup-exception-log.txt 
--- RuntimeError from thread: load threads for thread-index-mode
wrong id called on nil
./lib/sup.rb:13:in `id'
./lib/sup/modes/thread-index-mode.rb:183:in `update'
./lib/sup/hook.rb:123:in `sort_by'
./lib/sup/modes/thread-index-mode.rb:183:in `each'
./lib/sup/modes/thread-index-mode.rb:183:in `sort_by'
./lib/sup/modes/thread-index-mode.rb:183:in `update'
/usr/lib/ruby/1.8/thread.rb:135:in `synchronize'
./lib/sup/modes/thread-index-mode.rb:181:in `update'
./lib/sup/modes/thread-index-mode.rb:466:in
`__unprotected_load_n_threads'
./lib/sup/thread.rb:332:in `load_n_threads'
./lib/sup/index.rb:224:in `each_id_by_date'
./lib/sup/index.rb:224:in `each'
./lib/sup/index.rb:224:in `each_id_by_date'
./lib/sup/thread.rb:326:in `load_n_threads'
./lib/sup/modes/thread-index-mode.rb:463:in
`__unprotected_load_n_threads'
(eval):12:in `load_n_threads'
./lib/sup/modes/thread-index-mode.rb:452:in
`load_n_threads_background'
./lib/sup.rb:60:in `reporting_thread'
./lib/sup.rb:58:in `initialize'
./lib/sup.rb:58:in `new'
./lib/sup.rb:58:in `reporting_thread'
./lib/sup/modes/thread-index-mode.rb:451:in
`load_n_threads_background'
./lib/sup/modes/thread-index-mode.rb:502:in
`__unprotected_load_threads'
(eval):12:in `load_threads'
bin/sup:199
--- SystemExit from thread: main
wrong id called on nil
./lib/sup.rb:64:in `select'
./lib/sup/buffer.rb:31:in `nonblocking_getch'
bin/sup:212

-- 
Michael A. Gurski (opt. [first].)[last]@pobox.com  http://www.pobox.com/~[last]
1024R/39B5BADD PGP: 34 93 A9 94 B1 59 48 B7  17 57 1E 4E 62 56 45 70
1024D/1166213E GPG: 628F 37A4 62AF 1475 45DB  AD81 ADC9 E606 1166 213E
4096R/C0B4F04B GPG: 5B3E 75D7 43CF CF34 4042  7788 1DCE B5EE C0B4 F04B
Views expressed by the host do not reflect the staff, management or sponsors.

---

From: [email-masked] (William Morgan)
Date: Sat, 16 Feb 2008 06:27:49 -0800

Reformatted excerpts from Michael Gurski's message of 2008-02-07:
> --- RuntimeError from thread: load threads for thread-index-mode wrong
> id called on nil

Hm, this is a bit tricky. It looks like on of the thread invariants I
maintain is actually a variant.

Although it would be trivial to just guard against this error, it would
be better to find out why it's happening. Would you mind applying the
following patch (just save it to disk and run "git am" on it from your
sup directory), which will emit some debugging output to send-me.txt
when you run Sup and this error occurs. Then you can send me that file
and maybe I can figure out what's going on.

Thanks!

-- 
William <wmorgan-sup at masanjin.net>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-add-debugging-code-to-discover-when-Thread-first-ret.patch
Type: application/octet-stream
Size: 1416 bytes
Desc: not available
Url : http://rubyforge.org/pipermail/sup-talk/attachments/20080216/39492fd5/attachment.obj

---

From: [email-masked] (William Morgan)
Date: Mon, 17 Mar 2008 09:37:41 -0700

> maintain is actually a variant.

I think this should be fixed at this point.