From owner-freebsd-current@freebsd.org Tue Sep 19 08:28:51 2017 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9B5BEE04650 for ; Tue, 19 Sep 2017 08:28:51 +0000 (UTC) (envelope-from mizhka@gmail.com) Received: from mail-qt0-x234.google.com (mail-qt0-x234.google.com [IPv6:2607:f8b0:400d:c0d::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 54771707D9 for ; Tue, 19 Sep 2017 08:28:51 +0000 (UTC) (envelope-from mizhka@gmail.com) Received: by mail-qt0-x234.google.com with SMTP id s18so2973405qta.3 for ; Tue, 19 Sep 2017 01:28:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=HcPUHKR/HteEOHuc2i7gJmGYe0sJ6sIwY1giGU0bBIY=; b=HDzenmJuX+9wSMBnnsHosbkjzAfXy356/XxHr+ecFVwfXjDFlITwvharHadkraeaAK Wk97chFH323PTmdwFhzgYXR8ksURR2z9Z6KWpg6XKxgi8HokaG2gROBh+XdZVVR+/wSF +sCpiBaJUQAs33wc99WXy0+vIGneLfpQXF/LLq00IgHzD1V+22Gzj/lcjYVxKxz92xrL fqLuw2YlaEIzod1T1Mb5p6y/Ju9ppoOn6WUfgG6EhDxBOyYozD6FsmVPLcZ6SiH9VNqS 6HbeWjhw0hvxN9wkIYNgpImcVw9VZq7QhUxqiA+yRkLz1lyGgDsNJ31lqbFLWA2MR7t/ trSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=HcPUHKR/HteEOHuc2i7gJmGYe0sJ6sIwY1giGU0bBIY=; b=f1uGI5aHs5xiZ0xGVBvT4tfnKUGALMF3Hgy7O0ShwX/kLjjFL57JTDSo3N+URyXJYF MJoNOHL3IgP/B/l3yQaXM2ld3sv/AiZgZQrTZgTqm8gZcKGxRTAtzS4zcfcfJ/j1whKH 0RuJYYTEyQ0kyXs6lRkf8qdd+u+TmMEl3IKXmD/ja3rKs3ugp0KJ10L2yuOBx/HXRDLA vfJKuRPW8gaefdp7ajby8dOEGqr/hWSUJ1Qqkj/1eUA/M52WTTwaX6jroaPmy/dBWQkK iNxFzN+C9CZ93f0s1OWxCNPl+StcQWngum3ZjejFxLM9cUQPYHLigRs3wk+8pTfa9MSD et2g== X-Gm-Message-State: AHPjjUjQmxYR9+VjPHJmxyGs/MslzdAziBh9i4XZKcmi6ZA+n3LEBy3s plCwgeabeiR3ibOJt3p7VVCN9oluQo+nL6gTzQk= X-Google-Smtp-Source: AOwi7QDrinswcD8xhJWTtIg9KwBU4z5nFX31qgcJvxH225hI/g8Dm/QCI5iPe6RJG6MdzJ3xvhHfmvJqSQyUUTKD5Z8= X-Received: by 10.237.63.15 with SMTP id p15mr781124qtf.113.1505809730336; Tue, 19 Sep 2017 01:28:50 -0700 (PDT) MIME-Version: 1.0 Received: by 10.140.85.101 with HTTP; Tue, 19 Sep 2017 01:28:49 -0700 (PDT) In-Reply-To: <20170918114106.jkmpcde6tmvhizhj@vzakharov> References: <20170918114106.jkmpcde6tmvhizhj@vzakharov> From: Michael Zhilin Date: Tue, 19 Sep 2017 11:28:49 +0300 Message-ID: Subject: Re: lldb unusable for regular user To: Vladimir Zakharov Cc: freebsd-current Current Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Sep 2017 08:28:51 -0000 Hi Volodya, It works for me: [mizhka@gidrarium ~/temp/20170919]$ cc -O0 -g test.c -o test [mizhka@gidrarium ~/temp/20170919]$ ./test PID: 12293 (failed reverse-i-search)`': ^C [mizhka@gidrarium ~/temp/20170919]$ ./test PID: 12294 load: 0.68 cmd: test 12294 [nanslp] 1.39r 0.00u 0.00s 0% 2316k load: 0.68 cmd: test 12294 [nanslp] 3.57r 0.00u 0.00s 0% 2316k load: 0.68 cmd: test 12294 [nanslp] 3.88r 0.00u 0.00s 0% 2316k load: 0.68 cmd: test 12294 [nanslp] 4.18r 0.00u 0.00s 0% 2316k load: 0.71 cmd: test 12294 [nanslp] 8.57r 0.00u 0.00s 0% 2316k load: 0.71 cmd: test 12294 [nanslp] 9.33r 0.00u 0.00s 0% 2316k load: 0.71 cmd: test 12294 [nanslp] 9.83r 0.00u 0.00s 0% 2316k [mizhka@gidrarium ~/temp/20170919]$ lldb ./test (lldb) target create "./test" Current executable set to './test' (x86_64). (lldb) run Process 12300 launching Process 12300 launched: './test' (x86_64) PID: 12300 Process 12300 exited with status = 0 (0x00000000) (lldb) exit [mizhka@gidrarium ~/temp/20170919]$ uname -a FreeBSD gidrarium 12.0-CURRENT FreeBSD 12.0-CURRENT #2 r321414: Mon Jul 24 21:41:54 MSK 2017 mizhka@gidrarium:/usr/obj/usr/src/sys/GENERIC amd64 [mizhka@gidrarium ~/temp/20170919]$ type lldb lldb is hashed (/usr/bin/lldb) [mizhka@gidrarium ~/temp/20170919]$ /usr/bin/lldb -v lldb version 5.0.0 clang revision 308421 But I have r321414 with small patch: https://reviews.freebsd.org/D11738 Today/tomorrow I'll update to latest revision. Hope this information will be useful for you to identify root cause. Thanks! On Mon, Sep 18, 2017 at 2:41 PM, Vladimir Zakharov wrote: > Hello! > > lldb coredumps for regular user, but works for root. > > > uname -a > FreeBSD vzakharov 12.0-CURRENT FreeBSD 12.0-CURRENT #0 r323675: Sun Sep 17 > 21:14:33 MSK 2017 root@vzakharov:/home/obj/usr/src/sys/GENERIC-NODEBUG > amd64 > > cat test.c > #include > #include > > int main() > { > printf("PID: %d\n", getpid()); > sleep(10); > return 0; > } > > cc -O0 -g test.c -o test > > lldb ./test > (lldb) target create "./test" > Current executable set to './test' (x86_64). > (lldb) run > Process 37758 launching > Process 37758 launched: './test' (x86_64) > Segmentation fault (core dumped) > Exit 139 > > sudo lldb ./test > (lldb) target create "./test" > Current executable set to './test' (x86_64). > (lldb) run > Process 37776 launching > Process 37776 launched: './test' (x86_64) > PID: 37776 > Process 37776 exited with status = 0 (0x00000000) > (lldb) > > > Postmortem by gdb: > > gdb ./test test.core > ... > [New LWP 101456] > Core was generated by `./test'. > Program terminated with signal SIGTRAP, Trace/breakpoint trap. > #0 _start (ap=0x7fffffffe858, cleanup=0x800605910 ) at > /usr/src/lib/csu/amd64/crt1.c:50 > 50 { > (gdb) bt > #0 _start (ap=0x7fffffffe858, cleanup=0x800605910 ) at > /usr/src/lib/csu/amd64/crt1.c:50 > (gdb) f > #0 _start (ap=0x7fffffffe858, cleanup=0x800605910 ) at > /usr/src/lib/csu/amd64/crt1.c:50 > 50 { > > > gdb `which lldb` lldb.core > ... > Reading symbols from /usr/bin/lldb...Reading symbols from > /usr/lib/debug//usr/bin/lldb.debug...done. > done. > [New LWP 101610] > [New LWP 100968] > [New LWP 100126] > [New LWP 101631] > [New LWP 101637] > [New LWP 101662] > [New LWP 101672] > [New LWP 100337] > [New LWP 101593] > Core was generated by `lldb ./test'. > Program terminated with signal SIGSEGV, Segmentation fault. > #0 x86_64_freebsd_fallback_frame_state (context=0x7fffddff6e20, > context=0x7fffddff6e20, fs=0x7fffddff6b70) at ./md-unwind-support.h:60 > 60 ./md-unwind-support.h: No such file or directory. > [Current thread is 1 (LWP 101610)] > (gdb) f > #0 x86_64_freebsd_fallback_frame_state (context=0x7fffddff6e20, > context=0x7fffddff6e20, fs=0x7fffddff6b70) at ./md-unwind-support.h:60 > 60 in ./md-unwind-support.h > (gdb) bt > #0 x86_64_freebsd_fallback_frame_state (context=0x7fffddff6e20, > context=0x7fffddff6e20, fs=0x7fffddff6b70) at ./md-unwind-support.h:60 > #1 uw_frame_state_for (context=context@entry=0x7fffddff6e20, fs=fs@entry=0x7fffddff6b70) > at /wrkdirs/usr/ports/lang/gcc6/work/gcc-6.4.0/libgcc/unwind-dw2.c:1249 > #2 0x0000000804f6cffb in _Unwind_ForcedUnwind_Phase2 (exc=exc@entry=0x806b23230, > context=context@entry=0x7fffddff6e20) at /wrkdirs/usr/ports/lang/gcc6/ > work/gcc-6.4.0/libgcc/unwind.inc:155 > #3 0x0000000804f6d334 in _Unwind_ForcedUnwind (exc=0x806b23230, > stop=0x804631760 , stop_argument=) at > /wrkdirs/usr/ports/lang/gcc6/work/gcc-6.4.0/libgcc/unwind.inc:207 > #4 0x00000008046315c3 in _Unwind_ForcedUnwind (ex=, > stop_func=0xe, stop_arg=0x806b23000) at /usr/src/lib/libthr/thread/ > thr_exit.c:106 > #5 thread_unwind () at /usr/src/lib/libthr/thread/thr_exit.c:172 > #6 _pthread_exit_mask (status=, mask=) at > /usr/src/lib/libthr/thread/thr_exit.c:254 > #7 0x00000008046313eb in _pthread_exit (status=0x806b23000) at > /usr/src/lib/libthr/thread/thr_exit.c:206 > #8 0x0000000804623c0d in thread_start (curthread=0x806b23000) at > /usr/src/lib/libthr/thread/thr_create.c:289 > #9 0x00007fffdddf7000 in ?? () > Backtrace stopped: Cannot access memory at address 0x7fffddff7000 > > -- > Regards, | "In theory there is no difference between theory > Vladimir Zakharov | and practice. In practice there is."- Yogi Berra > _______________________________________________ > freebsd-current@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org" >