-
Notifications
You must be signed in to change notification settings - Fork 322
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MemoryMte.cpp arm64 linux build failure #209
Comments
Hmm weird. mte_supported is defined in buildtools/bionic/libc/platform/bionic/mte.h These errors are relative to the unwinder, which is only for callstack sampling and heap profiling. As a workaround, can you try passing @rsavitski @ddiproietto in case they have more thoughts. Not sure why this would fail only when targeting arm64 (likely something sysroot related) |
okay I can repro as well.
Those ifdefs should really be
@ddiproietto can you send a patch upstream to libunwindstack (and roll it in perfetto?) when you have some spare time? |
Thanks for investigating so quickly. |
Reported-at: #209 Change-Id: I2808617a51e1a0838fb557f40781434e6f4f486f
https://r.android.com/1918189 and https://r.android.com/1926318 have been submitted. This should be fixed now. |
PTRACE_PEEKMTETAGS has been introduced in glibc very recently in https://sourceware.org/git/?p=glibc.git;a=commit;h=0ff786226c03456bef332950ecf51793205a4f5d and is not yet available in major distributions. mte_supported() is only defined in bionic. Let's disable mte support in non bionic linux arm64 to fix the build there. Test: All unit tests pass. Reported-at: google/perfetto#209 Change-Id: Iaac59978ff1c83b26a8e0e8fc92c0f4b5769e615 (cherry picked from commit 4c1a5dd4f91e06ec982902d3ab1c560fe01bac6a)
PTRACE_PEEKMTETAGS has been introduced in glibc very recently in https://sourceware.org/git/?p=glibc.git;a=commit;h=0ff786226c03456bef332950ecf51793205a4f5d and is not yet available in major distributions. mte_supported() is only defined in bionic. Let's disable mte support in non bionic linux arm64 to fix the build there. Test: All unit tests pass. Reported-at: google/perfetto#209 Change-Id: Iaac59978ff1c83b26a8e0e8fc92c0f4b5769e615 (cherry picked from commit 4c1a5dd4f91e06ec982902d3ab1c560fe01bac6a)
PTRACE_PEEKMTETAGS has been introduced in glibc very recently in https://sourceware.org/git/?p=glibc.git;a=commit;h=0ff786226c03456bef332950ecf51793205a4f5d and is not yet available in major distributions. mte_supported() is only defined in bionic. Let's disable mte support in non bionic linux arm64 to fix the build there. Test: All unit tests pass. Reported-at: google/perfetto#209 Change-Id: Iaac59978ff1c83b26a8e0e8fc92c0f4b5769e615 (cherry picked from commit 4c1a5dd4f91e06ec982902d3ab1c560fe01bac6a)
PTRACE_PEEKMTETAGS has been introduced in glibc very recently in https://sourceware.org/git/?p=glibc.git;a=commit;h=0ff786226c03456bef332950ecf51793205a4f5d and is not yet available in major distributions. mte_supported() is only defined in bionic. Let's disable mte support in non bionic linux arm64 to fix the build there. Test: All unit tests pass. Reported-at: google/perfetto#209 Change-Id: Iaac59978ff1c83b26a8e0e8fc92c0f4b5769e615 (cherry picked from commit 4c1a5dd4f91e06ec982902d3ab1c560fe01bac6a)
PTRACE_PEEKMTETAGS has been introduced in glibc very recently in https://sourceware.org/git/?p=glibc.git;a=commit;h=0ff786226c03456bef332950ecf51793205a4f5d and is not yet available in major distributions. mte_supported() is only defined in bionic. Let's disable mte support in non bionic linux arm64 to fix the build there. Test: All unit tests pass. Reported-at: google/perfetto#209 Change-Id: Iaac59978ff1c83b26a8e0e8fc92c0f4b5769e615 (cherry picked from commit 4c1a5dd4f91e06ec982902d3ab1c560fe01bac6a)
#3621) In particular, I'm interested in bringing `Maps` and `MapsInfo` up to date before making too many changes there. This is not the latest commit but the next one is fairly large so I want to proceed in two or more steps. Bug: http://b/230436550 Test: - Unit tests. - Capture Trata and verify unwinding. - Try mixed unwinding prototype on top of this. Cherry-picked commits below. * Fix all known race conditions in the tests. Sometimes the DexFiles tests fail in the memory size, so increase the size slightly to avoid this problem. Increase the timeout in the ThreadEntry from 5 to 10 seconds. If running on a slower config, give a little more time. Update the attach code to be a little more error tolerant. Specifically, increase the time allowed for a quiesce. Also try and kick the process if it gets into a group-stop state. Display the Unwinder object error code when a failure occurs in an UnwindTest. Retry the thread unwinds if they timeout since this can happen on slower systems. Bug: 203224453 Test: Ran unit tests for hours on cuttlefish and flame hwasan config. Change-Id: Iefa660007e067b521d45f59067f5603d63a5a1fa (cherry picked from commit eab6451b1a114d15c07be52d3436df4eea2421c5) * Maps contains shared_ptr MapInfo objects now. In order to make it easier to change the map data, make the individual MapInfo objects shared_ptr objects. This also changes the LocalUpdatableMaps object so that all of the reparsing is in the object itself. This means this object can be used with the normal unwinder unchanged and I can delete the LocalUnwinder completely in a future cl. Add a method to share a maps object between ThreadUnwinder objects. Add new unit tests to cover the changes. Bug: 120606663 Test: Unit tests pass. Test: Did a performance run before and after to verify no Test: performance issues. Change-Id: I074dc925c8e5ff8b3d75779052aefe4801b2c7bf Merged-In: I074dc925c8e5ff8b3d75779052aefe4801b2c7bf (cherry picked from commit bf98d2a784c8181ba508f978e123459e9a8c610b) (cherry picked from commit 88367cfde862f4bdd1da64d691b8a3854026f439) * Remove the next_real_map and prev_real_map. It's a pain to keep track of these pointers when doing a reparse. Rather than keeping these in sync, remove them completely and add a next_map. The next_real_map and prev_real_map variables are only needed in very specific circumstances that are very unlikely to occur. In those cases, derive the values when they are needed. Also, make the Get{Next,Prev}RealMap functions verify that the name is the same so that those checks can be removed from the places that use those values. Add new unit tests to verify the new behavior, and verify the pointers are set properly. Test: All unit tests pass. Change-Id: I8fd784df71d7b39890c763755bec5904c0bed8a3 (cherry picked from commit 734cc2f1d45d5e0269654cb5b8fdecfc93dd2ad3) * Fix Elf caching. There were a few places where Elf caching didn't work when trying to cache apks. There were also a few places where caching of a read-only and read-execute map that represents a single elf wasn't working properly either. In addition, the elf_start_offset and elf_offset was not getting set properly in many cases. Fix these and change the caching strategy from file:offset to a map of maps, first map is the filename, the second is the elf_start_offset. Replace all of the elf cache tests with better tests that actually test all of the varied paths. There is also a potential bug where the Elf object was being modified outside of the MapInfo lock. Fixed by making sure the modification is set within the lock. Bug: 193408481 Test: Unit tests pass. Change-Id: I517ae316151b2b608afa62a5863cf632752f29b2 (cherry picked from commit b1812005de85da6cc3adef6b0affc9e4f8787ebd) * Add GetPrintableBuildID function to Elf object. Bug: 197981919 Test: Unit tests pass. Change-Id: I6373920ad09d005ffa93d08c573f865bae3c070e (cherry picked from commit d452e57da25d144a41634c8f91068e6028365ef8) * Ignore /dev/* MapInfo for GetBuildID Similarly to CreateMemory, do no try to access the backing file if this is a device file. Bug: 68319037 Test: atest --host libunwindstack_unit_test Change-Id: I23fb7c449069bcbc4893a87f8d3a2a38b11c9eba (cherry picked from commit 5e34c2a1be6460d0e888fddc192e59c90639c19f) * Fix linux (non bionic) arm64 build PTRACE_PEEKMTETAGS has been introduced in glibc very recently in https://sourceware.org/git/?p=glibc.git;a=commit;h=0ff786226c03456bef332950ecf51793205a4f5d and is not yet available in major distributions. mte_supported() is only defined in bionic. Let's disable mte support in non bionic linux arm64 to fix the build there. Test: All unit tests pass. Reported-at: google/perfetto#209 Change-Id: Iaac59978ff1c83b26a8e0e8fc92c0f4b5769e615 (cherry picked from commit 4c1a5dd4f91e06ec982902d3ab1c560fe01bac6a) Co-authored-by: Christopher Ferris <cferris@google.com> Co-authored-by: Thiébaud Weksteen <tweek@google.com> Co-authored-by: Daniele Di Proietto <ddiproietto@google.com>
I'm having a problem building perfetto for linux on arm64.
I've tried building on my x86_64 Ubuntu 20.04 host machine and from inside both Ubuntu 18.04 and 20.04 docker containers with the same results.
I'm currently at this commit:
2724a3642 (HEAD -> master, origin/master, origin/HEAD) Merge "Avoid busy empty loop"
Here are the steps I've distilled from the docs:
The failure is here:
A more complete log can be found here: https://pastebin.com/yivwmaN7
If I hack around the PTRACE_PEEKMTETAGS error, then next error is about ptrace:
Any help would be appreciated.
The text was updated successfully, but these errors were encountered: