Skip to content
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

unresolved symbol __aarch64_ldadd8_sync on aarch64 #183

Closed
BrainSlayer opened this issue Dec 30, 2023 · 4 comments
Closed

unresolved symbol __aarch64_ldadd8_sync on aarch64 #183

BrainSlayer opened this issue Dec 30, 2023 · 4 comments

Comments

@BrainSlayer
Copy link

return(__sync_fetch_and_add(&ndpi_tot_allocated_memory, 0));

as shown in the link above there is a are kernel api incompatible reference to a atomic function (__sync_fetch_and_add) which leads gcc to generate code which creates references to libgcc on some platforms (reproduceable on aarch64).

solution one. use atomic_add instead
solution two. remove the entire atomic function including the inrement of the memory counter. the only function which make use of it
is ndpi_get_tot_allocated_memory(). but this function is not referenced by any code.

same must be done it ndpi_malloc and ndpi_calloc (in ndpi_calloc there is even a bug since the memory counter is increased 2 times)

@vel21ripn
Copy link
Owner

Thank you for the detailed bug report.
It turned out that I missed moving part of the code to the ndpi_memory.c file and, in addition to problems with __sync_fetch_and_add(), code duplication was detected.
I can start fixing the errors after the New Year holidays are over.

@BrainSlayer
Copy link
Author

yes i know. discovered the same thing and fixed it locally. but since i dont know what your approach was i havent made a pull request yet

@vel21ripn
Copy link
Owner

I removed the use of ndpi_tot_allocated_memory from kernel mode.

@BrainSlayer
Copy link
Author

looks sane. i will check

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants