On Thursday, November 28, 2019 at 3:08:53 AM UTC-5, Nadav Har'El wrote:
>
>
> On Thu, Nov 28, 2019 at 8:00 AM Waldek Kozaczuk <[email protected]
> <javascript:>> wrote:
>
>> I have been trying to upgrade unit tests to use boost from host instead
>> of depending on externals. One one the previous patches I sent fixed
>> compilation errors.
>>
>> However when I update the tests makefile and manifest file I see that
>> some tests fail with very similar page fault error on Fedora 30 which comes
>> with boost 1.69.0. The same tests pass just fine on latest Ubuntu 19.10 hat
>> comes with older boost 1.67.0.
>>
>
> Just to make sure, please make sure to delete the old compilation results
> ("make clean") so we don't see some mixture of old and new stuff.
>
Did not help.
>
>
>>
>> Here is the patch:
>> diff --git a/modules/tests/Makefile b/modules/tests/Makefile
>> index e4ef8dcc..a5633308 100644
>> --- a/modules/tests/Makefile
>> +++ b/modules/tests/Makefile
>> @@ -177,12 +177,9 @@ zfs-only-boost-tests := tst-rename.so
>>
>> boost-tests += $($(fs_type)-only-boost-tests)
>>
>> -BOOSTLIBS=$(src)/external/$(ARCH)/misc.bin/usr/lib64
>> $(boost-tests:%=$(out)/tests/%): LIBS += \
>> - $(BOOSTLIBS)/libboost_unit_test_framework.so \
>> - $(BOOSTLIBS)/libboost_filesystem.so
>> -$(boost-tests:%=$(out)/tests/%): CXXFLAGS += -D_GLIBCXX_USE_CXX11_ABI=0 \
>> - -isystem $(src)/external/$(ARCH)/misc.bin/usr/include
>> + -lboost_unit_test_framework \
>> + -lboost_filesystem
>>
>> tests += $(boost-tests)
>>
>> diff --git a/modules/tests/usr.manifest.skel
>> b/modules/tests/usr.manifest.skel
>> index 2de441f9..7653760a 100644
>> --- a/modules/tests/usr.manifest.skel
>> +++ b/modules/tests/usr.manifest.skel
>> @@ -1,4 +1,4 @@
>> -/usr/lib/&/libboost_unit_test_framework.so.1.55.0:
>> %(miscbase)s/usr/lib64/&
>> -/usr/lib/&/libboost_filesystem.so.1.55.0: %(miscbase)s/usr/lib64/&
>> -/usr/lib/&/libboost_system.so.1.55.0: %(miscbase)s/usr/lib64/&
>> +/usr/lib/&/libboost_unit_test_framework.so.1.69.0: /lib64/&
>> +/usr/lib/&/libboost_filesystem.so.1.69.0: /lib64/&
>> +/usr/lib/&/libboost_system.so.1.69.0: /lib64/&
>>
>
> Please note I have removed this line from the tests Makefile:
-$(boost-tests:%=$(out)/tests/%): CXXFLAGS += -D_GLIBCXX_USE_CXX11_ABI=0 \
I do not fully understand the significance of it nor the reasons for it in
the first place (why was it there). Could it cause this issue?
With this line the boost based tests would fail like so:
/tests/tst-async.so: failed looking up symbol
_ZN5boost9unit_test9ut_detail24normalize_test_case_nameENS0_13basic_cstringIKcEE
(boost::unit_test::ut_detail::normalize_test_case_name(boost::unit_test::basic_cstring<char
const>))
[backtrace]
0x00000000403558c6 <elf::object::symbol(unsigned int, bool)+1542>
0x0000000040355992 <elf::object::resolve_pltgot(unsigned int)+130>
0x0000000040355c93 <elf_resolve_pltgot+51>
0x000000004039c0bd <???+1077526717>
0x0000200000200e0f <???+2100751>
0x010000100000080e <???+2062>
BTW I also now noticed this linker warning (not sure if related):
LIBOSV.SO
STRIP loader.elf -> loader-stripped.elf
strip:
build/release.x64/loader.elf[.gnu.build.attributes.text._ZN5boost6system23dummy_exported_functionEv]:
Warning: version note missing - assuming version 3
strip:build/release.x64/loader-stripped.elf[.gnu.build.attributes.unlikely]:
error: failed to copy merged notes into output: file in wrong format
LZ loader-stripped.elf
> I'm assuming this patch is only temporary - in the final version, please
> don't use these specific version names in the usr.manifest.skel - it will
> only work in your setup - we need to figure this out automatically with ldd.
>
>
>
>> /testrunner.so: ./tests/testrunner.so
>>
>> The error looks similar and affects tst-rcu-hashtable, tst-rcu-list and
>> tst-rename. There may be more tests after tst-rename that fail like that:
>>
>> TEST tst-rcu-hashtable.so Running OSv on qemu with
>> parameters: [-s -e --power-off-on-abort /tests/tst-rcu-hashtable.so
>> --pass-args=-monitor unix:qemu-monitor,server,nowait --block-device-cache
>> unsafe]
>> OSv v0.54.0-44-g5526c8ab
>> eth0: 192.168.122.15
>> Booted up in 186.88 ms
>> Cmdline: /tests/tst-rcu-hashtable.so
>> Running 2 test cases...
>>
>> *** No errors detected
>> Aborted
>>
>> [backtrace]
>> 0x00000000402197c3 <???+1075943363>
>> 0x0000000040463f7e <osv::handle_mmap_fault(unsigned long, int,
>> exception_frame*)+30>
>> 0x000000004033da01 <mmu::vm_fault(unsigned long, exception_frame*)+385>
>> 0x000000004039d62f <page_fault+143>
>> 0x000000004039c486 <???+1077527686>
>> 0x000010000041f5f6 <???+4322806>
>> 0x0000000040352c5c <elf::object::run_fini_funcs()+140>
>> 0x0000000040354616 <elf::program::remove_object(elf::object*)+118>
>> 0x0000000040354e30 <???+1077235248>
>> 0x0000000040354ae4 <elf::program::remove_object(elf::object*)+1348>
>> 0x0000000040354e30 <???+1077235248>
>> 0x000000004042c14f <osv::application::join()+623>
>> 0x000000004022a504 <do_main_thread(void*)+2644>
>> 0x000000004045fdb5 <???+1078328757>
>> 0x00000000403f9ce7 <thread_main_c+39>
>> 0x000000004039d402 <???+1077531650>
>> Test tst-rcu-hashtable.so FAILED
>> Traceback (most recent call last):
>> File "./scripts/test.py", line 204, in <module>
>> main()
>> File "./scripts/test.py", line 183, in main
>> run_tests()
>> File "./scripts/test.py", line 174, in run_tests
>> run(tests_to_run)
>> File "./scripts/test.py", line 94, in run
>> run_test(test)
>> File "./scripts/test.py", line 69, in run_test
>> test.run()
>> File "/git-repos/osv/scripts/tests/testing.py", line 38, in run
>> run_command_in_guest(self.command, hypervisor=self.hypervisor,
>> run_py_args=self.run_py_args).join()
>> File "/git-repos/osv/scripts/tests/testing.py", line 186, in join
>> raise Exception('Guest failed')
>> Exception: Guest failed
>>
>> Somewhat broken gdb stacktrace looks like this:
>>
>
> Is the backtrace broken? The important line is
> #10 0x00001000000ed1e0 in ?? ()
>
> Which is inside the test executable. Did you try "osv syms"?
>
> I did. There were couple of libraries that had missing debug info missing.
Installed still did not help and backtrace looks like this - broken:
> It seems there is a C++ destructor in the test code (or Boost framework)
> being run, which causes a crash. But I don't know what it is...
>
> Not sure it is related but our usr.manifest.skel pulls ancient libgc_s.so
from externals. Changing it to pull from host creates other issues which I
will send email about.
>
>
>> (gdb) bt
>> #0 0x00000000403a36f2 in processor::cli_hlt () at
>> arch/x64/processor.hh:247
>> #1 arch::halt_no_interrupts () at arch/x64/arch.hh:48
>> #2 osv::halt () at arch/x64/power.cc:26
>> #3 0x0000000040239d4e in abort (fmt=fmt@entry=0x406414bf "Aborted\n")
>> at runtime.cc:132
>> #4 0x00000000402028ab in abort () at runtime.cc:98
>> #5 0x00000000402197c4 in osv::generate_signal (siginfo=...,
>> ef=0xffff80000123c068) at libc/signal.cc:124
>> #6 0x0000000040463f7f in osv::handle_mmap_fault (addr=<optimized out>,
>> sig=<optimized out>, ef=<optimized out>) at libc/signal.cc:139
>> #7 0x000000004033da02 in mmu::vm_fault (addr=17592187015168,
>> addr@entry=17592187015648, ef=ef@entry=0xffff80000123c068)
>> at core/mmu.cc:1337
>> #8 0x000000004039d630 in page_fault (ef=0xffff80000123c068)
>> at arch/x64/mmu.cc:42
>> #9 <signal handler called>
>> #10 0x00001000000ed1e0 in ?? ()
>> #11 0x000000004023a2f7 in __cxxabiv1::__cxa_finalize (dso=<optimized out>)
>> at runtime.cc:183
>> #12 0x000010000041f5f7 in ?? ()
>> #13 0x0000200000100940 in ?? ()
>> #14 0x0000000040352c5d in elf::object::run_fini_funcs
>> (this=0xffffa0000160ee00)
>> at core/elf.cc:1070
>>
>> It happens consistently. Any idea what might be wrong?
>>
>> Waldek
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "OSv Development" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected] <javascript:>.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/osv-dev/5539bd38-a7d8-485f-ba51-40b90c16d0f5%40googlegroups.com
>>
>> <https://groups.google.com/d/msgid/osv-dev/5539bd38-a7d8-485f-ba51-40b90c16d0f5%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>
--
You received this message because you are subscribed to the Google Groups "OSv
Development" 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/osv-dev/d4f536bd-3df1-4808-be5b-294136d7af11%40googlegroups.com.