On Sun, Nov 28, 2021 at 5:34 PM Waldek Kozaczuk <jwkozac...@gmail.com>
wrote:

> Shall we apply this patch but only mark it fixing issue #1176?
>

Probably not... I'll try to provide a better patch...


> On Wednesday, November 24, 2021 at 9:14:45 PM UTC-5 Waldek Kozaczuk wrote:
>
>> On Wednesday, November 24, 2021 at 5:07:20 PM UTC-5 Nadav Har'El wrote:
>>
>>> On Wed, Nov 24, 2021 at 5:00 PM Waldek Kozaczuk <jwkoz...@gmail.com>
>>> wrote:
>>>
>>>> So I applied your patch on my Fedora 33 laptop and I get this error
>>>> when running trace test:
>>>>
>>>>   TEST tracing_smoke_test                 warning: Remote gdbserver
>>>> does not support determining executable automatically.
>>>> RHEL <=6.8 and <=7.2 versions of gdbserver do not support such
>>>> automatic executable detection.
>>>> The following versions of gdbserver support it:
>>>> - Upstream version of gdbserver (unsupported) 7.10 or later
>>>> - Red Hat Developer Toolset (DTS) version of gdbserver from DTS 4.0 or
>>>> later (only on x86_64)
>>>> - RHEL-7.3 versions of gdbserver (on any architecture)
>>>> sched::cpu::do_idle (this=0xffff80000001e040) at core/sched.cc:454
>>>> 454         handle_incoming_wakeups();
>>>> Saving traces to tracefile ...
>>>> Python Exception <class 'UnicodeDecodeError'> 'utf-8' codec can't
>>>> decode byte 0xc6 in position 0: invalid continuation byte:
>>>> Error occurred in Python: 'utf-8' codec can't decode byte 0xc6 in
>>>> position 0: invalid continuation byte
>>>>
>>>
>>> This is the same error that I'm getting in Fedora 34, *after* my patch
>>> fixed previous failures.
>>> I assumed it was a pre-existing bug and my patch just allowed me to get
>>> to it, but maybe I was wrong.
>>> Do you not get this error before my patch?
>>>
>> I only have Fedora 33 and I do not get this error before your patch.
>>
>>>
>>> Can you please check if "osv info threads" works with my patch (this is
>>> what I was trying to fix).
>>>
>> The "osv info threads" still works on my Fedora 33 if that is what you
>> are asking.
>>
>>>
>>>
>>>> [Inferior 1 (process 1) detached]
>>>>
>>>> Test tracing_smoke_test FAILED
>>>> Traceback (most recent call last):
>>>>   File "/home/wkozaczuk/projects/osv-true-master/scripts/test.py", line
>>>> 200, in <module>
>>>>     main()
>>>>   File "/home/wkozaczuk/projects/osv-true-master/scripts/test.py", line
>>>> 155, in main
>>>>     run_tests()
>>>>   File "/home/wkozaczuk/projects/osv-true-master/scripts/test.py", line
>>>> 144, in run_tests
>>>>     run(tests_to_run)
>>>>   File "/home/wkozaczuk/projects/osv-true-master/scripts/test.py", line
>>>> 117, in run
>>>>     run_test(test)
>>>>   File "/home/wkozaczuk/projects/osv-true-master/scripts/test.py", line
>>>> 92, in run_test
>>>>     test.run()
>>>>   File
>>>> "/home/wkozaczuk/projects/osv-true-master/scripts/tests/testing.py", line
>>>> 52, in run
>>>>     self.f()
>>>>   File
>>>> "/home/wkozaczuk/projects/osv-true-master/scripts/tests/test_tracing.py",
>>>> line 28, in tracing_smoke_test
>>>>     assert(subprocess.call([trace_script, 'extract']) == 0)
>>>> AssertionError
>>>>
>>>> My gcc:
>>>> gcc --version
>>>> gcc (GCC) 10.3.1 20210422 (Red Hat 10.3.1-1)
>>>> Copyright (C) 2020 Free Software Foundation, Inc.
>>>>
>>>> So there is something weird going on.
>>>> On Monday, November 22, 2021 at 7:56:26 AM UTC-5 Nadav Har'El wrote:
>>>>
>>>>> In my setup (Fedora 34, gcc 11.2.1), suddenly the gdb scripts'
>>>>> unique_ptr_get() stopped working in "osv info threads" and also in one
>>>>> of the tests - see issues #1175 and #1176.
>>>>>
>>>>> The following patch, "inspired" by gcc's "printers.py" fixes it on
>>>>> my setup. However, I can't explain why this particular change is
>>>>> suddenly needed. printers.py is similar to what I did but not quite
>>>>> the same, and the old code should have continued to work. I'll
>>>>> appreciate it if someone with a different compiler version can check
>>>>> if this patch doesn't break "osv info threads" on different compiler
>>>>> versions.
>>>>>
>>>>> Fixes #1175
>>>>> Fixes #1176 (but the test fails in a new place, I guess I need to fix
>>>>> another problem).
>>>>>
>>>>> Signed-off-by: Nadav Har'El <n...@scylladb.com>
>>>>> ---
>>>>> scripts/loader.py | 13 ++++++++++---
>>>>> 1 file changed, 10 insertions(+), 3 deletions(-)
>>>>>
>>>>> diff --git a/scripts/loader.py b/scripts/loader.py
>>>>> index 7706ba38..63334e19 100644
>>>>> --- a/scripts/loader.py
>>>>> +++ b/scripts/loader.py
>>>>> @@ -1000,10 +1000,17 @@ def find_or_give_last(predicate, seq):
>>>>>
>>>>> def unique_ptr_get(u):
>>>>> try:
>>>>> - # Since gcc 7
>>>>> - return u['_M_t']['_M_t']['_M_head_impl']
>>>>> + tuple_member = u['_M_t']['_M_t']
>>>>> + tuple_impl_type = tuple_member.type.fields()[0].type # _Tuple_impl
>>>>> + tuple_head_type = tuple_impl_type.fields()[1].type # _Head_base
>>>>> + head_field = tuple_head_type.fields()[0]
>>>>> + return tuple_member.cast(head_field.type)
>>>>> except:
>>>>> - return u['_M_t']['_M_head_impl']
>>>>> + try:
>>>>> + # Since gcc 7
>>>>> + return u['_M_t']['_M_t']['_M_head_impl']
>>>>> + except:
>>>>> + return u['_M_t']['_M_head_impl']
>>>>>
>>>>> def thread_cpu(t):
>>>>> d = unique_ptr_get(t['_detached_state'])
>>>>> --
>>>>> 2.31.1
>>>>>
>>>>> --
>>>> 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 osv-dev+u...@googlegroups.com.
>>>> To view this discussion on the web visit
>>>> https://groups.google.com/d/msgid/osv-dev/4ee39ca8-575e-4b19-ac75-ca0f536faaecn%40googlegroups.com
>>>> <https://groups.google.com/d/msgid/osv-dev/4ee39ca8-575e-4b19-ac75-ca0f536faaecn%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 osv-dev+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/osv-dev/cbe01bd4-2077-4d8e-ae78-a967d75fafbdn%40googlegroups.com
> <https://groups.google.com/d/msgid/osv-dev/cbe01bd4-2077-4d8e-ae78-a967d75fafbdn%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 osv-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/osv-dev/CANEVyjsuYzVe5j0kpO2Es4A7PVNWcp%2BV8ukKHzAhJ4fjXXzHKw%40mail.gmail.com.

Reply via email to