-
Notifications
You must be signed in to change notification settings - Fork 2
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
libcamera and cross compiled project #4
Comments
I don't have a lot of experience with libcamera, so I'm not sure if I can be of any help. However, the first thing to try is to compile everything with the address and undefined behavior sanitizers enabled. You could also try placing a hardware watchpoint on the refcount to see where it is decremented from 2 to 1. Also, can you be sure that the camera isn't removed from another thread? Do you actually see two destructor calls for the same camera object? |
It looks like memory layout problem for For example in disassemble of
Also it shows wrong information about use count and weak count |
If there's an ABI break in
That's correct: the caller is responsible for constructing and destructing the function arguments. https://itanium-cxx-abi.github.io/cxx-abi/abi.html#non-trivial-parameters |
I guess I found problem. Could you tell me how this flag is configured (
As I understand if some library located on my device is compiled with |
Good catch! It looks like Debian uses I'll have to investigate further. |
The difference appears to be that Raspberry Pi OS is compiled using the Since the toolchains in tttapa/docker-arm-cross-toolchain compile for the ARM1176JZF-S processor specifically, they implicitly have atomic operations enabled. The fix is simple: build for a generic ARMv6 CPU without any extensions, perhaps with
|
I've created a new release for https://github.com/tttapa/docker-arm-cross-toolchain. The new toolchains are currently being built. |
Great! I hope to test new toolchain during next week and after that I close this issue |
Hello,
First of all, thank you for providing this cross compile toolchains for Raspberry Pi. I use Raspberry Pi Zero (without W) and I faced with problem I cannot solve.
I followed your guide and I can successfully build and run project with libcamera. Problem happens with
shared_ptr
type, it has wrong number ofuse_count
. For example, this code gives 1 inuse_count
but must be two:std::shared_ptr<libcamera::Camera>
insidecamera_added
has wrong number of use count and when execution left this function it destroyslibcamera::Camera
object because counter became zero. It looks likeshared_ptr
on Linux machine used for cross compilation is not comparable withshared_ptr
on device, but I don't understand how this is possible since GCC should have ABI.I tried different version of GCC from you: 14 and 12. Problem is the same. libcamera version is the same on device and Linux machine (I use
mk_sbuild
)The text was updated successfully, but these errors were encountered: