Sponsored Content
Top Forums Programming problem with accept() on Fedora 8 Post 302158472 by Akimaki on Tuesday 15th of January 2008 12:06:08 PM
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.
 

10 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

5. 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

6. 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

7. 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

8. 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

9. 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

10. 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
MMAP2(2)						     Linux Programmer's Manual							  MMAP2(2)

NAME
mmap2 - map files or devices into memory SYNOPSIS
#include <sys/mman.h> void *mmap2(void *addr, size_t length, int prot, int flags, int fd, off_t pgoffset); DESCRIPTION
The mmap2() system call operates in exactly the same way as mmap(2), except that the final argument specifies the offset into the file in 4096-byte units (instead of bytes, as is done by mmap(2)). This enables applications that use a 32-bit off_t to map large files (up to 2^44 bytes). RETURN VALUE
On success, mmap2() returns a pointer to the mapped area. On error -1 is returned and errno is set appropriately. ERRORS
EFAULT Problem with getting the data from userspace. EINVAL (Various platforms where the page size is not 4096 bytes.) offset * 4096 is not a multiple of the system page size. mmap2() can return any of the same errors as mmap(2). VERSIONS
mmap2() is available since Linux 2.3.31. CONFORMING TO
This system call is Linux-specific. NOTES
Nowadays, the glibc mmap() wrapper function invokes this system call rather than the mmap(2) system call. On ia64, the unit for offset is actually the system page size, rather than 4096 bytes. SEE ALSO
getpagesize(2), mmap(2), mremap(2), msync(2), shm_open(3) COLOPHON
This page is part of release 3.27 of the Linux man-pages project. A description of the project, and information about reporting bugs, can be found at http://www.kernel.org/doc/man-pages/. Linux 2008-04-22 MMAP2(2)
All times are GMT -4. The time now is 09:05 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy