<!-- MHonArc v2.4.4 --> <!--X-Subject: [MUD-Dev] Re: LinuxThreads and SIGUSR1 (Ref: [MUD-Dev]) --> <!--X-From-R13: "Oqnz X. Fubeagba" <nqnzNcubravk.Bevaprgba.SRG> --> <!--X-Date: Wed, 12 Aug 1998 16:09:33 -0700 --> <!--X-Message-Id: 19980812190905.B1130#yuma,Princeton.EDU --> <!--X-Content-Type: text/plain --> <!--X-Reference: Pine.SGI.3.95.980811234105.26545E-100000#genome,cbs.dtu.dk --> <!--X-Reference: 19980811150534.F26005#flagstaff,Princeton.EDU --> <!--X-Reference: 19980812143559.B20788#flagstaff,Princeton.EDU --> <!--X-Reference: v04011701b1f7ac85427b#207,153.25.197 --> <!--X-Head-End--> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"> <html> <head> <title>MUD-Dev message, [MUD-Dev] Re: LinuxThreads and SIGUSR1 (Ref: [MUD-Dev])</title> <!-- meta name="robots" content="noindex,nofollow" --> <link rev="made" href="mailto:adam#phoenix,Princeton.EDU"> </head> <body background="/backgrounds/paperback.gif" bgcolor="#ffffff" text="#000000" link="#0000FF" alink="#FF0000" vlink="#006000"> <font size="+4" color="#804040"> <strong><em>MUD-Dev<br>mailing list archive</em></strong> </font> <br> [ <a href="../">Other Periods</a> | <a href="../../">Other mailing lists</a> | <a href="/search.php3">Search</a> ] <br clear=all><hr> <!--X-Body-Begin--> <!--X-User-Header--> <!--X-User-Header-End--> <!--X-TopPNI--> Date: [ <a href="msg00696.html">Previous</a> | <a href="msg00698.html">Next</a> ] Thread: [ <a href="msg00692.html">Previous</a> | <a href="msg00790.html">Next</a> ] Index: [ <A HREF="author.html#00697">Author</A> | <A HREF="#00697">Date</A> | <A HREF="thread.html#00697">Thread</A> ] <!--X-TopPNI-End--> <!--X-MsgBody--> <!--X-Subject-Header-Begin--> <H1>[MUD-Dev] Re: LinuxThreads and SIGUSR1 (Ref: [MUD-Dev])</H1> <HR> <!--X-Subject-Header-End--> <!--X-Head-of-Message--> <UL> <LI><em>To</em>: <A HREF="mailto:mud-dev#kanga,nu">mud-dev#kanga,nu</A></LI> <LI><em>Subject</em>: [MUD-Dev] Re: LinuxThreads and SIGUSR1 (Ref: [MUD-Dev])</LI> <LI><em>From</em>: "Adam J. Thornton" <<A HREF="mailto:adam#phoenix,Princeton.EDU">adam#phoenix,Princeton.EDU</A>></LI> <LI><em>Date</em>: Wed, 12 Aug 1998 19:09:05 -0400</LI> <LI><em>Reply-To</em>: <A HREF="mailto:mud-dev#kanga,nu">mud-dev#kanga,nu</A></LI> </UL> <!--X-Head-of-Message-End--> <!--X-Head-Body-Sep-Begin--> <HR> <!--X-Head-Body-Sep-End--> <!--X-Body-of-Message--> <PRE> On Wed, Aug 12, 1998 at 03:18:53PM -0600, Lucas Thompson wrote: > At 12:35 PM -0600 8/12/1998, Adam J. Thornton wrote: > > An unrelated problem, but a very annoying one. I'm new to Linux threads > > programming. I'm using RH5.1. When I call pthread_create() I get the new > > thread, but also a SIGUSR1. If I don't SIG_IGN it, the program exits (this > > is default behavior for SIGUSR1). But if I *do* ignore it, then the > > process never returns from the thread creation. Did I miss something > > really obvious here? > Odd, I do SIG_IGN our USR1/USR2 signals, but back when I was first adding > our threaded I/O and dns code I don't remember the process exiting when it > got USR1 (back before we added signal handling to our mud). I may be wrong, > it's been a year or so. Are you compiling with -D_REENTRANT? Linking with > pthreads without defining _REENTRANT is a Bad Thing(tm) because your IO > calls will lose their 'errno' and frequently exit falsely even when nothing > went wrong. Ah. A little more digging with a thread-enabled debugger helped. SIGUSR1 and SIGUSR2 are indeed used by Linuxthreads, but what was actually killing me was a SIGSEGV. And that...was because I was passing a NULL pointer to pthread_create as its first argument. Why, you might ask, was I doing that? Well, because that's what Stevens did. But it's wrong. Allocate some space for the pthread_t pointer and pass it, and it works fine. I'll send him a bug report. Adam -- adam#princeton,edu "There's a border to somewhere waiting, and a tank full of time." - J. Steinman </PRE> <!--X-Body-of-Message-End--> <!--X-MsgBody-End--> <!--X-Follow-Ups--> <HR> <!--X-Follow-Ups-End--> <!--X-References--> <UL><LI><STRONG>References</STRONG>: <UL> <LI><STRONG><A NAME="00690" HREF="msg00690.html">[MUD-Dev] Re: clients anyone?...</A></STRONG> <UL><LI><EM>From:</EM> Hans-Henrik Staerfeldt <hhs#cbs,dtu.dk></LI></UL></LI> <LI><STRONG><A NAME="00663" HREF="msg00663.html">[MUD-Dev] Re: clients anyone?...</A></STRONG> <UL><LI><EM>From:</EM> "Adam J. Thornton" <adam#phoenix,Princeton.EDU></LI></UL></LI> <LI><STRONG><A NAME="00692" HREF="msg00692.html">[MUD-Dev] Re: clients anyone?...</A></STRONG> <UL><LI><EM>From:</EM> "Adam J. Thornton" <adam#phoenix,Princeton.EDU></LI></UL></LI> </UL></LI></UL> <!--X-References-End--> <!--X-BotPNI--> <UL> <LI>Prev by Date: <STRONG><A HREF="msg00696.html">[MUD-Dev] Re: WIRED: Kilers have more fun</A></STRONG> </LI> <LI>Next by Date: <STRONG><A HREF="msg00698.html">[MUD-Dev] Re: clients anyone?...</A></STRONG> </LI> <LI>Prev by thread: <STRONG><A HREF="msg00692.html">[MUD-Dev] Re: clients anyone?...</A></STRONG> </LI> <LI>Next by thread: <STRONG><A HREF="msg00790.html">[MUD-Dev] Re: clients anyone?...</A></STRONG> </LI> <LI>Index(es): <UL> <LI><A HREF="index.html#00697"><STRONG>Date</STRONG></A></LI> <LI><A HREF="thread.html#00697"><STRONG>Thread</STRONG></A></LI> </UL> </LI> </UL> <!--X-BotPNI-End--> <!--X-User-Footer--> <!--X-User-Footer-End--> <ul><li>Thread context: <BLOCKQUOTE><UL> <LI><STRONG>[MUD-Dev] Re: clients anyone?...</STRONG>, <EM>(continued)</EM> <ul compact> <ul compact> <LI><strong><A NAME="00665" HREF="msg00665.html">[MUD-Dev] Re: clients anyone?...</A></strong>, Andrew Wilson <a href="mailto:andrew#aaaaaaaa,demon.co.uk">andrew#aaaaaaaa,demon.co.uk</a>, Tue 11 Aug 1998, 21:56 GMT </LI> <LI><strong><A NAME="00689" HREF="msg00689.html">[MUD-Dev] Re: clients anyone?...</A></strong>, Andrew Wilson <a href="mailto:andrew#aaaaaaaa,demon.co.uk">andrew#aaaaaaaa,demon.co.uk</a>, Wed 12 Aug 1998, 17:41 GMT </LI> <LI><strong><A NAME="00690" HREF="msg00690.html">[MUD-Dev] Re: clients anyone?...</A></strong>, Hans-Henrik Staerfeldt <a href="mailto:hhs#cbs,dtu.dk">hhs#cbs,dtu.dk</a>, Wed 12 Aug 1998, 18:08 GMT <UL> <LI><strong><A NAME="00692" HREF="msg00692.html">[MUD-Dev] Re: clients anyone?...</A></strong>, Adam J. Thornton <a href="mailto:adam#phoenix,Princeton.EDU">adam#phoenix,Princeton.EDU</a>, Wed 12 Aug 1998, 18:37 GMT <UL> <LI><EM>Message not available</EM><UL> <LI><strong><A NAME="00697" HREF="msg00697.html">[MUD-Dev] Re: LinuxThreads and SIGUSR1 (Ref: [MUD-Dev])</A></strong>, Adam J. Thornton <a href="mailto:adam#phoenix,Princeton.EDU">adam#phoenix,Princeton.EDU</a>, Wed 12 Aug 1998, 23:09 GMT </LI> </UL> </LI> </UL> </LI> <LI><strong><A NAME="00790" HREF="msg00790.html">[MUD-Dev] Re: clients anyone?...</A></strong>, Adam Wiggins <a href="mailto:adam#angel,com">adam#angel,com</a>, Thu 20 Aug 1998, 18:25 GMT </LI> </UL> </LI> </ul> <LI><strong><A NAME="01064" HREF="msg01064.html">[MUD-Dev] Re: clients anyone?...</A></strong>, J C Lawrence <a href="mailto:claw#under,engr.sgi.com">claw#under,engr.sgi.com</a>, Fri 18 Sep 1998, 20:51 GMT <UL> <LI><strong><A NAME="01081" HREF="msg01081.html">[MUD-Dev] Re: clients anyone?...</A></strong>, Andrew Wilson <a href="mailto:andrew#aaaaaaaa,demon.co.uk">andrew#aaaaaaaa,demon.co.uk</a>, Sun 20 Sep 1998, 00:58 GMT </LI> </UL> </LI> </ul> </LI> <LI><strong><A NAME="00651" HREF="msg00651.html">[MUD-Dev] Re: async i/o and threads (was: Re: lurker emerges</A></strong>, James Wilson <a href="mailto:jwilson#rochester,rr.com">jwilson#rochester,rr.com</a>, Tue 11 Aug 1998, 04:20 GMT </LI> </UL></BLOCKQUOTE> </ul> <hr> <center> [ <a href="../">Other Periods</a> | <a href="../../">Other mailing lists</a> | <a href="/search.php3">Search</a> ] </center> <hr> </body> </html>