Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 10 Dec 2012 16:27:58 +0200
From:      Artyom Mirgorodskiy <artyom@ijminteractive.net>
To:        freebsd-current@freebsd.org
Cc:        Gleb Smirnoff <glebius@freebsd.org>, freebsd-current@freebsd.org
Subject:   Re: rev 244030 route command is not working
Message-ID:  <2837017.6IXeElfWaT@home.alkar.net>
In-Reply-To: <20121210134057.GN48639@FreeBSD.org>
References:  <2452291.zQQ4fSp1fM@home.alkar.net> <20121210134057.GN48639@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Before calling fiboptlist_csv() the errno = EINVAL. I hope this help to solve problem.

On Monday 10 December 2012 17:40:57 Gleb Smirnoff wrote:
> On Sat, Dec 08, 2012 at 01:00:57PM +0200, Artyom Mirgorodskiy wrote:
> A> I just upgraded to revision 244030. Unexpected route command is not working:
> A> 
> A> #route add default 192.168.1.1
> A> route: fiboptlist_csv failed.
> 
> What does 'sysctl net.my_fibnum' say?
> 
> 
> 
-- 
This message is for the person(s) named above only and may contain privileged, proprietary, or otherwise private information. If you received this transmission in error, please notify the sender immediately and delete the original. Any other use of the email by you is prohibited.
From owner-freebsd-current@FreeBSD.ORG  Mon Dec 10 17:35:53 2012
Return-Path: <owner-freebsd-current@FreeBSD.ORG>
Delivered-To: freebsd-current@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
 by hub.freebsd.org (Postfix) with ESMTP id 1528231E
 for <freebsd-current@freebsd.org>; Mon, 10 Dec 2012 17:35:53 +0000 (UTC)
 (envelope-from freebsd-current@m.gmane.org)
Received: from plane.gmane.org (plane.gmane.org [80.91.229.3])
 by mx1.freebsd.org (Postfix) with ESMTP id 9D3098FC15
 for <freebsd-current@freebsd.org>; Mon, 10 Dec 2012 17:35:52 +0000 (UTC)
Received: from list by plane.gmane.org with local (Exim 4.69)
 (envelope-from <freebsd-current@m.gmane.org>) id 1Ti7Gj-000682-5M
 for freebsd-current@freebsd.org; Mon, 10 Dec 2012 18:35:53 +0100
Received: from 208.85.208.53 ([208.85.208.53])
 by main.gmane.org with esmtp (Gmexim 0.1 (Debian))
 id 1AlnuQ-0007hv-00
 for <freebsd-current@freebsd.org>; Mon, 10 Dec 2012 18:35:53 +0100
Received: from atkin901 by 208.85.208.53 with local (Gmexim 0.1 (Debian))
 id 1AlnuQ-0007hv-00
 for <freebsd-current@freebsd.org>; Mon, 10 Dec 2012 18:35:53 +0100
X-Injected-Via-Gmane: http://gmane.org/
To: freebsd-current@freebsd.org
From: Mark Atkinson <atkin901@gmail.com>
Subject: Re: problems with threads/destructors in -current with llvm/clang
Date: Mon, 10 Dec 2012 09:35:29 -0800
Lines: 112
Message-ID: <ka56gv$t60$1@ger.gmane.org>
References: <k9qjml$ri7$1@ger.gmane.org> <50C1E81A.1040107@FreeBSD.org>
 <50C1F862.2010501@FreeBSD.org> <k9t6bq$bhs$1@ger.gmane.org>
 <50C22789.3030303@FreeBSD.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-Complaints-To: usenet@ger.gmane.org
X-Gmane-NNTP-Posting-Host: 208.85.208.53
User-Agent: Mozilla/5.0 (X11; FreeBSD i386;
 rv:17.0) Gecko/17.0 Thunderbird/17.0
In-Reply-To: <50C22789.3030303@FreeBSD.org>
X-Enigmail-Version: 1.4.6
Cc: kde-freebsd@freebsd.kde.org
X-BeenThere: freebsd-current@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: Discussions about the use of FreeBSD-current
 <freebsd-current.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/freebsd-current>, 
 <mailto:freebsd-current-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/freebsd-current>;
List-Post: <mailto:freebsd-current@freebsd.org>
List-Help: <mailto:freebsd-current-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/freebsd-current>,
 <mailto:freebsd-current-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 10 Dec 2012 17:35:53 -0000

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 12/07/2012 09:29, Dimitry Andric wrote:
> On 2012-12-07 17:43, Mark Atkinson wrote:
>> On 12/7/2012 6:08 AM, Dimitry Andric wrote:
> ...
>>> With this patch (placed in /usr/ports/devel/dbus-qt4/files),
>>> qdbus starts up and exits normally for me.  I did not do any
>>> other rigorous testing, though. :)
>> 
>> Thanks for the awesome analysis.  I will endeavor to figure out
>> the bug in automoc4 that keeps it segfaulting randomly during
>> compilation.
>> 
>> Weirdly it segfaults reliably under portmaster, but may work just
>> fine under just make.
> 
> Try running it under valgrind.  If it does undefined things, it may
> work or not work randomly, and valgrind usually catches this.

OK, so this one's a bit of a headscratcher, but maybe someone has some
ideas.  automoc4 always dies in libthr.

#0  0x2864b1da in swapcontext () from /lib/libthr.so.3
[New Thread 29003800 (LWP 100960/automoc4.bin)]
[New Thread 29003080 (LWP 101795/automoc4.bin)]
(gdb) bt
#0  0x2864b1da in swapcontext () from /lib/libthr.so.3
#1  0x2864a046 in pthread_getspecific () from /lib/libthr.so.3
#2  0x28649e9a in pthread_getspecific () from /lib/libthr.so.3
#3  0x2864dbfb in pthread_kill () from /lib/libthr.so.3
#4  0x28064e71 in _rtld_get_stack_prot () from /libexec/ld-elf.so.1
#5  0x2865d500 in _thread_state_running () from /lib/libthr.so.3
#6  0x2865d500 in _thread_state_running () from /lib/libthr.so.3
#7  0x28075e00 in ?? ()
#8  0x286b4d30 in pipe () from /lib/libc.so.7
#9  0x280712ac in ?? () from /libexec/ld-elf.so.1
#10 0xbf9fce2c in ?? ()
#11 0x2805e505 in r_debug_state () from /libexec/ld-elf.so.1
#12 0x28071f68 in ?? () from /libexec/ld-elf.so.1
#13 0xbf9fcde0 in ?? ()
#14 0xbf9fce18 in ?? ()
#15 0x00000001 in ?? ()
#16 0x00000000 in ?? ()
(gdb) thread 2
[Switching to thread 2 (Thread 29003080 (LWP 101795/automoc4.bin))]#0
 0x2876c3a7 in select () from /lib/libc.so.7
(gdb) bt
#0  0x2876c3a7 in select () from /lib/libc.so.7
#1  0x286481ab in select () from /lib/libthr.so.3
#2  0x28365c49 in qt_safe_select (nfds=17, fdread=0xbfbfa090,
fdwrite=0xbfbfa010, fdexcept=0x0, orig_timeout=0x0) at
kernel/qcore_unix.cpp:83
#3  0x282c23b2 in select_msecs (nfds=17, fdread=0xbfbfa090,
fdwrite=0xbfbfa010, timeout=-1) at io/qprocess_unix.cpp:998
#4  0x282c33f3 in QProcessPrivate::waitForFinished (this=0x29089300,
msecs=-1) at io/qprocess_unix.cpp:1219
#5  0x28240b50 in QProcess::waitForFinished (this=0xbfbfa1e8,
msecs=-1) at io/qprocess.cpp:1759
#6  0x0805487b in AutoMoc::echoColor (this=0xbfbfab00,
msg=@0xbfbfa2e0) at
/usr/ports/devel/automoc4/work/automoc4-0.9.88/kde4automoc.cpp:74
#7  0x08052650 in AutoMoc::generateMoc (this=0xbfbfab00,
sourceFile=@0x29011658, mocFileName=@0x2901165c) at
/usr/ports/devel/automoc4/work/automoc4-0.9.88/kde4automoc.cpp:569
#8  0x0804f13b in AutoMoc::run (this=0xbfbfab00) at
/usr/ports/devel/automoc4/work/automoc4-0.9.88/kde4automoc.cpp:470
#9  0x0804aaef in main (argc=6, argv=0xbfbfab98) at
/usr/ports/devel/automoc4/work/automoc4-0.9.88/kde4automoc.cpp:114

I noticed that qt_safe_select() used a register bound variable for the
return value, but removing that didn't alleviate the error.

The pthread_getspecific() manpage mentions that if the key is deleted
then the behavior is undefined -- so maybe this?  It's definitely
seems like a race condition of some kind.

Valgrind will kill any run of automoc4 and doesn't like some
instruction after the qt_safe_select() call:

vex x86->IR: unhandled instruction bytes: 0xF 0xB 0x90 0x90
==33074== valgrind: Unrecognised instruction at address 0x380434e9.
==33074==    at 0x380434E9: ??? (in
/usr/local/lib/valgrind/memcheck-x86-freebsd)
==33074==    by 0x323C48: qt_safe_select(int, fd_set*, fd_set*,
fd_set*, timeval const*) (qcore_unix.cpp:83)
==33074==    by 0x2803B1: select_msecs(int, fd_set*, fd_set*, int)
(qprocess_unix.cpp:998)
==33074==    by 0x28021D: QProcessPrivate::waitForStarted(int)
(qprocess_unix.cpp:1031)
==33074==    by 0x1FFA02: QProcess::waitForStarted(int)
(qprocess.cpp:1687)
==33074==    by 0x1FEAEA: QProcess::waitForFinished(int)
(qprocess.cpp:1752)
==33074==    by 0x805487A: AutoMoc::echoColor(QString const&)
(kde4automoc.cpp:74)
==33074==    by 0x805264F: AutoMoc::generateMoc(QString const&,
QString const&) (kde4automoc.cpp:569)
==33074==    by 0x804F13A: AutoMoc::run() (kde4automoc.cpp:470)
==33074==    by 0x804AAEE: main (kde4automoc.cpp:114)

Full valgrind output is at http://pastebin.com/KQTKYGX5

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (FreeBSD)
Comment: Using GnuPG with undefined - http://www.enigmail.net/

iEYEARECAAYFAlDGHWEACgkQrDN5kXnx8yZEUwCfXhKBqCJKJcfomG6mHo6ataaw
x60An36saeyL2b09CR2Z/zL84KzjPjsQ
=EzG3
-----END PGP SIGNATURE-----




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?2837017.6IXeElfWaT>