Page Fault

Frank Mehnert fm3 at os.inf.tu-dresden.de
Wed Mar 16 17:14:57 CET 2005


On Wednesday 16 March 2005 16:33, Tiago Jorge wrote:
> i've added some debug and you are right. the error is on the call of the
> socket function. the constructor is right. here is the code of the
> constructor:
>
> FailureDetector::FailureDetector(int new_eid,
>                                  int new_sleep_time,
>                                  vector<int> *new_group,
>                                  //pthread_mutex_t *new_group_lock){
>
> l4lock_t *new_group_lock){
>   eid = new_eid;
>   sleep_time = new_sleep_time;
>   group = new_group;
>   group_lock = new_group_lock;
>   trueFlag_fd = 0x1;
>   stop_flag = false;
>   sock_fd=0;
>
>   LOG("Before start thread\n");
>   fdect = l4thread_create(helper_failure_detector, NULL,
> L4THREAD_CREATE_ASYNC);
>   LOG("After start thread\n");
> }
>
> it passes ok...
>
> then he executes this code:

How is FailureDetector::failureDetector() called?

> void FailureDetector::failureDetector(){
>   heartbeat hb;
>   bool recvfrom_error = false;
>   map<int,heartbeat> received;
>   map<int,heartbeat> pre_suspicious;
>
>   /*initialization procedures*/
>   //pthread_mutex_init(&lock_suspected, NULL);
>   //pthread_mutex_init(&lock_stop, NULL);
>   LOG("before initialize_comm_fd()\n");
>   initialize_comm_fd();
>
> [...]
>
> and the initialize_comm_fd bugs out. here is the code:
>
> void FailureDetector::initialize_comm_fd(){
>   int flags=0, s=0;
>
>   LOG("before socket\n");
>   /* Create socket from which to send */
>   if ((sock_fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) { <--- ERROR!!!!!
>       LOG("socket error\n");
>   }
>   LOG("after socket\n");
> [...]
>

Frank
-- 
## Dept. of Computer Science, Dresden University of Technology, Germany ##
## http://os.inf.tu-dresden.de/~fm3                                     ##
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://os.inf.tu-dresden.de/pipermail/l4-hackers/attachments/20050316/375e70bd/attachment-0001.sig>


More information about the l4-hackers mailing list