problem with accept() on Fedora 8


 
Thread Tools Search this Thread
Top Forums Programming problem with accept() on Fedora 8
# 1  
Old 01-11-2008
problem with accept() on Fedora 8

hi,

accept() seems to be still blocking after socket is being closed on our Fedora 8 build. not sure if this is a common problem because i have never experienced this on any other platforms, however i have seen someone else having this issue on Redhat 7 and 9. so is there a socket option fedora is setting differently or anyone know an appropriate method to get that thread out of the accept?

thanks in advance
# 2  
Old 01-11-2008
Post the code section that is problematic or an strace of the process state during the blocking interval after the socket is closed please.
# 3  
Old 01-15-2008
well the code is quite robust so i skip pasting here even pieces of it but i put together a little test where i just spawned a thread which created a socket and called accept. then in the main i waited a few sec and closed the socket and joined the thread. i debugged it and of course it stucked on accept().

Code:
uname({sys="Linux", node="hal9000", ...}) = 0
futex(0x3012adc, FUTEX_WAKE_PRIVATE, 2147483647) = 0
brk(0)                                  = 0x9065000
brk(0x9086000)                          = 0x9086000
clock_gettime(CLOCK_REALTIME, {1200419840, 211248690}) = 0
clock_gettime(CLOCK_REALTIME, {1200419840, 211319847}) = 0
open("/dev/urandom", O_RDONLY)          = 3
fstat64(3, {st_mode=S_IFCHR|0666, st_rdev=makedev(1, 9), ...}) = 0
ioctl(3, SNDCTL_TMR_TIMEBASE or TCGETS, 0xbffe8bbc) = -1 EINVAL (Invalid argument)
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7f3a000
read(3, "\310\foW^R\270\212\315\227\323\250\215\275\235z\267\336\263}\261\0\227\261\275\344\302\201\351\226,H"..., 4096) = 4096
close(3)                                = 0
munmap(0xb7f3a000, 4096)                = 0
fstat64(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 0), ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7f3a000
clock_gettime(CLOCK_REALTIME, {1200419840, 213952202}) = 0
clock_gettime(CLOCK_REALTIME, {1200419840, 214048675}) = 0
clock_gettime(CLOCK_REALTIME, {1200419840, 214158273}) = 0
clock_gettime(CLOCK_REALTIME, {1200419840, 214242900}) = 0
socket(PF_INET, SOCK_STREAM, IPPROTO_TCP) = 3
bind(3, {sa_family=AF_INET, sin_port=htons(6111), sin_addr=inet_addr("0.0.0.0")}, 16) = 0
setsockopt(3, SOL_SOCKET, SO_LINGER, {onoff=1, linger=0}, 8) = 0
ioctl(3, FIONBIO, [0])                  = 0
mmap2(NULL, 10489856, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7524000
mprotect(0xb7524000, 4096, PROT_NONE)   = 0
clone(child_stack=0xb7f244a4, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, parent_tidptr=0xb7f24bd8, {entry_number:6, base_addr:0xb7f24b90, limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, seg_not_present:0, useable:1}, child_tidptr=0xb7f24bd8) = 19928
clock_gettime(CLOCK_REALTIME, {1200419840, 215085087}) = 0
write(1, "starting..(0 s) [test] started o"..., 44) = 44
nanosleep({3, 0}, {0, 1132736})         = 0
close(3)                                = 0
futex(0xb7f24bd8, FUTEX_WAIT, 19928, NULL) = ? ERESTARTSYS (To be restarted)

i'am pretty sure it's something with fedora cause this software have successfully ran on a whole bunch of various platforms.
# 4  
Old 01-16-2008
After a view of the strace it looks like the block is related to a mutex lock dude.
# 5  
Old 01-16-2008
did you compile it with all warnings turned on? If not, can you. If so did you receive any warnings?
# 6  
Old 01-16-2008
Quote:
Originally Posted by ramen_noodle
After a view of the strace it looks like the block is related to a mutex lock dude.
if you think that cause of the last line, it's cause of joining the thread and the thread stucks cause of its still in the accept() even after the close is called on that socket. i tried this test now on freebsd and redhat 8 too and its running fine there.
# 7  
Old 01-16-2008
Quote:
Originally Posted by frank_rizzo
did you compile it with all warnings turned on? If not, can you. If so did you receive any warnings?
using -Wall -W and besides unused parameters there are no warnings
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Linux

Problem with CRONTAB on Fedora and CentOS

Hello, Can anyone please explain HOW Crontab i.e. job scheduling daemon works in Fedora and CentOS or any Linux platform(Ubuntu).... What are the points that i have to take care of if have to include a script to be run at a specific scheduled time. URGENT reply requested. Please help (1 Reply)
Discussion started by: Vabiosis
1 Replies

2. Red Hat

Problem booting Fedora 11 x86_64

Hi, I am having booting issue with Fedora 11 x86_64 (64-bit version) on my laptop. Laptop configuration is as below: OS : Windows Vista Home Premium (64-bit) Processor : Intel Core 2 Duo T6400 2.0 GHz RAM : 4 GB Tried following different way for installation: 1. Installed Fedora 11 on... (2 Replies)
Discussion started by: r2kv2k
2 Replies

3. Linux

Problem mounting extern hd (fedora 9)

Hi there, I'm having a bit of a strange problem which I would appreciate some help with. The Problem: I have two external hard drives, but I'm borrowing one off my parents to copy data too (one of mine, which is identical to theirs - WD MyBook 300g - is on its way out). Fedora 9 recognizes... (3 Replies)
Discussion started by: lasthidingplace
3 Replies

4. SuSE

Fedora 9 problem

I appeal to all those of you that have experience with Fedora 9 for help. I am trying to install a suite of software which tries to make changes to the /etc/dhcpd.conf file. After the changes have been made the dhcpd service will not start and the original conf file is restored. However dhcpd... (1 Reply)
Discussion started by: johnf
1 Replies

5. Red Hat

Problem installing perlcc in fedora 9

Hi guys i installed fedora 9 in my system. i installed perl-devel rpm and perl-5.10.0 rpm. But perlcc not in /usr/bin/ directory.But perl,perldoc binaris installed. i am new one for linux. (3 Replies)
Discussion started by: viveksnv
3 Replies

6. Linux

Problem about Fedora directory permission

Problem about Fedora directory permission,can anyone help me? In fedora,I have two ordinary user named user1&user2 in different groups,when I logined user1 and created a dir named test/ in '/home/ user1/',and do 'chmod 750 test',so when 'ls -l',it appears 'drwxr- x---' for 'test',but when I... (3 Replies)
Discussion started by: zhouq3132
3 Replies

7. Linux

fedora core 6 problem

hi all i am currently using fedora core 3 . i downloaded the iso image of fedora core 6 but after installing the fedora core 6 . while starting linux it gives a error saying init is been killed . wht is happened? thank u (3 Replies)
Discussion started by: nageshrk
3 Replies

8. Gentoo

fedora problem

HI, I installed fedora core 6 on my inspiron 1501. After I boot it gives me the following error, PCI: BIOS BUG #81(00000000) found. (1 Reply)
Discussion started by: linuxuser
1 Replies

9. Shell Programming and Scripting

Urgent problem with SIGCONT and Fedora 4 :(

Hello, I stop a process with kill -s SIGSTOP, but when I try to restart it with kill -s SIGCONT it do nothing. I use Fedora Core 4. Thank you a lot (1 Reply)
Discussion started by: Nene
1 Replies

10. HP-UX

accept problem

Hi, there On HP-UX IA server, when calling 'accept' function in my program, the server never wait the client's connection. Each time, it accepted the request from IP address 0.0.0.0 even there is no client's connection. The server program looks like : main() { . . .... (4 Replies)
Discussion started by: Frank2004
4 Replies
Login or Register to Ask a Question