Skip to content

Fix 'Build fails on aarch64-unknown-linux-android24'(#124)#125

Open
ChenPi11 wants to merge 4 commits into
miurahr:mainfrom
ChenPi11:main
Open

Fix 'Build fails on aarch64-unknown-linux-android24'(#124)#125
ChenPi11 wants to merge 4 commits into
miurahr:mainfrom
ChenPi11:main

Conversation

@ChenPi11

@ChenPi11 ChenPi11 commented Jul 6, 2025

Copy link
Copy Markdown

Benchmark:

--------------------------------------------------------------------------------------------- benchmark 'compress': 2 tests ----------------------------------------------------------------------------------------------
Name (time in ms)                                          Min                 Max                Mean             StdDev              Median                IQR            Outliers     OPS            Rounds  Iterations
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
test_benchmark_text_compress[PPMd H-7-6-16777216]     208.6208 (1.0)      277.4195 (1.0)      235.8811 (1.0)      28.3367 (1.0)      231.3216 (1.0)      44.7625 (1.0)           1;0  4.2394 (1.0)           5           1
test_benchmark_text_compress[PPMd I-8-8-8388608]      244.2492 (1.17)     362.0023 (1.30)     287.4594 (1.22)     49.3901 (1.74)     263.8437 (1.14)     73.7615 (1.65)          1;0  3.4788 (0.82)          5           1
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

---------------------------------------------------------------------------------------------- benchmark 'decompress': 2 tests -----------------------------------------------------------------------------------------------
Name (time in ms)                                            Min                 Max                Mean              StdDev              Median                 IQR            Outliers     OPS            Rounds  Iterations
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
test_benchmark_text_decompress[PPMd H-7-6-16777216]     185.6872 (1.0)      367.2979 (1.0)      244.0532 (1.0)       77.8981 (1.0)      197.9793 (1.0)      107.0395 (1.0)           1;0  4.0975 (1.0)           5           1
test_benchmark_text_decompress[PPMd I-8-8-8388608]      189.5612 (1.02)     522.2300 (1.42)     303.9971 (1.25)     129.2388 (1.66)     285.4922 (1.44)     131.8851 (1.23)          1;0  3.2895 (0.80)          5           1
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

@ChenPi11

ChenPi11 commented Jul 6, 2025

Copy link
Copy Markdown
Author

Replace pthread_cancel(tc->handle) to pthread_kill(tc->handle, SIGUSR1) can fix this problem. With all tests passed.>
But it seems unsafe.

We found that there is a probability for test tests/test_fuzzer.py::test_ppmd8_fuzzer to enter an infinite loop.

@miurahr

This comment was marked as outdated.

@miurahr

miurahr commented Nov 27, 2025

Copy link
Copy Markdown
Owner

I have merged main branch back to here.

Comment on lines +13 to +15
#include <signal.h>

#if defined(__ANDROID__) || defined(__BIONIC__) || defined(PPMD_NO_PTHREAD_CANCEL) || 1

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#include <signal.h>
#if defined(__ANDROID__) || defined(__BIONIC__) || defined(PPMD_NO_PTHREAD_CANCEL) || 1
#if defined(__ANDROID__) || defined(__BIONIC__) || defined(PPMD_NO_PTHREAD_CANCEL)
#include <signal.h>

Please do not brute force insert the change on all the platform.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

omg i forget to remove the 1💀

@miurahr

miurahr commented Nov 27, 2025

Copy link
Copy Markdown
Owner

Because we use pthread_cancel for the critical part of the pyppmd, replacing it with pthread_kill does not work properly.

ref

pthread_cancel(tc->handle);
pthread_join(tc->handle, NULL);

I don't merge here other than the case when you implement pthread_cancel for your interested platform.

FYI: We use the windows implementation of pthread_cancel.

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

Successfully merging this pull request may close these issues.

2 participants