From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Fri, 16 Jun 2000 14:57:39 -0400 From: Ish Rattan Message-Id: <200006161857.OAA11131@pali.cps.cmich.edu> To: 9fans@cse.psu.edu Subject: [9fans] C-program error.. Topicbox-Message-UUID: c1d9c924-eac8-11e9-9e20-41e7f4b1d025 Hello, Just tried translation of an old alef program. The program aborts with run time error. Source and output given below. Any pointers? - ishwar ---- /* First C program, uses channel and procs.. dies horribly.. */ #include #include #include #define STACKSIZE (2*2048) void recvit(void *arg) { char *s; Channel *in = arg; recv(in, s); print("%s\n", s); } void threadmain(int argc, char *argv[]) { char m[32]; Channel *sch; sch = chancreate(sizeof(m), 0); strcpy(m, "hello world!"); print("main: %s\n", m); proccreate(recvit, (void *)sch, STACKSIZE); send(sch, m); print("done\n"); exits(nil); } --- main: hello world! done hello world! panic: D2B called on non-block 510a8 8.out 513: suicide: sys: trap: fault read addr=0x0 pc=0x00003fd1 ---