Subject: Broken pointers again, and again, and ..... (This message is being sent to all CPSC 360 students) I have seen a virtually unending stream of errors of the following type: 337 rps_buf_t *buf; 338 rps_hdr_t *hdr; 339 struct timeval tv; 340 341 struct sockaddr_in remote; 342 unsigned int addrlen = sizeof(remote); 343 344 dprintf("rps_sender: starting with sock %p in state %d \n", 345 rpsock, rpsock->state); 346 347 while(rpsock->state != RPS_SHUTDOWN) 348 { 349 // ask ring_get_item to return index of next available item in send ring 350 dprintf("rps_sender before item wait with items %d \n", \ 351 (&rpsock->sndring)->items); 352 item = ring_get_item(&rpsock->sndring); 353 dprintf("rps_sender after item wait with item %d \n", item); 354 355 // return if the item index is -1 356 if(item == -1) 357 return; 358 359 // this code is not used in the typing speed version 360 //while(rps_usable_window() == 0) 361 // wait on win_cv 362 363 // compute the address of the hdr element of the buffer 364 hdr = &buf->hdr; Note that uninitialized pointer *buf is declared in 337 and then is used in line 364. For a variety of reasons, a number of you have weaknesses regarding pointer use, but there is no reason to continue making THIS error. To avoid doing so you should visually audit each function of your ENTIRE program. For each pointer declared as a local variable (inside the function), use your text editor's find and replace facility to find the NEXT occurrence of that variable. (For buf declared on line 337 the next occurrence is on line 364). If, in this next occurence, the pointer variable either (a) appears on the RIGHT side of an assignment statement or (b) is passed to another function Then YOU HAVE MADE THIS ERROR. It should be clear that you don't have to understand how to use pointers correctly AT ALL to be able to IDENTIFY this problem. You ONLY have to be able to: (1) recognize a pointer declaration (2) understand what the right side of an assignment statement is and (3) understand what a function call is I am 110% confident that even the most Java afflicted amongst you are quite capable of doing that! ---------------------------------------------------------------- All that said, I FULLY AGREE with the statement... "But, but Dr. Westall even if I can find the problem now, that still doesn't mean I can fix it because I don't know how to set the pointer correctly" To that I say: (1) use the notes and the msgs for relevant examples but if after a diligent search you still can't find any (2) ASK ME HOW to set the pointer. We are wasting FAR too much of BOTH YOUR TIME and mine by attempting to work with code containing FATAL problems that even a non-programmer could identify with a little bit of effort.