python / python/cpython

posixmodule "undeclared function" error when compiling with sanitizer options on Termux (Android)

Đang mở
#140,317 16 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

build extension-modules OS-android
Ngôn ngữ chính
Python
Star
77.2k
Fork
35.9k
Chỉ số merge pull request
Chỉ số pull request đang chờ

Mô tả

Python fails to compile when compiling with the sanitizer option.

Python/fileutils.c:458:1: warning:                  unused function 'decode_current_locale'       [-Wunused-function]                       458 | decode_current_locale(const char* arg...                                                  | ^~~~~~~~~~~~~~~~~~~~~                 
Python/fileutils.c:677:1: warning:                  unused function 'encode_current_locale'       [-Wunused-function]                       677 | encode_current_locale(const wchar_t *t...                                                 | ^~~~~~~~~~~~~~~~~~~~~                 2 warnings generated.                         
./Modules/posixmodule.c:10400:15: error:            call to undeclared function 'wait3'; ISO      C99 and later do not support implicit         function declarations                         [-Wimplicit-function-declaration]        10400 |         pid = wait3(&status, options, &ru);                                               |               ^                      1 error generated.                            make: *** 
[Makefile:3808: Modules/posixmodule.o] Error 1                                    make: *** Waiting for unfinished jobs...

clang option use.

aarch64-linux-android-clang -fsanitize=address -fsanitize=undefined
aarch64-linux-android-clang++ -fsanitize=address -fsanitize=undefined -fno-sanitize=vptr

aarch64-linux-android-clang --version                                  
 clang version 21.1.3                         
 Target: aarch64-unknown-linux-android24       
Thread model: posix                           
InstalledDir: /data/data/com.termux/files/usr/bin
.git revision is at bedaea05987738c4c6b958d19cec9621bec09f07

Compiling with no sanitizer option works.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Bắt đầu trong Modules/posixmodule.c, quanh lệnh gọi wait3 được báo cáo gần dòng 10400, sau đó tái hiện quá trình build bằng các lệnh sanitizer của Termux được cung cấp và cấu hình không có sanitizer để so sánh. Hoàn tất nghĩa là CPython biên dịch được với các tùy chọn sanitizer mà không gặp lỗi hàm chưa được khai báo.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
android, c, python
Lĩnh vực
build-system, operating-systems
Loại issue
Lỗi
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Ít trao đổi
Độ rõ ràng
Cần làm rõ
Mức phù hợp với người mới
48/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.