From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12662 invoked by alias); 14 Aug 2008 09:56:04 -0000 Received: (qmail 12651 invoked by uid 22791); 14 Aug 2008 09:56:03 -0000 X-Spam-Check-By: sourceware.org Received: from fg-out-1718.google.com (HELO fg-out-1718.google.com) (72.14.220.152) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 14 Aug 2008 09:55:09 +0000 Received: by fg-out-1718.google.com with SMTP id e12so312677fga.0 for ; Thu, 14 Aug 2008 02:55:06 -0700 (PDT) Received: by 10.86.1.1 with SMTP id 1mr1766849fga.61.1218707706464; Thu, 14 Aug 2008 02:55:06 -0700 (PDT) Received: by 10.86.27.5 with HTTP; Thu, 14 Aug 2008 02:55:06 -0700 (PDT) Message-ID: <568faa340808140255g6f00a83fl4661d015137fbdfc@mail.gmail.com> Date: Thu, 14 Aug 2008 17:27:00 -0000 From: "Kari Nalli" To: gdb@sourceware.org Subject: gdb and muti threads with recvfrom MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_58721_13424578.1218707706445" X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2008-08/txt/msg00176.txt.bz2 ------=_Part_58721_13424578.1218707706445 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Content-length: 2167 Hi I wore little program that some times (not all times may be 1 in 3) behaves different when run in gdb. here is output when run from console $ ./Threads Thread=4 errno=11 Thread=3 errno=11 Thread=2 errno=11 Thread=1 errno=11 Thread=4 errno=11 Thread=3 errno=11 Thread=2 errno=11 Thread=1 errno=11 and from gdb (gdb) run Starting program: /home/nallkar/tmp/gdb_test/Threads [Thread debugging using libthread_db enabled] [New Thread 0xb7f836d0 (LWP 28416)] [New Thread 0xb7f82b90 (LWP 28417)] [New Thread 0xb7581b90 (LWP 28418)] [New Thread 0xb6b80b90 (LWP 28419)] [New Thread 0xb617fb90 (LWP 28420)] Thread=1 errno=4 Thread=1 errno=11 Thread=2 errno=11 Thread=3 errno=11 Thread=4 errno=11 Thread=1 errno=11 Thread=2 errno=11 Thread=3 errno=11 Thread=4 errno=11 gdb information: (gdb) show version GNU gdb 6.8 Copyright (C) 2008 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "i686-pc-linux-gnu". And system information $ ldd Threads linux-gate.so.1 => (0x007f6000) libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00101000) libpthread.so.0 => /lib/libpthread.so.0 (0x00b45000) libc.so.6 => /lib/libc.so.6 (0x009d4000) libm.so.6 => /lib/libm.so.6 (0x00b16000) libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00dc4000) /lib/ld-linux.so.2 (0x009b2000) OS is CentOs 5.x compiled with premtive kernel. 2.6.18-92.1.6.el5.preemptive_kernel_local #1 SMP PREEMPT Mon Aug 4 09:08:42 EEST 2008 i686 i686 i386 GNU/Linux And the intressting function where the prints are comming is recvfrom (no data is send to sockets so they should timeout) According to IEEE Std 1003.1, 2004 Edition After timeout Recvfrom should return with errno set to [EAGAIN] or [EWOULDBLOCK]. In my system related errno defines are #define EINTR 4 /* Interrupted system call */ #define EAGAIN 11 /* Try again */ can any one tell what causes the different behaviour? Br, Kari --Kari ------=_Part_58721_13424578.1218707706445 Content-Type: application/x-gzip; name=test.tgz Content-Transfer-Encoding: base64 X-Attachment-Id: f_fjv711tz0 Content-Disposition: attachment; filename=test.tgz Content-length: 2233 H4sIAIH9o0gAA+0YaW+bSDSf+RWvrjbCDvGVS6q31RKbJKjEWJg0rborC8PY TIoBMUNSb5X/vm8GfMRN1E/darU8ReB3n/OAuGFGvIA1/TTd+1nQRjg9PZb3 s507wslpp7PX6bRP2mfHx6ed071256jdPduD9k+LaAtyxr0MYC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