[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Weird behavior on program execution with gmake (socket + pthreads)
From: |
Axel |
Subject: |
Weird behavior on program execution with gmake (socket + pthreads) |
Date: |
Sat, 11 Sep 2010 23:06:12 +0200 |
Hello everyone,
I make a multi-client server in C++ on Linux with sockets using
pthreads. I have noticed that my program doesn't have the same behavior
whether I use my Makefile or not.
My program runs fine when I type "make run" (the binary is executed
through the Makefile, see the attached file). When I run it by hand or
using gdb (or with python popen4) the thread which manage the new
connections (accept() on the main thread socket) cannot accept them
(accept() returns -1 with errno to "Invalid argument"). I tried to put
the thread code in the main and it worked whether I was using gmake or
not.
So my conclusion is that gmake/my Makefile affects the program execution
via permissions of the thread socket/ressource sharing or something like
this. It maybe something else but I wasn't able to reproduce it anywhere
but with gmake. I'm lost in an unknown land and looking for some help.
Can any one give me a hand on this unexcepted behavior ? Many thanks in
advance.
Axel ANGEL.
Makefile
Description: Text Data
- Weird behavior on program execution with gmake (socket + pthreads),
Axel <=