Yep, that looks like a smoking gun to me.

-Kenton

On Mon, Nov 9, 2020 at 2:41 PM Zachary Dremann <[email protected]> wrote:

> This looks related:
> https://lists.debian.org/debian-glibc/2014/01/msg00023.html
>
> I rebuilt everything in the same way on an ubuntu 16.04 VM, and I don't
> get the segfault. I don't need to use fibers, so I'm okay to just avoid
> them.
>
> On Friday, November 6, 2020 at 1:20:53 PM UTC-5 [email protected]
> wrote:
>
>> Hi Zachary,
>>
>> It looks like the segfault is happening in glibc's backtrace() function
>> while gathering the stack trace for an exception. An exception is actually
>> expected here (the test case tests throwing an exception). Since it
>> happened specifically in fiber-related tests, my guess is that glibc's
>> backtrace has a bug in which it is confused by the stack manipulation done
>> by fibers.
>>
>> 14.04 is quite old, so I imagine you're using a pretty old glibc here?
>> Maybe this is a glibc bug that was fixed in newer versions?
>>
>> Note that fibers are new and completely optional feature of KJ. If you
>> don't use them then you can probably ignore the test failure.
>>
>> -Kenton
>>
>> On Wed, Nov 4, 2020 at 4:27 PM Zachary Dremann <[email protected]> wrote:
>>
>>> I'm running on Ubuntu 14.04, 32 bit.
>>>
>>> I have a custom g++ 10.1.0 as g++-10 installed in /usr/local, built from
>>> source with no modifications or customizations
>>>
>>> I cloned from master (commit 96936a7446164424d8f3f50430d83ee21f63f6a2),
>>> and ran `autoreconf -fi`, then `./configure --without-openssl
>>> --with-pic LDFLAGS='-L/usr/local/lib -Wl,-rpath,/usr/local/lib'
>>> CXX=/usr/local/bin/g++-10`, followed by `make`, and `make check`.
>>>
>>> `VERBOSE=1 make check` fails with (truncated to show interesting stuff):
>>>
>>> [ TEST ] kj/async-test.c++:860: start a fiber
>>> [ PASS ] kj/async-test.c++:860: start a fiber (112 μs)
>>> [ TEST ] kj/async-test.c++:881: fiber promise chaining
>>> [ PASS ] kj/async-test.c++:881: fiber promise chaining (9 μs)
>>> [ TEST ] kj/async-test.c++:904: throw from a fiber
>>> /bin/bash: line 5: 22656 Segmentation fault      (core dumped) ${dir}$tst
>>> FAIL: capnp-test
>>> Randomly testing backwards-compatibility scenarios with seed: 1604520183
>>> PASS: capnp-evolution-test
>>> PASS: src/capnp/compiler/capnp-test.sh
>>> ===========================================
>>> 1 of 3 tests failed
>>> Please report to [email protected]
>>> ===========================================
>>>
>>> Running `libtool --mode=execute gdb ./capnp-test`, and getting a
>>> backtrace at the time of the segfault gives the following:
>>>
>>> #0  0xb793d71e in x86_fallback_frame_state (context=<optimized out>,
>>> context=<optimized out>, fs=0xb57565b0)
>>>     at ./md-unwind-support.h:132
>>> #1  uw_frame_state_for () at ../../../gcc-10.1.0/libgcc/unwind-dw2.c:1271
>>> #2  0xb793ecb1 in _Unwind_Backtrace () at
>>> ../../../gcc-10.1.0/libgcc/unwind.inc:302
>>> #3  0xb7876d75 in __GI___backtrace (array=0xb5756720, size=34) at
>>> ../sysdeps/i386/backtrace.c:126
>>> #4  0xb7bb098a in kj::getStackTrace(kj::ArrayPtr<void*>, unsigned int) ()
>>>    from /home/build/capnproto/c++/.libs/libkj-0.9-dev.so
>>> #5  0xb7bb0b39 in kj::Exception::extendTrace(unsigned int) () from
>>> /home/build/capnproto/c++/.libs/libkj-0.9-dev.so
>>> #6  0xb7bb0c62 in kj::throwRecoverableException(kj::Exception&&,
>>> unsigned int) ()
>>>    from /home/build/capnproto/c++/.libs/libkj-0.9-dev.so
>>> #7  0x0820011c in kj::Promise<void>::wait(kj::WaitScope&) ()
>>> #8  0x081e1620 in kj::_::Fiber<kj::(anonymous
>>> namespace)::TestCase904::run()::{lambda(kj::WaitScope&)#1}>::runImpl(kj::WaitScope&)
>>> ()
>>> #9  0xb7c36203 in
>>> kj::_::RunnableImpl<kj::_::FiberBase::run()::{lambda()#2}>::run() ()
>>>    from /home/build/capnproto/c++/.libs/libkj-async-0.9-dev.so
>>> #10 0xb7bb0ed2 in kj::_::runCatchingExceptions(kj::_::Runnable&) ()
>>>    from /home/build/capnproto/c++/.libs/libkj-0.9-dev.so
>>> #11 0xb7c3b9de in kj::_::FiberBase::run() () from
>>> /home/build/capnproto/c++/.libs/libkj-async-0.9-dev.so
>>> #12 0xb7c3bdf7 in kj::_::FiberStack::run() () from
>>> /home/build/capnproto/c++/.libs/libkj-async-0.9-dev.so
>>> #13 0xb7c42c09 in kj::_::FiberStack::StartRoutine::run(int, int) ()
>>>    from /home/build/capnproto/c++/.libs/libkj-async-0.9-dev.so
>>> #14 0xb77bbdeb in makecontext () at
>>> ../sysdeps/unix/sysv/linux/i386/makecontext.S:87
>>> #15 0x00008c48 in ?? ()
>>> #16 0x00000862 in ?? ()
>>> #17 0x00000000 in ?? ()
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Cap'n Proto" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to [email protected].
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/capnproto/71489f35-286d-4967-aecd-636276f3dfb4n%40googlegroups.com
>>> <https://groups.google.com/d/msgid/capnproto/71489f35-286d-4967-aecd-636276f3dfb4n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>> --
> You received this message because you are subscribed to the Google Groups
> "Cap'n Proto" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/capnproto/887efc76-33d9-4fb2-8e8e-335bf9adee5dn%40googlegroups.com
> <https://groups.google.com/d/msgid/capnproto/887efc76-33d9-4fb2-8e8e-335bf9adee5dn%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Cap'n Proto" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/capnproto/CAJouXQko9JapYUx9E85VmZa4t1GxtwfD%3DwgmX12MZ%3Dz8zsTipg%40mail.gmail.com.

Reply via email to