Page MenuHomePhabricator

741g (lfy)
User

Projects

User does not belong to any projects.

User Details

User Since
Dec 10 2018, 8:19 AM (40 w, 6 d)

Recent Activity

Dec 19 2018

741g added a comment to D54889: Fiber support for thread sanitizer.

https://android-review.googlesource.com/c/platform/external/qemu/+/844675

Latest version of patch doesn't work with QEMU anymore, at least with those annotations. Error log:

Do you know what I'm doing wrong here?


Please check if adding __attribute__((always_inline)) for start_switch_fiber() and finish_switch_fiber() helps

That worked, thanks! Sorry, I had updated the patch with a refactoring the meantime that probably actually caused the break.

QEMU status: Fewer false positives now; there are many warnings that seem more real now, mostly about not atomically reading variables that got atomically updated. There might be other issues as well.

Dec 19 2018, 1:23 PM · Restricted Project, Restricted Project
741g added a comment to D54889: Fiber support for thread sanitizer.

https://android-review.googlesource.com/c/platform/external/qemu/+/844675

Latest version of patch doesn't work with QEMU anymore, at least with those annotations. Error log:

Do you know what I'm doing wrong here?


Please check if adding __attribute__((always_inline)) for start_switch_fiber() and finish_switch_fiber() helps

That worked, thanks! Sorry, I had updated the patch with a refactoring the meantime that probably actually caused the break.

Dec 19 2018, 1:07 PM · Restricted Project, Restricted Project

Dec 18 2018

741g added a comment to D54889: Fiber support for thread sanitizer.

https://android-review.googlesource.com/c/platform/external/qemu/+/844675

Latest version of patch doesn't work with QEMU anymore, at least with those annotations. Error log:

Do you know what I'm doing wrong here?


Please check if adding __attribute__((always_inline)) for start_switch_fiber() and finish_switch_fiber() helps

Dec 18 2018, 8:50 AM · Restricted Project, Restricted Project
741g added a comment to D54889: Fiber support for thread sanitizer.

Latest version of patch doesn't work with QEMU anymore, at least with those annotations. Error log:

Dec 18 2018, 8:26 AM · Restricted Project, Restricted Project

Dec 11 2018

741g added a comment to D54889: Fiber support for thread sanitizer.

Lingfeng, thanks for extensive feedback.

This should allow that logic to work for QEMU at least, and it feels like it should work for all possible other uses (?)

I am not sure there are no programs that use setjmp/longjmp to switch fibers across threads. Yes, man says behavior is undefined. But strictly saying, longjmp shouldn't be used for fiber switching too (it's solely for jumping upwards on the same stack). So I feel people are just relying on implementation details here (let's test it, works, ok, let's use it).

You said that QEMU uses sigsetjmp/siglongjmp for coroutine switches. How does a coroutine always stay on the same thread then? Say, if they have a thread pool servicing all coroutines, I would expect that coroutines are randomly intermixed across threads. So it can happen that we setjmp on one thread, but then reschedule the coroutine with longjmp on another thread.

Dec 11 2018, 9:46 AM · Restricted Project, Restricted Project

Dec 10 2018

741g added a comment to D54889: Fiber support for thread sanitizer.

FTR, Lingfeng did prototype change to qemu that uses these annotations:
https://android-review.googlesource.com/c/platform/external/qemu/+/844675

Dec 10 2018, 8:35 AM · Restricted Project, Restricted Project