From mboxrd@z Thu Jan 1 00:00:00 1970 To: 9fans@9fans.net From: erik quanstrom Date: Fri, 29 Aug 2008 14:26:48 -0400 Message-ID: In-Reply-To: <48B7C999.6090109@gmx.de> References: <48B6A660.2080308@gmx.de> <4be02306ffb650f91d3c167024c106b2@coraid.com> <48B7C999.6090109@gmx.de> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit Subject: Re: [9fans] notes and traps Topicbox-Message-UUID: 0aa956e6-ead4-11e9-9d60-3106f5b1d025 > i can reproduce it with this: > > http://cm.bell-labs.com/sources/contrib/cinap_lenrek/traptest/ > > 8c test.c > 8a int80.s > 8l test.8 int80.8 > ./8.out > > 8.out 12490667: suicide: sys: trap: general protection violation > pc=0x00001333 okay. it seems pretty clear from the code that you're dead meat if you receive a note while you're in the note handler. that is, up->notified = 1. it looks pretty clear that this is intentional. i don't see why one couldn't get 3-4 note before the note handler is called, however. given this, calling sleep() from the note handler is an especially bad idea. however, on a multiprocessor (or if you get scheduled by a clock tick on a up), you're still vulnerable. this is akin to hitting ^c twice quickly — and watching one's shell exit. it would be good to track down what's really going on in your vm. how many processors does plan 9 think it has? i did some looking to see if i could find any discussions on the implementation of notes and didn't find anything in my quick scan. it would be very interesting to have a little perspective from someone who was there. - erik