gramineproject / gramine

A library OS for Linux multi-process applications, with Intel SGX support
GNU Lesser General Public License v3.0
551 stars 184 forks source link

PermissionError: [Errno 13] Permission denied #1928

Closed thempp66 closed 3 days ago

thempp66 commented 4 days ago

Description of the problem

Perrmission deined when open file. But it seems that my code dose not open any file. Could you give me some tips to solve this problem?

Steps to reproduce

1.download and use gramine v1.7 docker image 2.install pip 3.install lib install pip install -U pip wheel setuptools && pip install concrete-ml 4.make and run the demo

from sklearn.datasets import make_classification
from sklearn.model_selection import train_test_split
from concrete.ml.sklearn import LogisticRegression

# Lets create a synthetic data-set
x, y = make_classification(n_samples=100, class_sep=2, n_features=30, random_state=42)

# Split the data-set into a train and test set
X_train, X_test, y_train, y_test = train_test_split(
    x, y, test_size=0.2, random_state=42
)

# Now we train in the clear and quantize the weights
model = LogisticRegression(n_bits=8)
model.fit(X_train, y_train)

# We can simulate the predictions in the clear
y_pred_clear = model.predict(X_test)

# We then compile on a representative set
model.compile(X_train)

# Finally we run the inference on encrypted inputs !
y_pred_fhe = model.predict(X_test, fhe="execute")

print("In clear  :", y_pred_clear)
print("In FHE    :", y_pred_fhe)
print(f"Similarity: {int((y_pred_fhe == y_pred_clear).mean()*100)}%")

# Output:
    # In clear  : [0 0 0 0 1 0 1 0 1 1 0 0 1 0 0 1 1 1 0 0]
    # In FHE    : [0 0 0 0 1 0 1 0 1 1 0 0 1 0 0 1 1 1 0 0]
    # Similarity: 100%

Expected results

    In clear  : [0 0 0 0 1 0 1 0 1 1 0 0 1 0 0 1 1 1 0 0]
    In FHE    : [0 0 0 0 1 0 1 0 1 1 0 0 1 0 0 1 1 1 0 0]
    Similarity: 100%

Actual results

(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- mmap(0, 0x100000, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0x0) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from mmap(...) = 0x1aff000
(pal_files.c:108:file_open) warning: Disallowing access to file '0fb3c695d8b04d5c9f236bd03447d134.onnx'; file is not trusted or allowed.
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- openat(AT_FDCWD, "0fb3c695d8b04d5c9f236bd03447d134.onnx", O_WRONLY|O_CREAT|O_TRUNC|0x80000, 0666) = -13
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- openat(AT_FDCWD, "scripts/test-ml.py", O_RDONLY|0x80000, 0000) = 0x3
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- fstat(3, 0xadbdf4a0) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- ioctl(3, TCGETS, 0xadbdf4e0) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from ioctl(...) = -25
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- lseek(3, 0x0, SEEK_CUR) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- fcntl(3, OP 1030, 0) = 0x4
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- fcntl(4, F_GETFL, 0x7fbf11) = 0x80000
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- fstat(4, 0xadbdef10) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- read(4, 0x1b83ba0, 0x1000) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from read(...) = 0x43e
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- close(4) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- lseek(3, 0x0, SEEK_SET) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- read(3, 0x1b81bb0, 0x2000) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from read(...) = 0x43e
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- close(3) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- openat(AT_FDCWD, "/usr/local/lib/python3.8/dist-packages/concrete/ml/sklearn/base.py", O_RDONLY|0x80000, 0000) = 0x3
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- fstat(3, 0xadbdf4a0) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- ioctl(3, TCGETS, 0xadbdf4e0) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from ioctl(...) = -25
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- lseek(3, 0x0, SEEK_CUR) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- fcntl(3, OP 1030, 0) = 0x4
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- fcntl(4, F_GETFL, 0x7fbf11) = 0x80000
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- fstat(4, 0xadbdef10) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- read(4, 0x1b83ba0, 0x1000) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from read(...) = 0x1000
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- close(4) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- lseek(3, 0x0, SEEK_SET) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- read(3, 0x1b81bb0, 0x2000) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from read(...) = 0x2000
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- read(3, 0x1b83be0, 0x2000) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from read(...) = 0x2000
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- read(3, 0x1b81bb0, 0x2000) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from read(...) = 0x2000
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- read(3, 0x1b83be0, 0x2000) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from read(...) = 0x2000
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- close(3) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- openat(AT_FDCWD, "/usr/local/lib/python3.8/dist-packages/concrete/ml/sklearn/base.py", O_RDONLY|0x80000, 0000) = 0x3
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- fstat(3, 0xadbdf4a0) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- ioctl(3, TCGETS, 0xadbdf4e0) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from ioctl(...) = -25
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- lseek(3, 0x0, SEEK_CUR) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- fcntl(3, OP 1030, 0) = 0x4
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- fcntl(4, F_GETFL, 0x7fbf11) = 0x80000
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- fstat(4, 0xadbdef10) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- read(4, 0x1b83ba0, 0x1000) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from read(...) = 0x1000
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- close(4) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- lseek(3, 0x0, SEEK_SET) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- read(3, 0x1b81bb0, 0x2000) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from read(...) = 0x2000
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- read(3, 0x1b83be0, 0x2000) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from read(...) = 0x2000
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- read(3, 0x1b81bb0, 0x2000) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from read(...) = 0x2000
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- read(3, 0x1b83be0, 0x2000) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from read(...) = 0x2000
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- read(3, 0x1b81bb0, 0x2000) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from read(...) = 0x2000
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- read(3, 0x1b83be0, 0x2000) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from read(...) = 0x2000
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- read(3, 0x1b81bb0, 0x2000) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from read(...) = 0x2000
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- read(3, 0x1b83be0, 0x2000) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from read(...) = 0x2000
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- read(3, 0x1b81bb0, 0x2000) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from read(...) = 0x2000
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- close(3) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- openat(AT_FDCWD, "/usr/local/lib/python3.8/dist-packages/concrete/ml/sklearn/base.py", O_RDONLY|0x80000, 0000) = 0x3
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- fstat(3, 0xadbdf4a0) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- ioctl(3, TCGETS, 0xadbdf4e0) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from ioctl(...) = -25
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- lseek(3, 0x0, SEEK_CUR) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- fcntl(3, OP 1030, 0) = 0x4
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- fcntl(4, F_GETFL, 0x7fbf11) = 0x80000
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- fstat(4, 0xadbdef10) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- read(4, 0x1b83ba0, 0x1000) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from read(...) = 0x1000
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- close(4) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- lseek(3, 0x0, SEEK_SET) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- read(3, 0x1b81bb0, 0x2000) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from read(...) = 0x2000
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- read(3, 0x1b83be0, 0x2000) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from read(...) = 0x2000
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- read(3, 0x1b81bb0, 0x2000) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from read(...) = 0x2000
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- read(3, 0x1b83be0, 0x2000) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from read(...) = 0x2000
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- read(3, 0x1b81bb0, 0x2000) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from read(...) = 0x2000
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- read(3, 0x1b83be0, 0x2000) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from read(...) = 0x2000
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- read(3, 0x1b81bb0, 0x2000) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from read(...) = 0x2000
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- read(3, 0x1b83be0, 0x2000) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from read(...) = 0x2000
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- read(3, 0x1b81bb0, 0x2000) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from read(...) = 0x2000
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- close(3) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- openat(AT_FDCWD, "/usr/local/lib/python3.8/dist-packages/concrete/ml/sklearn/base.py", O_RDONLY|0x80000, 0000) = 0x3
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- fstat(3, 0xadbdf4a0) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- ioctl(3, TCGETS, 0xadbdf4e0) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from ioctl(...) = -25
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- lseek(3, 0x0, SEEK_CUR) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- fcntl(3, OP 1030, 0) = 0x4
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- fcntl(4, F_GETFL, 0x7fbf11) = 0x80000
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- fstat(4, 0xadbdef10) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- read(4, 0x1b83ba0, 0x1000) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from read(...) = 0x1000
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- close(4) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- lseek(3, 0x0, SEEK_SET) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- read(3, 0x1b81bb0, 0x2000) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from read(...) = 0x2000
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- read(3, 0x1b83be0, 0x2000) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from read(...) = 0x2000
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- read(3, 0x1b81bb0, 0x2000) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from read(...) = 0x2000
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- read(3, 0x1b83be0, 0x2000) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from read(...) = 0x2000
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- read(3, 0x1b81bb0, 0x2000) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from read(...) = 0x2000
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- read(3, 0x1b83be0, 0x2000) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from read(...) = 0x2000
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- read(3, 0x1b81bb0, 0x2000) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from read(...) = 0x2000
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- read(3, 0x1b83be0, 0x2000) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from read(...) = 0x2000
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- read(3, 0x1b81bb0, 0x2000) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from read(...) = 0x2000
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- close(3) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- openat(AT_FDCWD, "/usr/local/lib/python3.8/dist-packages/hummingbird/ml/convert.py", O_RDONLY|0x80000, 0000) = 0x3
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- fstat(3, 0xadbdf4a0) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- ioctl(3, TCGETS, 0xadbdf4e0) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from ioctl(...) = -25
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- lseek(3, 0x0, SEEK_CUR) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- fcntl(3, OP 1030, 0) = 0x4
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- fcntl(4, F_GETFL, 0x7fbf11) = 0x80000
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- fstat(4, 0xadbdef10) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- read(4, 0x1b83ba0, 0x1000) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from read(...) = 0x1000
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- close(4) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- lseek(3, 0x0, SEEK_SET) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- read(3, 0x1b81bb0, 0x2000) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from read(...) = 0x2000
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- read(3, 0x1b83be0, 0x2000) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from read(...) = 0x2000
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- read(3, 0x1b81bb0, 0x2000) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from read(...) = 0x1726
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- close(3) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- openat(AT_FDCWD, "/usr/local/lib/python3.8/dist-packages/hummingbird/ml/convert.py", O_RDONLY|0x80000, 0000) = 0x3
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- fstat(3, 0xadbdf4a0) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- ioctl(3, TCGETS, 0xadbdf4e0) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from ioctl(...) = -25
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- lseek(3, 0x0, SEEK_CUR) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- fcntl(3, OP 1030, 0) = 0x4
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- fcntl(4, F_GETFL, 0x7fbf11) = 0x80000
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- fstat(4, 0xadbdef10) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- read(4, 0x1b83ba0, 0x1000) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from read(...) = 0x1000
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- close(4) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- lseek(3, 0x0, SEEK_SET) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- read(3, 0x1b81bb0, 0x2000) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from read(...) = 0x2000
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- read(3, 0x1b83be0, 0x2000) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from read(...) = 0x2000
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- read(3, 0x1b81bb0, 0x2000) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from read(...) = 0x1726
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- close(3) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- openat(AT_FDCWD, "/usr/local/lib/python3.8/dist-packages/hummingbird/ml/convert.py", O_RDONLY|0x80000, 0000) = 0x3
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- fstat(3, 0xadbdf4a0) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- ioctl(3, TCGETS, 0xadbdf4e0) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from ioctl(...) = -25
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- lseek(3, 0x0, SEEK_CUR) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- fcntl(3, OP 1030, 0) = 0x4
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- fcntl(4, F_GETFL, 0x7fbf11) = 0x80000
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- fstat(4, 0xadbdef10) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- read(4, 0x1b83ba0, 0x1000) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from read(...) = 0x1000
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- close(4) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- lseek(3, 0x0, SEEK_SET) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- read(3, 0x1b81bb0, 0x2000) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from read(...) = 0x2000
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- close(3) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- openat(AT_FDCWD, "/usr/local/lib/python3.8/dist-packages/hummingbird/ml/_topology.py", O_RDONLY|0x80000, 0000) = 0x3
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- fstat(3, 0xadbdf4a0) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- ioctl(3, TCGETS, 0xadbdf4e0) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from ioctl(...) = -25
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- lseek(3, 0x0, SEEK_CUR) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- fcntl(3, OP 1030, 0) = 0x4
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- fcntl(4, F_GETFL, 0x7fbf11) = 0x80000
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- fstat(4, 0xadbdef10) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- read(4, 0x1b83ba0, 0x1000) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from read(...) = 0x1000
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- close(4) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- lseek(3, 0x0, SEEK_SET) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- read(3, 0x1b81bb0, 0x2000) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from read(...) = 0x2000
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- read(3, 0x1b83be0, 0x2000) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from read(...) = 0x2000
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- close(3) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- openat(AT_FDCWD, "/usr/local/lib/python3.8/dist-packages/torch/onnx/utils.py", O_RDONLY|0x80000, 0000) = 0x3
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- fstat(3, 0xadbdf4a0) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- ioctl(3, TCGETS, 0xadbdf4e0) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from ioctl(...) = -25
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- lseek(3, 0x0, SEEK_CUR) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- fcntl(3, OP 1030, 0) = 0x4
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- fcntl(4, F_GETFL, 0x7fbf11) = 0x80000
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- fstat(4, 0xadbdef10) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- read(4, 0x1b83ba0, 0x1000) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from read(...) = 0x1000
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- close(4) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- lseek(3, 0x0, SEEK_SET) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- read(3, 0x1b81bb0, 0x2000) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from read(...) = 0x2000
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- read(3, 0x1b83be0, 0x2000) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from read(...) = 0x2000
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- read(3, 0x1b81bb0, 0x2000) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from read(...) = 0x2000
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- close(3) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- openat(AT_FDCWD, "/usr/local/lib/python3.8/dist-packages/torch/onnx/utils.py", O_RDONLY|0x80000, 0000) = 0x3
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- fstat(3, 0xadbdf4a0) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- ioctl(3, TCGETS, 0xadbdf4e0) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from ioctl(...) = -25
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- lseek(3, 0x0, SEEK_CUR) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- fcntl(3, OP 1030, 0) = 0x4
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- fcntl(4, F_GETFL, 0x7fbf11) = 0x80000
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- fstat(4, 0xadbdef10) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- read(4, 0x1b83ba0, 0x1000) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from read(...) = 0x1000
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- close(4) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- lseek(3, 0x0, SEEK_SET) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- read(3, 0x1b81bb0, 0x2000) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from read(...) = 0x2000
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- read(3, 0x1b83be0, 0x2000) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from read(...) = 0x2000
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- read(3, 0x1b81bb0, 0x2000) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from read(...) = 0x2000
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- read(3, 0x1b83be0, 0x2000) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from read(...) = 0x2000
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- read(3, 0x1b81bb0, 0x2000) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from read(...) = 0x2000
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- read(3, 0x1b83be0, 0x2000) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from read(...) = 0x2000
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- read(3, 0x1b81bb0, 0x2000) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from read(...) = 0x2000
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- read(3, 0x1b83be0, 0x2000) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from read(...) = 0x2000
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- close(3) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- openat(AT_FDCWD, "/usr/local/lib/python3.8/dist-packages/torch/serialization.py", O_RDONLY|0x80000, 0000) = 0x3
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- fstat(3, 0xadbdf4a0) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- ioctl(3, TCGETS, 0xadbdf4e0) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from ioctl(...) = -25
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- lseek(3, 0x0, SEEK_CUR) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- fcntl(3, OP 1030, 0) = 0x4
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- fcntl(4, F_GETFL, 0x7fbf11) = 0x80000
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- fstat(4, 0xadbdef10) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- read(4, 0x1b83ba0, 0x1000) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from read(...) = 0x1000
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- close(4) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- lseek(3, 0x0, SEEK_SET) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- read(3, 0x1b81bb0, 0x2000) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from read(...) = 0x2000
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- close(3) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- openat(AT_FDCWD, "/usr/local/lib/python3.8/dist-packages/torch/serialization.py", O_RDONLY|0x80000, 0000) = 0x3
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- fstat(3, 0xadbdf4a0) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- ioctl(3, TCGETS, 0xadbdf4e0) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from ioctl(...) = -25
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- lseek(3, 0x0, SEEK_CUR) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- fcntl(3, OP 1030, 0) = 0x4
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- fcntl(4, F_GETFL, 0x7fbf11) = 0x80000
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- fstat(4, 0xadbdef10) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- read(4, 0x1b83ba0, 0x1000) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from read(...) = 0x1000
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- close(4) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- lseek(3, 0x0, SEEK_SET) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- read(3, 0x1b81bb0, 0x2000) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from read(...) = 0x2000
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- close(3) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- write(2, 0xad599690, 0x7ec) ...
Traceback (most recent call last):
  File "scripts/test-ml.py", line 15, in <module>
    model.fit(X_train, y_train)
  File "/usr/local/lib/python3.8/dist-packages/concrete/ml/sklearn/base.py", line 784, in fit
    return super().fit(X, y, **fit_parameters)  # type: ignore[safe-super]
  File "/usr/local/lib/python3.8/dist-packages/concrete/ml/sklearn/base.py", line 1706, in fit
    return self._quantize_model(X)
  File "/usr/local/lib/python3.8/dist-packages/concrete/ml/sklearn/base.py", line 1723, in _quantize_model
    self._set_onnx_model(X)
  File "/usr/local/lib/python3.8/dist-packages/concrete/ml/sklearn/base.py", line 1677, in _set_onnx_model
    self.onnx_model_ = hb_convert(
  File "/usr/local/lib/python3.8/dist-packages/hummingbird/ml/convert.py", line 444, in convert
    return _convert_common(model, backend, test_input, device, extra_config)
  File "/usr/local/lib/python3.8/dist-packages/hummingbird/ml/convert.py", line 405, in _convert_common
    return _convert_sklearn(model, backend_formatted, test_input, device, extra_config)
  File "/usr/local/lib/python3.8/dist-packages/hummingbird/ml/convert.py", line 111, in _convert_sklearn
    hb_model = topology_converter(topology, backend, test_input, device, extra_config=extra_config)
  File "/usr/local/lib/python3.8/dist-packages/hummingbird/ml/_topology.py", line 265, in convert
    torch.onnx.export(
  File "/usr/local/lib/python3.8/dist-packages/torch/onnx/utils.py", line 504, in export
    _export(
  File "/usr/local/lib/python3.8/dist-packages/torch/onnx/utils.py", line 1604, in _export
    with torch.serialization._open_file_like(f, "wb") as opened_file:
  File "/usr/local/lib/python3.8/dist-packages/torch/serialization.py", line 270, in _open_file_like
    return _open_file(name_or_buffer, mode)
  File "/usr/local/lib/python3.8/dist-packages/torch/serialization.py", line 251, in __init__
    super(_open_file, self).__init__(open(name, mode))
PermissionError: [Errno 13] Permission denied: '0fb3c695d8b04d5c9f236bd03447d134.onnx'
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from write(...) = 0x7ec
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- rt_sigaction([SIGINT], 0xadbe0970, 0xadbe0a10, 0x8) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- munmap(0x2d46000, 0x40000) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from munmap(...) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- munmap(0xb880000, 0x40000) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from munmap(...) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- munmap(0xb780000, 0x40000) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from munmap(...) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- munmap(0xafc0000, 0x40000) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from munmap(...) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- munmap(0xad40000, 0x40000) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from munmap(...) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- munmap(0xaf80000, 0x40000) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from munmap(...) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- munmap(0xb0c0000, 0x40000) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from munmap(...) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- munmap(0xadc0000, 0x40000) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from munmap(...) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- munmap(0xad80000, 0x40000) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from munmap(...) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- munmap(0xb280000, 0x40000) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from munmap(...) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- munmap(0xb600000, 0x40000) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from munmap(...) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- munmap(0xb300000, 0x40000) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from munmap(...) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- munmap(0xb2c0000, 0x40000) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from munmap(...) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- munmap(0x8ed8000, 0x40000) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from munmap(...) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- munmap(0x8e98000, 0x40000) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from munmap(...) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- munmap(0x8f58000, 0x40000) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from munmap(...) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- munmap(0x8f18000, 0x40000) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from munmap(...) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- munmap(0x8b18000, 0x40000) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from munmap(...) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- munmap(0xb240000, 0x40000) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from munmap(...) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- munmap(0x8e58000, 0x40000) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from munmap(...) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- munmap(0xb000000, 0x40000) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from munmap(...) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- munmap(0x8d18000, 0x40000) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from munmap(...) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- munmap(0x8cd8000, 0x40000) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from munmap(...) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- munmap(0x8c18000, 0x40000) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from munmap(...) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- munmap(0x8bd8000, 0x40000) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from munmap(...) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- munmap(0x8ad8000, 0x40000) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from munmap(...) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- munmap(0x8c98000, 0x40000) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from munmap(...) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- munmap(0xb540000, 0x40000) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from munmap(...) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- munmap(0xaec0000, 0x40000) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from munmap(...) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- munmap(0xb9c0000, 0x40000) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from munmap(...) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- munmap(0x8b98000, 0x40000) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from munmap(...) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- munmap(0x8b58000, 0x40000) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from munmap(...) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- munmap(0x8698000, 0x40000) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from munmap(...) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- munmap(0xb8c0000, 0x40000) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from munmap(...) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- munmap(0xb1c0000, 0x40000) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from munmap(...) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- munmap(0x8c58000, 0x40000) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from munmap(...) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- munmap(0x2d06000, 0x40000) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from munmap(...) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- sigaltstack(0, 0xadbe0c00) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- futex(0xad13688c, FUTEX_PRIVATE|FUTEX_WAKE, 2147483647, 0x3f0f, 0x648732e0, 0) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from futex(...) = 0x3
(libos_parser.c:1658:buf_write_all) [P1:T20:python3.8] trace: ---- return from futex(...) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- futex(0x2201990, FUTEX_CLOCK_REALTIME|FUTEX_WAIT_BITSET, 19, 0, 0, -1) ...
(libos_parser.c:1658:buf_write_all) [P1:T19:python3.8] trace: ---- return from futex(...) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T21:python3.8] trace: ---- return from futex(...) = 0x0
(libos_futex.c:755:_libos_syscall_futex) [P1:T1:python3.8] warning: Ignoring FUTEX_CLOCK_REALTIME flag
(libos_futex.c:759:_libos_syscall_futex) [P1:T1:python3.8] warning: Non-private futexes are not supported, assuming implicit FUTEX_PRIVATE_FLAG
(libos_parser.c:1658:buf_write_all) [P1:T21:python3.8] trace: ---- rt_sigprocmask(BLOCK, [SIGHUP,SIGINT,SIGQUIT,SIGILL,SIGTRAP,SIGABRT,SIGBUS,SIGFPE,SIGKILL,SIGUSR1,SIGSEGV,SIGUSR2,SIGPIPE,SIGALRM,SIGTERM,SIGSTKFLT,SIGCHLD,SIGCONT,SIGSTOP,SIGTSTP,SIGTTIN,SIGTTOU,SIGURG,SIGXCPU,SIGXFSZ,SIGVTALRM,SIGPROF,SIGWINCH,SIGIO
(libos_parser.c:1658:buf_write_all) [P1:T21:python3.8] trace: ,SIGPWR,SIGSYS,SIG32,SIG34,SIG35,SIG36,SIG37,SIG38,SIG39,SIG40,SIG41,SIG42,SIG43,SIG44,SIG45,SIG46,SIG47,SIG48,SIG49,SIG50,SIG51,SIG52,SIG53,SIG54,SIG55,SIG56,SIG57,SIG58,SIG59,SIG60,SIG61,SIG62,SIG63,SIG64,], NULL, 0x8) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T21:python3.8] trace: ---- madvise(0x1bff000, 0x1fb000, MADV_DONTNEED) = 0x0
(libos_exit.c:222:libos_syscall_exit) [P1:T21:python3.8] debug: ---- exit (returning 0)
(libos_async.c:122:install_async_event) [P1:T21:python3.8] debug: Installed async event at 1719479129256352
(libos_parser.c:1658:buf_write_all) [P1:T20:python3.8] trace: ---- rt_sigprocmask(BLOCK, [SIGHUP,SIGINT,SIGQUIT,SIGILL,SIGTRAP,SIGABRT,SIGBUS,SIGFPE,SIGKILL,SIGUSR1,SIGSEGV,SIGUSR2,SIGPIPE,SIGALRM,SIGTERM,SIGSTKFLT,SIGCHLD,SIGCONT,SIGSTOP,SIGTSTP,SIGTTIN,SIGTTOU,SIGURG,SIGXCPU,SIGXFSZ,SIGVTALRM,SIGPROF,SIGWINCH,SIGIO
(libos_parser.c:1658:buf_write_all) [P1:T20:python3.8] trace: ,SIGPWR,SIGSYS,SIG32,SIG34,SIG35,SIG36,SIG37,SIG38,SIG39,SIG40,SIG41,SIG42,SIG43,SIG44,SIG45,SIG46,SIG47,SIG48,SIG49,SIG50,SIG51,SIG52,SIG53,SIG54,SIG55,SIG56,SIG57,SIG58,SIG59,SIG60,SIG61,SIG62,SIG63,SIG64,], NULL, 0x8) = 0x0
(libos_async.c:327:libos_async_worker) [P1:libos] debug: Thread exited, cleaning up
(libos_parser.c:1658:buf_write_all) [P1:T20:python3.8] trace: ---- madvise(0x1e00000, 0x1fb000, MADV_DONTNEED) = 0x0
(libos_exit.c:222:libos_syscall_exit) [P1:T20:python3.8] debug: ---- exit (returning 0)
(libos_async.c:122:install_async_event) [P1:T20:python3.8] debug: Installed async event at 1719479129256655
(libos_async.c:327:libos_async_worker) [P1:libos] debug: Thread exited, cleaning up
(libos_parser.c:1658:buf_write_all) [P1:T19:python3.8] trace: ---- rt_sigprocmask(BLOCK, [SIGHUP,SIGINT,SIGQUIT,SIGILL,SIGTRAP,SIGABRT,SIGBUS,SIGFPE,SIGKILL,SIGUSR1,SIGSEGV,SIGUSR2,SIGPIPE,SIGALRM,SIGTERM,SIGSTKFLT,SIGCHLD,SIGCONT,SIGSTOP,SIGTSTP,SIGTTIN,SIGTTOU,SIGURG,SIGXCPU,SIGXFSZ,SIGVTALRM,SIGPROF,SIGWINCH,SIGIO
(libos_parser.c:1658:buf_write_all) [P1:T19:python3.8] trace: ,SIGPWR,SIGSYS,SIG32,SIG34,SIG35,SIG36,SIG37,SIG38,SIG39,SIG40,SIG41,SIG42,SIG43,SIG44,SIG45,SIG46,SIG47,SIG48,SIG49,SIG50,SIG51,SIG52,SIG53,SIG54,SIG55,SIG56,SIG57,SIG58,SIG59,SIG60,SIG61,SIG62,SIG63,SIG64,], NULL, 0x8) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T19:python3.8] trace: ---- madvise(0x2001000, 0x1fb000, MADV_DONTNEED) = 0x0
(libos_exit.c:222:libos_syscall_exit) [P1:T19:python3.8] debug: ---- exit (returning 0)
(libos_async.c:122:install_async_event) [P1:T19:python3.8] debug: Installed async event at 1719479129257040
(libos_async.c:327:libos_async_worker) [P1:libos] debug: Thread exited, cleaning up
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from futex(...) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- munmap(0xa73fe000, 0x2000000) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from munmap(...) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- munmap(0xa51fd000, 0x2000000) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from munmap(...) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- munmap(0xa31fd000, 0x2000000) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from munmap(...) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- munmap(0x99e00000, 0x2000000) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from munmap(...) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- munmap(0x9de00000, 0x2000000) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from munmap(...) = 0x0
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- munmap(0x9be00000, 0x2000000) ...
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- return from munmap(...) = 0x0
(libos_exit.c:212:libos_syscall_exit_group) [P1:T1:python3.8] debug: ---- exit_group (returning 1)
(libos_fs_lock.c:785:file_lock_clear_pid) [P1:T1:python3.8] debug: clearing file (POSIX) locks for pid 1
(libos_sync_client.c:331:shutdown_sync_client) [P1:T1:python3.8] debug: sync client shutdown: closing handles
(libos_sync_client.c:346:shutdown_sync_client) [P1:T1:python3.8] debug: sync client shutdown: waiting for confirmation
(libos_sync_client.c:359:shutdown_sync_client) [P1:T1:python3.8] debug: sync client shutdown: finished
(libos_async.c:354:libos_async_worker) [P1:libos] debug: Async worker thread terminated
(libos_ipc_worker.c:285:ipc_worker_main) [P1:libos] debug: IPC worker: exiting worker thread
(libos_exit.c:58:libos_clean_and_exit) [P1:T1:python3.8] debug: process 1 exited with status 1
(pal_process.c:248:_PalProcessExit) debug: PalProcessExit: Returning exit code 1

Gramine commit hash

10e93534169802be16fc9e2b3e9ac70d08efcb41

dimakuv commented 4 days ago

First, something inside Python does open a disallowed-in-manifest file:

(pal_files.c:108:file_open) warning: Disallowing access to file '0fb3c695d8b04d5c9f236bd03447d134.onnx'; file is not trusted or allowed.
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- openat(AT_FDCWD, "0fb3c695d8b04d5c9f236bd03447d134.onnx", O_WRONLY|O_CREAT|O_TRUNC|0x80000, 0666) = -13

Second, we need more info:

  1. How exactly do you run that Python script?
  2. Can you attach the whole Gramine log?
  3. Do you know what these .onnx files are?
thempp66 commented 4 days ago

First, something inside Python does open a disallowed-in-manifest file:

(pal_files.c:108:file_open) warning: Disallowing access to file '0fb3c695d8b04d5c9f236bd03447d134.onnx'; file is not trusted or allowed.
(libos_parser.c:1658:buf_write_all) [P1:T1:python3.8] trace: ---- openat(AT_FDCWD, "0fb3c695d8b04d5c9f236bd03447d134.onnx", O_WRONLY|O_CREAT|O_TRUNC|0x80000, 0666) = -13

Second, we need more info:

  1. How exactly do you run that Python script?

  2. Can you attach the whole Gramine log?

  3. Do you know what these .onnx files are?

  4. How exactly do you run that Python script?

  5. git clone the gramine repo and change to v1.7

  6. create a file named test-ml.py under dir gramine/CI-Examples/python/scripts/test-ml.py (the code is shown above) 3.cd gramine/CI-Examples/python/ and make SGX=1 4.gramine-sgx ./python scripts/test-ml.py

  7. Can you attach the whole Gramine log? Sure. log.txt

  8. Do you know what these .onnx files are? onnx is a model file in machine learning. I am not sure but I guess it probably generate a temp file .onnx and save to somewhere when running line15 model.fit(X_train, y_train). And the file may read in the following codes.

dimakuv commented 3 days ago

Thanks @thempp66 for good pointers!

Ok, looking at the source code, we observe this: https://github.com/microsoft/hummingbird/blob/d489151e97eaa9d8ec446118b709863a5acab87d/hummingbird/ml/_topology.py#L248-L255

This means that this .onnx file name is generated pseudo-randomly by default:

        if output_model_name is None:
            output_model_name = str(uuid4().hex) + ".onnx"

Now we just need to specify a concrete name, this is achieved by something called "extra config":

        if constants.ONNX_OUTPUT_MODEL_NAME in extra_config:
            onnx_model_name = extra_config[constants.ONNX_OUTPUT_MODEL_NAME]
            output_model_name = onnx_model_name + ".onnx"

At this point I don't know what this ONNX_OUTPUT_MODEL_NAME config is, and how to specify it. I only see that it's somehow possible, based on this: https://github.com/microsoft/hummingbird/blob/d489151e97eaa9d8ec446118b709863a5acab87d/hummingbird/ml/supported.py#L532-L533

So please figure out how to specify a concrete name here. Then you won't have that pseudo-random 3bdebf8421c9448fbdb2245a965f847a.onnx stuff.

And finally, you'll be able to specify something like this in your ML script:

# I actually don't know how it is done, please check the Hummingbird docs
ONNX_OUTPUT_MODEL_NAME = "/some/path/with/models/mymodel.onnx"

Now you can instruct Gramine to allow this file. Add in your Gramine manifest file smth like this:

fs.mounts = [
   ...
   { path = "/some/path/with/models/", uri = "file:/some/path/with/models/" },
]

sgx.allowed_files = [
  ...
  "file:/some/path/with/models/",
]
thempp66 commented 3 days ago

Thanks @thempp66 for good pointers!

Ok, looking at the source code, we observe this: https://github.com/microsoft/hummingbird/blob/d489151e97eaa9d8ec446118b709863a5acab87d/hummingbird/ml/_topology.py#L248-L255

This means that this .onnx file name is generated pseudo-randomly by default:

        if output_model_name is None:
            output_model_name = str(uuid4().hex) + ".onnx"

Now we just need to specify a concrete name, this is achieved by something called "extra config":

        if constants.ONNX_OUTPUT_MODEL_NAME in extra_config:
            onnx_model_name = extra_config[constants.ONNX_OUTPUT_MODEL_NAME]
            output_model_name = onnx_model_name + ".onnx"

At this point I don't know what this ONNX_OUTPUT_MODEL_NAME config is, and how to specify it. I only see that it's somehow possible, based on this: https://github.com/microsoft/hummingbird/blob/d489151e97eaa9d8ec446118b709863a5acab87d/hummingbird/ml/supported.py#L532-L533

So please figure out how to specify a concrete name here. Then you won't have that pseudo-random 3bdebf8421c9448fbdb2245a965f847a.onnx stuff.

And finally, you'll be able to specify something like this in your ML script:

# I actually don't know how it is done, please check the Hummingbird docs
ONNX_OUTPUT_MODEL_NAME = "/some/path/with/models/mymodel.onnx"

Now you can instruct Gramine to allow this file. Add in your Gramine manifest file smth like this:

fs.mounts = [
   ...
   { path = "/some/path/with/models/", uri = "file:/some/path/with/models/" },
]

sgx.allowed_files = [
  ...
  "file:/some/path/with/models/",
]

Thank you so much! I will try this.

thempp66 commented 3 days ago

Thanks, @dimakuv . It's working now. Update /usr/local/lib/python3.8/dist-packages/concrete/ml/sklearn/base.py:1681 and set extra_config={"onnx_target_opset": OPSET_VERSION_FOR_ONNX_EXPORT, "onnx_model_name": "test"}, And then add allowed_files to manifest.

sgx.allowed_files = [
  "file:test.onnx",
  "file:.artifacts/environment.txt",
  "file:.artifacts/requirements.txt",
  ...
]

By the way, There are so many tmp files generating when runing. So I was wondering if we could use some regular expression in sgx.allowed_files ?

dimakuv commented 3 days ago

By the way, There are so many tmp files generating when runing. So I was wondering if we could use some regular expression in sgx.allowed_files ?

Well, we (or at least I) were thinking about this at some point. But we never had a pressing need to implement regular expressions in Gramine manifest.

Typically these tmp files are generated under some directory. So you can specify the whole directory in sgx.allowed_files, and then you don't care about the particular names of files.

Even better, for tmp files you don't use sgx.allowed_files, but you create these files inside the SGX enclave itself. Gramine supports this using the tmpfs FS mount type: https://gramine.readthedocs.io/en/stable/manifest-syntax.html#fs-mount-points. One example can be found here: https://github.com/gramineproject/gramine/blob/ac61ae1777986e88629b764a1d6a8d6884ea869e/CI-Examples/python/python.manifest.template#L31

thempp66 commented 3 days ago

OK, thanks again, I will close this issue.