paulet@terre.matra-espace.fr (Pascal PAULET 6109 FAMI2) (04/12/91)
Hello Xperts, This is the part of the code of an application using ipc mechanisms and X11 protocol. The application crashes on almost every functions started in the case (sooner or later ...) and it crashes on XtDispatchEvent. We have been searching for many days if it was a problem of memory allocation or strange pointers but it doesn't seem to be this kind of things. Thank you for help ! { XEvent evt; /* Sockets initialization */ X11_socket = ConnectionNumber(ux_current_display()); HPMESS_socket = ipc_get_pm_pip(ipc); while(1) { /* Socket Selection */ FD_ZERO(&fd_read); FD_SET(X11_socket,&fd_read); FD_SET(HPMESS_socket,&fd_read); cr_sel = select( FD_SETSIZE, /* number of fds to be polled */ &fd_read, /* fd read mask */ (fd_set *)0, /* fd write mask */ (fd_set *)0, /* fd except mask */ (struct timeval *)0 /* time out(= infinite) */ ); /* PM_ERR_002 : Error on the select */ if (cr_sel < 0) { perror("*PM_ERR_001* : pm_main_loop | an error occured during select "); break; } /* X11 Evenments Processing (has priority on H-P-MESS messages Processing) */ if (FD_ISSET(X11_socket,&fd_read)) while (XtPending() && (1-screen_frozen)) { XtNextEvent(&evt); XtDispatchEvent(&evt); } /* H-P-MESS messages Processing */ if (FD_ISSET(HPMESS_socket,&fd_read)) { read(HPMESS_socket,buf,1); ipc_receive(ipc,&from,&type,&free1,&free2,&content); switch(type) { /* *********** */ /* PM_REQUESTS */ /* *********** */ case PM_REQUEST_CLOSE_CANCEL_TAPE: printf("Not Implemented Yet \n"); break; /* ....... */ /* **************** */ /* NON_OSP MESSAGES */ /* **************** */ case REFUSE_EXIT: printf("PM RECEIVE : REFUSE_EXIT\n"); screen_frozen=0; break; default: printf("*PM WARNING_001* : receive unknown_message \n"); break; } }