Help with a shared_ptr problem on Android (ARM)
https://svn.boost.org/trac/boost/ticket/9912 reports that spinlock_gcc_arm.hpp segfaults on a Nexus 7. Unfortunately, I know next to nothing about ARM or Android, so I wonder if someone can help with that.
On Thu, Apr 17, 2014 at 4:53 PM, Peter Dimov
https://svn.boost.org/trac/boost/ticket/9912
reports that spinlock_gcc_arm.hpp segfaults on a Nexus 7.
Unfortunately, I know next to nothing about ARM or Android, so I wonder if someone can help with that.
I'm probably even less experienced with ARM than you are, but there is an interesting comment in boost/atomic/detail/gcc-armv6plus.hpp that explains some things about different ARM ISA versions.
From Wikipedia it seems that Nexus 7 has an ARMv7 CPU, but the compiler is probably reducing the target CPU to ARMv6 or even lower (judging by the fact that __thumb__ is not defined). In this version mcr instruction is used for a memory barrier. As I understand it, it's basically an instruction for a co-processor (15 in this case). I suspect that that particular SoC could have this co-processor number reserved. Of course, all this is just a speculation on my part, so take it with a grain of salt. It would be useful to see the backtrace and disassembly to verify my theory.
Andrey Semashev wrote:
On Thu, Apr 17, 2014 at 4:53 PM, Peter Dimov
wrote: https://svn.boost.org/trac/boost/ticket/9912
reports that spinlock_gcc_arm.hpp segfaults on a Nexus 7.
Unfortunately, I know next to nothing about ARM or Android, so I wonder if someone can help with that.
I'm probably even less experienced with ARM than you are, but there is an interesting comment in boost/atomic/detail/gcc-armv6plus.hpp that explains some things about different ARM ISA versions.
From Wikipedia it seems that Nexus 7 has an ARMv7 CPU, but the compiler is probably reducing the target CPU to ARMv6 or even lower (judging by the fact that __thumb__ is not defined). In this version mcr instruction is used for a memory barrier. As I understand it, it's basically an instruction for a co-processor (15 in this case). I suspect that that particular SoC could have this co-processor number reserved. Of course, all this is just a speculation on my part, so take it with a grain of salt. It would be useful to see the backtrace and disassembly to verify my theory.
I suspect that the target CPU is not even set to ARMv6, in which case no memory barrier instructions are inserted.
Peter Dimov wrote:
https://svn.boost.org/trac/boost/ticket/9912
reports that spinlock_gcc_arm.hpp segfaults on a Nexus 7.
Unfortunately, I know next to nothing about ARM or Android, so I wonder if someone can help with that.
It would be great if shared_ptr could just use boost::atomic, as I have previously suggested. We would then just have one place where the platform-specific atomic asm needed to be maintained. Regards, Phil.
On Thursday 17 April 2014 18:00:29 Phil Endecott wrote:
Peter Dimov wrote:
https://svn.boost.org/trac/boost/ticket/9912
reports that spinlock_gcc_arm.hpp segfaults on a Nexus 7.
Unfortunately, I know next to nothing about ARM or Android, so I wonder if someone can help with that.
It would be great if shared_ptr could just use boost::atomic, as I have previously suggested. We would then just have one place where the platform-specific atomic asm needed to be maintained.
+1. I also wanted to let you know that I started a major refactoring of Boost.Atomic. One of the positive outcomes of this work should be a design more friendly to header-only user libraries.
participants (3)
-
Andrey Semashev
-
Peter Dimov
-
Phil Endecott