9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* Re: [9fans] debugging p9p threads question
@ 2005-08-03  0:12 YAMANASHI Takeshi
  2005-08-03  0:31 ` Skip Tavakkolian
  0 siblings, 1 reply; 13+ messages in thread
From: YAMANASHI Takeshi @ 2005-08-03  0:12 UTC (permalink / raw)
  To: 9fans

> interesting, that's the answer in the supercomputing world too. 

Interesting.  I'm tutoring high school students in a
programming contest right now.  They are writing their codes
with emacs/vi and running their MPI jobs on Origin 2k.

One of the contestants told me .NET was a far better interface
for programming, which included everything like editor,
compiler, debugger, online manuals and what not.

Actually, he even showed me debugging fruently on .NET.
I rather felt old then...
# no flame intended
-- 



^ permalink raw reply	[flat|nested] 13+ messages in thread
* [9fans] debugging p9p threads question
@ 2005-08-02 22:42 Ronald G. Minnich
  2005-08-02 22:48 ` Russ Cox
  0 siblings, 1 reply; 13+ messages in thread
From: Ronald G. Minnich @ 2005-08-02 22:42 UTC (permalink / raw)
  To: 9fans


I'm hacking on sshnet and have truncated it and ported it to linux, but it 
is not quite baked. One odd thing I've seen: I've truncated the last bit 
of it to this:

void
threadmain(int argc, char **argv)
{
        char *user, *service;
/*
        fmtinstall('B', mpfmt);
        fmtinstall('H', encodefmt);
*/
        service = nil;
        user = nil;
        ARGBEGIN{
        case 'B':       /* undocumented, debugging */
                doabort = 1;
                break;
        case 'D':       /* undocumented, debugging */
                debuglevel = strtol(EARGF(usage()), nil, 0);
                break;
        case '9':       /* undocumented, debugging */
                chatty9p++;
                break;
        case 's':
                service = EARGF(usage());
                break;
        default:
                usage();
        }ARGEND

        if(argc)
                usage();
//      sshmsgchan = chancreate(sizeof(Msg*), 16);
        fsreqchan = chancreate(sizeof(Req*), 0);
        fsreqwaitchan = chancreate(sizeof(void*), 0);
        fsclunkchan = chancreate(sizeof(Fid*), 0);
        fsclunkwaitchan = chancreate(sizeof(void*), 0);

        proccreate(fsnetproc, nil, 8192);

        threadpostmountsrv(&fs, service, nil, MREPL|MCREATE);
        fprint(2, "threadpostmountsrv RETURNS!~!!!!!!\n");
        threadexitsall(0);
}

If I run this program, the fsnetproc will get a SIGUSR1, but not long 
after, will get a SIGUSR2; in fact, it gets the SIGUSR2 after the first 
time the server sends it a send and the does a recv. If I do this:

.
.
.
        
        proccreate(fsnetproc, nil, 8192);
        
        threadpostmountsrv(&fs, service, nil, MREPL|MCREATE);
        fprint(2, "threadpostmountsrv RETURNS!~!!!!!!\n");
	while(1)
		yield();
        threadexitsall(0);
}


Then the program will run, just fine.

Any idea what I could have done to break things? I have also done this to 
fsnetproc:

void
fsnetproc(void*v)
{
        ulong path;
        Alt a[4];
        Fid *fid;
        Req *r;

        threadsetname("fsthread");

        a[0].op = CHANRCV;
        a[0].c = fsclunkchan;
        a[0].v = &fid;
        a[1].op = CHANRCV;
        a[1].c = fsreqchan;
        a[1].v = &r;
#ifdef NO
        a[2].op = CHANRCV;
        a[2].c = sshmsgchan;
        a[2].v = &m;
        a[3].op = CHANEND;
#endif

        for(;;){
.
.
.


So I don't think the unitialized sshmsgchan should be a problem. 

I'm actually more interested in this question: how do you go about 
debugging this sort of problem? What's your favorite way to see what's 
going on? strace is pretty good, but not perfect. Do you use acid, or ...

thanks

ron


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2005-08-09 14:48 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-08-03  0:12 [9fans] debugging p9p threads question YAMANASHI Takeshi
2005-08-03  0:31 ` Skip Tavakkolian
2005-08-03  5:49   ` LiteStar numnums
2005-08-03  6:56   ` Tim Newsham
  -- strict thread matches above, loose matches on Subject: below --
2005-08-02 22:42 Ronald G. Minnich
2005-08-02 22:48 ` Russ Cox
2005-08-02 23:00   ` Ronald G. Minnich
2005-08-02 23:36     ` Charles Forsyth
2005-08-03  7:20     ` Uriel
2005-08-03 10:40       ` Russ Cox
2005-08-03 12:12         ` Ronald G. Minnich
2005-08-06 23:48       ` Harri Haataja
2005-08-09 14:48         ` Gorka guardiola

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).