Skip to content

SIGSEGV while uploading to S3 for part > INT_MAX #47679

@azat

Description

@azat

Reproducer:

INSERT INTO FUNCTION s3('https://test.s3.us-east-1.amazonaws.com/clickhouse/test.csv', '', '', 'TSV')
SETTINGS s3_truncate_on_insert = 1, s3_max_single_part_upload_size = '10Gi'
SELECT repeat('a', 1024)
FROM numbers((pow(2, 30) * 5) / 1024)
SETTINGS s3_truncate_on_insert = 1, s3_max_single_part_upload_size = '10Gi'

Note, that usually it is not a problem since multi part upload is used, but when you turn it OFF you can see the problem.

And the problem is the stringstream::gcount breaks stringstream when it holds more the INT_MAX

Here is a patch in llvm-project - https://reviews.llvm.org/D146294

Metadata

Metadata

Labels

bugConfirmed user-visible misbehaviour in official releasecomp-object-storageObject storage connectivity (S3/GCS/Azure) including credentials, retries, multipart, etc.crashCrash / segfault / abort

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions