Bug 1609126 - Fix mem leak and smoke failure for gcc8 in cloudsync
Summary: Fix mem leak and smoke failure for gcc8 in cloudsync
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: GlusterFS
Classification: Community
Component: unclassified
Version: mainline
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: bugs@gluster.org
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-07-27 04:56 UTC by Susant Kumar Palai
Modified: 2018-10-23 15:15 UTC (History)
1 user (show)

Fixed In Version: glusterfs-5.0
Clone Of:
Environment:
Last Closed: 2018-10-23 15:15:49 UTC
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Embargoed:


Attachments (Terms of Use)

Description Susant Kumar Palai 2018-07-27 04:56:06 UTC
Description of problem:

From https://build.gluster.org/job/fedora-smoke/6/console

11:14:32 /home/jenkins/root/workspace/fedora-smoke/xlators/features/cloudsync/src/cloudsync-plugins/src/cloudsyncs3/src/libcloudsyncs3.c: In function ‘aws_download_s3’:
11:14:32 /home/jenkins/root/workspace/fedora-smoke/xlators/features/cloudsync/src/cloudsync-plugins/src/cloudsyncs3/src/libcloudsyncs3.c:480:48: error: ‘%s’ directive output may be truncated writing up to 4095 bytes into a region of size 1015 [-Werror=format-truncation=]
11:14:32          snprintf(buf, sizeof(buf), "https://%s/%s", priv->hostname, resource);
11:14:32                                                 ^~                   ~~~~~~~~
11:14:32 /home/jenkins/root/workspace/fedora-smoke/xlators/features/cloudsync/src/cloudsync-plugins/src/cloudsyncs3/src/libcloudsyncs3.c:480:9: note: ‘snprintf’ output 10 or more bytes (assuming 4105) into a destination of size 1024
11:14:32          snprintf(buf, sizeof(buf), "https://%s/%s", priv->hostname, resource);
11:14:32          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
11:14:32 cc1: all warnings being treated as errors
11:14:32 make[10]: *** [Makefile:550: libcloudsyncs3.lo] Error 1


And also sign_req variable in aws_form_request is not freed.

Comment 1 Worker Ant 2018-07-27 05:07:58 UTC
REVIEW: https://review.gluster.org/20564 (cloudsync: fix -Werror=format-truncation error on gcc8) posted (#2) for review on master by Susant Palai

Comment 2 Worker Ant 2018-08-13 14:43:07 UTC
COMMIT: https://review.gluster.org/20564 committed in master by "Amar Tumballi" <amarts> with a commit message- cloudsync: fix -Werror=format-truncation error on gcc8

Here is the gcc8 warning:

libcloudsyncs3.c: In function ‘aws_download_s3’:
libcloudsyncs3.c:480:48: error: ‘%s’ directive output may be
truncated writing up to 4095 bytes into a region of size
1015 [-Werror=format-truncation=]
snprintf(buf, sizeof(buf), "https://%s/%s", priv->hostname, resource);
libcloudsyncs3.c:480:9: note: ‘snprintf’ output 10 or more bytes
(assuming 4105) into a destination of size 1024
snprintf(buf, sizeof(buf), "https://%s/%s", priv->hostname, resource);

Memleak:

It fixes a memleak as well where sign_req in fn: aws_form_request was
not freed. Adjusted the calloc size for sign_req as well to match with
the demand.

Test:

Have tested the local cloudsync regression test to validate the changes.
Smoke validation will be sufficient for the gcc8 warning fixes.

Fixes: bz#1609126
Change-Id: I1c537b30168f2e0b54862344a951843e86b0b488
Signed-off-by: Susant Palai <spalai>

Comment 3 Shyamsundar 2018-10-23 15:15:49 UTC
This bug is getting closed because a release has been made available that should address the reported issue. In case the problem is still not fixed with glusterfs-5.0, please open a new bug report.

glusterfs-5.0 has been announced on the Gluster mailinglists [1], packages for several distributions should become available in the near future. Keep an eye on the Gluster Users mailinglist [2] and the update infrastructure for your distribution.

[1] https://lists.gluster.org/pipermail/announce/2018-October/000115.html
[2] https://www.gluster.org/pipermail/gluster-users/


Note You need to log in before you can comment on or make changes to this bug.