[[!meta copyright="Copyright © 2013, 2014 Free Software Foundation, Inc."]] [[!meta license="""[[!toggle id="license" text="GFDL 1.2+"]][[!toggleable id="license" text="Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled [[GNU Free Documentation License|/fdl]]."]]"""]] The *term* translator implements POSIX termios discipline. # Open Issues ## [[open_issues/Term_Blocking]] ## Leaks/Not Re-used/Not Terminating [[!tag open_issue_hurd]] ### IRC, freenode, #hurd, 2013-10-14 good news the terminal leak is related to privilege separation [[tschwinge]] confirming (using `ssh -t [machine] tty`) that with privilege separation enabled there is this problem, and once disabled it goes away. I love how, as an unknowing by-stander, that is somehow good news :-) :) it's a good news because 1/ we have more knowledge about the issue and 2/ it may not even be a hurd bug but rather an openssh-on-hurd bug this explains why i didn't see the issue on anything else (mach/hurd consoles, x terminals) and this will also indirectly solve the screen lockup issue braunr: good catch :) s/a good news/good news/ ah, yes, both definitely good news. Congrats on the progress. i remember we used to disable privilege separation in the past i'll have to dig what made us use it [[news/2010-09]]. interesting, screen seems to be affected nonetheless so it's something common to both screen and ssh privsep apparently, what sshd+privse and screen have in common is a fifo so it's probably a tricky hurd bug actually ### IRC, freenode, #hurd, 2013-10-16 pflocal is leaking ports .. this might be what blocks terminals * pinotree gives braunr a stick of glue thanks pflocal leaks struct sock .. grmbl hm nice, pflocal leaks each time a socket is bound and/or accepted on looks like a simple ref mess braunr: really? yes a leak in pflocal feels strange, never noticed it taking lots of memory (and it's used a lot) it's a port leak well no it's both a memory and port leak not sure which one is the root cause yet i guess server sockets aren't automatically unbound if you want to see the leak, just disable priv separation in ssh (to avoid the terminal leak ....) and write a shell loop to start ssh your_server echo hello google shows mails about the leak in the past i also hope it fixes the terminal leak, although i'm really not sure :( ### IRC, freenode, #hurd, 2013-10-17 hm nice, apparently, there is no pflocal leak but a libdiskfs one ! since ext2fs enables the ifsock shortcut seems like it leaks a reference on sock node deletion braunr: have you looked at libdiskfs/dead-name.c? braunr: I think I'm hunting a very similar problem i'm doing it now I had the problem of dead name notifications not being delivered wow b/c I held no reference to the ports_info thing, so the dead name handler in libports could no longer find the pi struct, so the notification was silently dropped i see but it looks like dropping a node makes sure the associated sockaddr has been deleted if any are you sure the node is dropped in the first place? no well i see something happenning at the pflocal side when removing the node but there is still a send right lingering somewhere (see why we need a global lsof :p) indeed i'll try portinfo with that option we talked about yes 121 => 1682: send (refs: 1) yep, ext2fs still has it (I wonder how portinfo does that...) i guess it imports rights from the target task and see if it gets the same name as a local right makes sense easy to check well, no, it cannot do that for receive rights it creates an empty task just for that purpose and uses mach_port_extract_right but it works as you described, yes so yes it does work for receive rights too yes cool :) so it assumes identical port names are part of the ipc interface something neal said we shouldn't rely on iirc yes, I remember something like that too here is the strange thing node->sockaddr is deallocated on a dead name notification drop_node checks that sockaddr is null so how can the dead name notification occur before the node is dropped ? so maybe the node is still around indeed apparently, libdiskfs considers the address holds a reference on the node on the other hand, the server socket won't get released unless the address gets a no-sender notification ... this should probably be turned into a weak reference teythoon: indeed, the node is leaked pflocal crashes when removing correctly deallocating addresses and removing server sockets :/ ok, pflocal bug fixed still have to fix the libdiskfs leak and libdiskfs leak fixed too :) i'll build hurd packages with my changes to make sure i don't break something before comitting and see if this fixes the term issue looks like my patches work just fine :) it doesn't solve the term issue though so, according to portinfo, pflocal has send rights to terminals oO mhhhmmmmmm openssh seems to pass terminal file descriptors through unix sockets when using privilege separation braunr: i a write(sock, &pid, sizeof int) (or the like)? *ie not pid, file descriptors SCM_RIGHTS ah ok the socket send/recv interface does support passing mach ports and the leaked ports do turn into dead names when i kill terminals yes, we support with a patch pochu did few years ago so it seems the leak is related to libpipe this time ok got it :) pflocal used copy_send instead of move_send \o/ that bug was such a pain * braunr happy :) speaking of it, in pflocal' S_socket_recv is it correct the "out_flags = 0;"? nice catch although i wonder why flags are returned it may have been set to null to tell us that we don't want to return flags pfinet seems to use it but you change a local variable anyway yes it's not useful hmm out_flags is what gets in struct msghdr -> msg_flags so i guess it makes sense to fix it to *out_flags = 0, just to be safe pinotree: do you want me to push it tonight along with the others ? yes please ok thanks! pflocal seems to not leak any memory or ports at all great :> there, patches pushed :) ### IRC, freenode, #hurd, 2014-02-07 btw, as a note, there really are leaks in terminals i managed to get a term server eat up to 300M of memory yesterday ## `screen` Logout Hang [[!tag open_issue_hurd]] ### IRC, freenode, #hurd, 2013-10-14 i fixed term so that screen can shutdown properly read() wouldn't return EIO after terminal hangup ### IRC, freenode, #hurd, 2013-10-17 and the missing EOI prevented screen from correctly shutting down windows