Messages in this thread | | | Date | Fri, 15 Aug 2008 23:26:28 +0200 | From | "Vegard Nossum" <> | Subject | Re: 2.6.25.11-97.fc9 (P): idr_remove called for id=236 which is not allocated |
| |
On Fri, Aug 15, 2008 at 5:28 PM, Alan Cox <alan@lxorguk.ukuu.org.uk> wrote: >> ida_remove called for id=112 which is not allocated. >> ida_remove called for id=67 which is not allocated. >> ida_remove called for id=191 which is not allocated. >> ida_remove called for id=23 which is not allocated. >> >> ..and with no backtrace, so I guess it means "not harmful". Sorry for the noise. > > Thats definitely not good and wants digging into further.
Hi,
I've now been digging. This reproduces it accurately:
# mknod fubar c 128 42 # cat fubar <ctrl-c>
idr_remove called for id=42 which is not allocated.
Major nr. 128 is UNIX98_PTY_MASTER_MAJOR. The Documentation/devices.txt tells us to access these through /dev/ptmx only. So when we don't follow that rule, tty_open() is called instead of ptmx_open() when the device is opened. ptmx_open() would allocate a new id to use. But since we call tty_open(), it will use tty->index which is set from get_tty_driver() -- calculated using the minor number that we provided!
The only thing I don't understand is why we don't get _two_ errors on close() -- I would expect to get one for the slave too. But maybe the slave is never created. What do you think of this theory?
Vegard
-- "The animistic metaphor of the bug that maliciously sneaked in while the programmer was not looking is intellectually dishonest as it disguises that the error is the programmer's own creation." -- E. W. Dijkstra, EWD1036
| |