9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Axel Belinfante <Axel.Belinfante@cs.utwente.nl>
To: 9fans@cse.psu.edu
Subject: [9fans] thread confusion
Date: Wed, 21 Sep 2005 15:25:30 +0200	[thread overview]
Message-ID: <200509211325.j8LDPU929905@zamenhof.cs.utwente.nl> (raw)

I've been wrestling with the thread library trying
to do resource management in my 802.1x thingy.

This has proven to be harder than I envisioned -
I guess I've been spending more time trying to get this right
(I want this right since it may run as a daemon for a long time,
 doing a new tls handshake every 20 minutes or even more often)
than I think I've spent on the protocol/state machine part :-(

One reason may be that I'm still not very experienced with thread(2).
Another may be that weird things are happening.


A/The main weird thing is that after doing threadint on a thread
(created with proccreate) which presumably is hanging in a read
sometimes(?) the process just disappears without leaving a trace,
even though it is packed with syslog calls
(of which only the first part gets executed).

Actually, it does leave a trace, because when invoking
acid on the main process and doing threads() or stacks()
acid complains that setproc cannot read /proc/XXX/mem
where XXX presumably was the pid of the disappeared process.
(this seems to suggest that also the thread administration
 was not aware of the thread/process dying?)

This is hard to track since I'm not really able to reproduce it,
though I may be able to detect it when it happened.

Any ideas of what might be going on here, or how to debug this?


Another weird thing (bug?) is that threapid always returns -1
(I started looking a bit into this, but maybe someone in the know
 sees the problem immediately)


(furthermore thread(2) and thread.h seem to be inconsistent
 regarding return values of (e.g.) threadint*, threadkill*
 but this is not hard to fix; I could/can submit a patch)

Axel.



             reply	other threads:[~2005-09-21 13:25 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-21 13:25 Axel Belinfante [this message]
2005-09-21 13:53 Fco. J. Ballesteros
2005-09-21 14:32 ` Axel Belinfante
2005-09-21 14:44 Fco. J. Ballesteros
2005-09-21 15:05 ` Axel Belinfante
2005-09-21 15:42   ` Russ Cox
2005-09-21 20:25     ` Axel Belinfante
2005-09-21 20:32       ` Axel Belinfante
2005-09-21 20:37       ` Russ Cox
2005-09-21 22:34         ` Axel Belinfante
2005-09-21 22:44           ` Russ Cox
2005-09-26 18:40       ` rog
2005-09-26 18:52         ` Russ Cox
2005-09-26 19:20           ` rog
2005-09-27 10:12         ` Axel Belinfante
2005-09-21 15:48 Fco. J. Ballesteros

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200509211325.j8LDPU929905@zamenhof.cs.utwente.nl \
    --to=axel.belinfante@cs.utwente.nl \
    --cc=9fans@cse.psu.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).