Repository navigation
Description
Description
Triton crashes at startup when TRITON_CLOUD_CREDENTIAL_PATH contains 17 or more credentials of one type (e.g. s3) whose names have the same length.
FileSystemManager::SortCache() sorts the credential cache with >= (api.cc#L372):
return std::get<0>(a).size() >= std::get<0>(b).size();std::sort requires a strict weak ordering, and >= returns true for equal elements. With more than 16 elements, libstdc++'s unguarded partition can run past the end of the vector, causing undefined behavior. In practice tritonserver segfaults inside LoadCredentials(), before any model is polled. This doesn't depend on threads.
Triton Information
Reproduced with the official containers nvcr.io/nvidia/tritonserver:26.09-py3 (server 2.73.0, the latest release) and 25.01-py3 (2.54.0), not self-built.
To Reproduce
No S3 server or network is needed, the crash happens while the credential file is loaded.
- Create a credential file with 17 S3 entries whose names have the same length:
{ echo '{"s3": {' for i in $(seq -w 1 17); do sep=","; [ "$i" = 17 ] && sep="" echo "\"s3://localhost:9000/bucket/m$i\": {\"key_id\": \"k\", \"secret_key\": \"s\", \"region\": \"us-east-1\"}$sep" done echo '}}'; } > creds.json - Run Triton with verbose logging, then print the exit code (a segfault prints no error):
docker run --rm --network none -v "$PWD/creds.json:/tmp/creds.json" \ -e TRITON_CLOUD_CREDENTIAL_PATH=/tmp/creds.json \ nvcr.io/nvidia/tritonserver:26.09-py3 \ tritonserver --model-repository=s3://localhost:9000/bucket --log-verbose=1 echo "exit code: $?"
- Triton segfaults while loading the credential file. The output ends with:
E1022 02:14:10.018745 1 server.cc:248] "CudaDriverHelper has not been initialized." I1022 02:14:10.018757 1 api.cc:277] "Reading cloud credential from /tmp/creds.json" exit code: 139
Results with all names the same length, identical on 26.09-py3 and 25.01-py3 (arm64):
| Entries | Result |
|---|---|
| 16 | Expected error: Cannot match credential for path s3://localhost:9000/bucket (exit 1) |
| 17, 21, 100, 500 | Segmentation fault (exit 139), in every run (50 of 50 at 17 entries) |
The behavior isn't model-specific; no model is read before the crash. Under AddressSanitizer, a standalone copy of the sort reports a heap-buffer-overflow or SEGV in std::__unguarded_partition called from SortCache().
Expected behavior
Credentials of equal name length are accepted in any number. Using a strict comparison fixes it, and the sort order is unchanged (longest name first):
return std::get<0>(a).size() > std::get<0>(b).size();With >, the standalone copy of the sort handles 17, 100 and 1000 equal-length entries without errors under AddressSanitizer.
Activity
whoisj commentedon Oct 22, 2026
@drnextgis, thank you for reporting this issue.