Project

General

Profile

Actions

Bug #65813

open

[test] fsx can call posix_memalign() with size == 0

Added by Ilya Dryomov 13 days ago. Updated about 24 hours ago.

Status:
Pending Backport
Priority:
Normal
Assignee:
Target version:
-
% Done:

0%

Source:
Tags:
backport_processed
Backport:
quincy,reef,squid
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

While legal, it's specified as implementation-defined:

If the size of the space requested is 0, the behavior is implementation-defined: either a null pointer shall be returned in memptr, or the behavior shall be as if the size were some non-zero value, except that the behavior is undefined if the the value returned in memptr is used to access an object.

https://pubs.opengroup.org/onlinepubs/9699919799/functions/posix_memalign.html

Newer valgrind on centos 9 complains:

2024-05-05T19:29:03.177 INFO:teuthology.orchestra.run.smithi084.stdout:truncating image image_client.0-clone4 from 0x7ede86a (overlap 0x55c589) to 0x0
2024-05-05T19:29:04.058 INFO:teuthology.orchestra.run.smithi084.stdout:checking clone #3, image image_client.0-clone3 against file /home/ubuntu/cephtest/archive/fsx-image_client.0-parent4
2024-05-05T19:29:06.408 INFO:teuthology.orchestra.run.smithi084.stdout:734 read    0x58ecb68 thru    0x58f9cc6    (0xd15f bytes)
2024-05-05T19:29:06.411 INFO:teuthology.orchestra.run.smithi084.stdout:735 punch    from 0x4b1742a to 0x4b21db7, (0xa98d bytes)
2024-05-05T19:29:06.422 INFO:teuthology.orchestra.run.smithi084.stdout:737 writesame    0x14cc80f thru    0x14db1a8    data_size    0x3(0xe99a bytes)
2024-05-05T19:29:06.471 INFO:teuthology.orchestra.run.smithi084.stdout:738 punch    from 0x4efcf0f to 0x4effe4a, (0x2f3b bytes)
2024-05-05T19:29:06.471 INFO:teuthology.orchestra.run.smithi084.stdout:739 read    0x185fb89 thru    0x186091d    (0xd95 bytes)
2024-05-05T19:29:06.474 INFO:teuthology.orchestra.run.smithi084.stdout:740 read    0x2c3cee4 thru    0x2c48c1d    (0xbd3a bytes)
2024-05-05T19:29:06.476 INFO:teuthology.orchestra.run.smithi084.stdout:741 writesame    0x1819fdd thru    0x1823f69    data_size    0x23(0x9f8d bytes)
2024-05-05T19:29:06.502 INFO:teuthology.orchestra.run.smithi084.stdout:743 write    0x323ac75 thru    0x3247f45    (0xd2d1 bytes)
2024-05-05T19:29:06.506 INFO:teuthology.orchestra.run.smithi084.stdout:745 read    0x6fa002e thru    0x6fa042f    (0x402 bytes)
2024-05-05T19:29:06.554 INFO:teuthology.orchestra.run.smithi084.stdout:746 trunc    from 0x7ede86a to 0x145a7c8
2024-05-05T19:29:07.167 INFO:teuthology.orchestra.run.smithi084.stdout:747 trunc    from 0x145a7c8 to 0x2f14ee9
2024-05-05T19:29:07.182 INFO:teuthology.orchestra.run.smithi084.stdout:748 read    0x7a3514 thru    0x7aadb1    (0x789e bytes)
2024-05-05T19:29:07.184 INFO:teuthology.orchestra.run.smithi084.stdout:749 read    0x9ebc6 thru    0xab0b3    (0xc4ee bytes)
2024-05-05T19:29:07.212 INFO:teuthology.orchestra.run.smithi084.stdout:751 write    0x4367e48 thru    0x4370860    (0x8a19 bytes)
2024-05-05T19:29:07.235 INFO:teuthology.orchestra.run.smithi084.stdout:752 write    0x4baf0f2 thru    0x4bbc192    (0xd0a1 bytes)
2024-05-05T19:29:07.239 INFO:teuthology.orchestra.run.smithi084.stdout:compare and write disabled
2024-05-05T19:29:07.239 INFO:teuthology.orchestra.run.smithi084.stdout:compare and write disabled
2024-05-05T19:29:07.239 INFO:teuthology.orchestra.run.smithi084.stdout:compare and write disabled
2024-05-05T19:29:07.239 INFO:teuthology.orchestra.run.smithi084.stdout:756 write    0x360051e thru    0x360182a    (0x130d bytes)
2024-05-05T19:29:07.278 INFO:teuthology.orchestra.run.smithi084.stdout:759 writesame    0x7a4bdaa thru    0x7a51f11    data_size    0xc(0x6168 bytes)
2024-05-05T19:29:07.280 INFO:teuthology.orchestra.run.smithi084.stdout:761 write    0x2ef7ca thru    0x2f3a1e    (0x4255 bytes)
2024-05-05T19:29:07.283 INFO:teuthology.orchestra.run.smithi084.stdout:762 write    0x2942250 thru    0x2945cf7    (0x3aa8 bytes)
2024-05-05T19:29:07.287 INFO:teuthology.orchestra.run.smithi084.stdout:763 write    0x49abd16 thru    0x49b8eaf    (0xd19a bytes)
2024-05-05T19:29:07.316 INFO:teuthology.orchestra.run.smithi084.stdout:765 trunc    from 0x7a51f12 to 0x4005646
2024-05-05T19:29:07.346 INFO:teuthology.orchestra.run.smithi084.stdout:766 write    0xf82933 thru    0xf8b872    (0x8f40 bytes)
2024-05-05T19:29:07.349 INFO:teuthology.orchestra.run.smithi084.stdout:767 punch    from 0x32a0523 to 0x32a9cff, (0x97dc bytes)
2024-05-05T19:29:07.350 INFO:teuthology.orchestra.run.smithi084.stdout:768 read    0x1e43a9 thru    0x1e7ab5    (0x370d bytes)
2024-05-05T19:29:07.352 INFO:teuthology.orchestra.run.smithi084.stdout:771 read    0xce1ad7 thru    0xceb9c7    (0x9ef1 bytes)
2024-05-05T19:29:07.370 INFO:teuthology.orchestra.run.smithi084.stdout:772 trunc    from 0x4005646 to 0x1b80f37
2024-05-05T19:29:07.430 INFO:teuthology.orchestra.run.smithi084.stdout:773 write    0x3c2916c thru    0x3c2b744    (0x25d9 bytes)
2024-05-05T19:29:07.438 INFO:teuthology.orchestra.run.smithi084.stdout:775 trunc    from 0x3c2b745 to 0x473727c
2024-05-05T19:29:07.454 INFO:teuthology.orchestra.run.smithi084.stdout:776 clone    6 order 25 su 8388608 sc 4
2024-05-05T19:29:08.260 INFO:teuthology.orchestra.run.smithi084.stdout:truncating image image_client.0-clone5 from 0x473727c (overlap 0x145a7c8) to 0x1251700
2024-05-05T19:29:08.650 INFO:teuthology.orchestra.run.smithi084.stdout:checking clone #4, image image_client.0-clone4 against file /home/ubuntu/cephtest/archive/fsx-image_client.0-parent5
2024-05-05T19:29:08.650 INFO:teuthology.orchestra.run.smithi084.stderr:==00:00:00:58.417 35393==
2024-05-05T19:29:08.650 INFO:teuthology.orchestra.run.smithi084.stderr:==00:00:00:58.417 35393== Exit program on first error (--exit-on-first-error=yes)
2024-05-05T19:29:08.663 DEBUG:teuthology.orchestra.run:got remote process result: 42
2024-05-05T19:29:54.814 DEBUG:tasks.ceph:valgrind exception message: valgrind error: InvalidSize
posix_memalign
check_clone(int, bool)
do_clone()

https://pulpito.ceph.com/dis-2024-05-05_18:40:04-rbd-wip-dis-testing-distro-default-smithi/7692015


Related issues 3 (3 open0 closed)

Copied to rbd - Backport #66112: quincy: [test] fsx can call posix_memalign() with size == 0NewIlya DryomovActions
Copied to rbd - Backport #66113: reef: [test] fsx can call posix_memalign() with size == 0NewIlya DryomovActions
Copied to rbd - Backport #66114: squid: [test] fsx can call posix_memalign() with size == 0NewIlya DryomovActions
Actions #1

Updated by Ilya Dryomov 7 days ago

  • Status changed from New to Fix Under Review
  • Assignee set to Ilya Dryomov
  • Pull request ID set to 57433
Actions #2

Updated by Ilya Dryomov 7 days ago

  • Backport set to quincy,reef,squid
Actions #3

Updated by Ilya Dryomov 7 days ago

It turns out there was an actual bug lurking here as well: a crash in Striper on a zero-length read if buffer is NULL.

Actions #4

Updated by Ilya Dryomov 1 day ago

  • Status changed from Fix Under Review to Pending Backport
Actions #5

Updated by Backport Bot about 24 hours ago

  • Copied to Backport #66112: quincy: [test] fsx can call posix_memalign() with size == 0 added
Actions #6

Updated by Backport Bot about 24 hours ago

  • Copied to Backport #66113: reef: [test] fsx can call posix_memalign() with size == 0 added
Actions #7

Updated by Backport Bot about 24 hours ago

  • Copied to Backport #66114: squid: [test] fsx can call posix_memalign() with size == 0 added
Actions #8

Updated by Backport Bot about 24 hours ago

  • Tags set to backport_processed
Actions

Also available in: Atom PDF