Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug:789278] Issues reported by Coverity static analysis tool #1095

Closed
gluster-ant opened this issue Mar 13, 2020 · 484 comments
Closed

[bug:789278] Issues reported by Coverity static analysis tool #1095

gluster-ant opened this issue Mar 13, 2020 · 484 comments

Comments

@gluster-ant
Copy link
Collaborator

URL: https://bugzilla.redhat.com/789278
Creator: ujjwala at redhat
Time: 20120210T09:32:26

Description of problem:
Ran coverity static analysis on Glusterfs-3.3.0qa21.
Below is the summary report:

Analysis summary report:

Files analyzed : 215
Total LoC input to cov-analyze : 219946
Functions analyzed : 6428
Paths analyzed : 1189156
Defect occurrences found : 395 Total
6 ARRAY_VS_SINGLETON
4 BAD_FREE
1 CHAR_IO
38 CHECKED_RETURN
31 DEADCODE
122 FORWARD_NULL
6 MISSING_BREAK
16 NEGATIVE_RETURNS
26 NO_EFFECT
20 NULL_RETURNS
5 OVERRUN_STATIC
86 RESOURCE_LEAK
13 REVERSE_INULL
1 SIZECHECK
1 SIZEOF_MISMATCH
1 STRAY_SEMICOLON
2 UNINIT
5 UNREACHABLE
5 UNUSED_VALUE
2 USE_AFTER_FREE
4 VARARGS

Exceeded path limit of 5000 paths in 0.22% of functions (normally up to 5% of functions encounter this limitation)

Please contact me for the machine details.

Version-Release number of selected component (if applicable):
Glusterfs-3.3.0qa21

How reproducible:
Always

Steps to Reproduce:

  1. Install Cov static analysis.
  2. Compile the code with cov-build
  3. Run cov-analyse on the build.
  4. Run cov-commit-defects

Actual results:

Expected results:

Additional info:

@gluster-ant
Copy link
Collaborator Author

Time: 20120423T21:53:05
aavati at redhat commented:
CHANGE: http://review.gluster.com/3145 (core: coverity issues fixed) merged in master by Anand Avati ([email protected])

@gluster-ant
Copy link
Collaborator Author

Time: 20120503T08:59:44
amarts at redhat commented:
Analysis summary report:

Files analyzed : 227
Total LoC input to cov-analyze : 234721
Functions analyzed : 6735
Paths analyzed : 1201804
Defect occurrences found : 345 Total
4 ARRAY_VS_SINGLETON (HIGH)
1 CHAR_IO
38 CHECKED_RETURN
48 DEADCODE
106 FORWARD_NULL
5 MISSING_BREAK
7 NEGATIVE_RETURNS
22 NO_EFFECT
6 NULL_RETURNS
3 OVERRUN_STATIC (HIGH)
74 RESOURCE_LEAK (HIGH)
13 REVERSE_INULL
2 STRAY_SEMICOLON
1 UNINIT (HIGH)
4 UNREACHABLE
5 UNUSED_VALUE
6 VARARGS

Shows that most of the HIGH issues compared to earlier codebase are fixed now. Other than 'RESOURCE LEAK', we have most of the HIGH issues as false positive.

@gluster-ant
Copy link
Collaborator Author

Time: 20120504T07:06:38
amarts at redhat commented:
http://review.gluster.com/3265 && http://review.gluster.com/3266 sent, but looking at it, its better to take this bug as a ERRATA fix, and not a release blocker, because the changes involved to fix all of these are significant code change (and touches most part of the code), so QA will become very serious problem.

Taking it off the 'beta' blocker list.

@gluster-ant
Copy link
Collaborator Author

Time: 20120509T07:41:30
aavati at redhat commented:
CHANGE: http://review.gluster.com/3266 (geo-replication: coverity resource leak fixes) merged in master by Anand Avati ([email protected])

@gluster-ant
Copy link
Collaborator Author

Time: 20120518T07:45:23
aavati at redhat commented:
CHANGE: http://review.gluster.com/3345 (geo-rep / gsyncd.c: fix coverity fix) merged in master by Vijay Bellur ([email protected])

@gluster-ant
Copy link
Collaborator Author

Time: 20120606T12:40:30
amarts at redhat commented:
Keep this open till we fix all the valid coverity warnings.

@gluster-ant
Copy link
Collaborator Author

Time: 20120711T10:18:57
amarts at redhat commented:
releng-test1.englab.brq.redhat.com/covscan/task/757/

@gluster-ant
Copy link
Collaborator Author

Time: 20120712T02:11:29
vbellur at redhat commented:
CHANGE: http://review.gluster.com/3589 (xlator options: remove overwritten data-self-heal initializer) merged in master by Anand Avati ([email protected])

@gluster-ant
Copy link
Collaborator Author

Time: 20120712T02:13:17
vbellur at redhat commented:
CHANGE: http://review.gluster.com/3594 (nfs-common: don't let 0-length path cause buf[-1] access) merged in master by Anand Avati ([email protected])

@gluster-ant
Copy link
Collaborator Author

Time: 20120712T02:13:40
vbellur at redhat commented:
CHANGE: http://review.gluster.com/3591 (glusterd: avoid buffer overrun for over-long volname) merged in master by Anand Avati ([email protected])

@gluster-ant
Copy link
Collaborator Author

Time: 20120712T02:14:30
vbellur at redhat commented:
CHANGE: http://review.gluster.com/3596 (gsyncd: don't let a bogus config file make us read/write buf[-1]) merged in master by Anand Avati ([email protected])

@gluster-ant
Copy link
Collaborator Author

Time: 20120712T02:15:00
vbellur at redhat commented:
CHANGE: http://review.gluster.com/3603 (read_conf: don't let a corrupt config file cause invalid line[-1] reference) merged in master by Anand Avati ([email protected])

@gluster-ant
Copy link
Collaborator Author

Time: 20120712T02:17:27
vbellur at redhat commented:
CHANGE: http://review.gluster.com/3646 (cli: print_brick_status: don't smash stack) merged in master by Anand Avati ([email protected])

@gluster-ant
Copy link
Collaborator Author

Time: 20120712T02:18:09
vbellur at redhat commented:
CHANGE: http://review.gluster.com/3606 (cli: cli_cmd_get_confirmation: don't reference answer[-1] for NUL input) merged in master by Anand Avati ([email protected])

@gluster-ant
Copy link
Collaborator Author

Time: 20120712T02:35:00
vbellur at redhat commented:
CHANGE: http://review.gluster.com/3648 (glusterfsd: don't ignore tmpfile write failure (2x)) merged in master by Anand Avati ([email protected])

@gluster-ant
Copy link
Collaborator Author

Time: 20120712T07:27:30
vbellur at redhat commented:
CHANGE: http://review.gluster.com/3647 (geo-rep: don't let unexpected status provoke undefined behavior) merged in master by Anand Avati ([email protected])

@gluster-ant
Copy link
Collaborator Author

Time: 20120713T21:05:36
vbellur at redhat commented:
CHANGE: http://review.gluster.com/3669 (gsyncd: don't dereference NULL upon failed realloc) merged in master by Anand Avati ([email protected])

@gluster-ant
Copy link
Collaborator Author

Time: 20120713T21:06:42
vbellur at redhat commented:
CHANGE: http://review.gluster.com/3670 (cli-xml-output.c: avoid NULL-deref upon OOM) merged in master by Anand Avati ([email protected])

@gluster-ant
Copy link
Collaborator Author

Time: 20121221T11:16:39
amarts at redhat commented:
considering this bug will be open forever (ie, coverity issues may be present in any versions, and will be valid for all versions), reducing the priority, and marking it as ON_DEV (to separate out from ASSIGNED state).

@gluster-ant
Copy link
Collaborator Author

Time: 20140113T12:02:44
lmohanty at redhat commented:
I was not aware of this bug, so have sent some patches as RFC to fix Coverity issues. Just to keep a track, I am putting the links of the patches here.

http://review.gluster.org/#/c/6626/
http://review.gluster.org/#/c/6667/
http://review.gluster.org/#/c/6313/
http://review.gluster.org/#/c/6645/

@gluster-ant
Copy link
Collaborator Author

Time: 20140114T14:03:12
aavati at redhat commented:
REVIEW: http://review.gluster.org/6697 (libgfapi: Fixing possible dereferencing of null pointer "glfd" Fix: Putting a check so that pointer derefrence does not happen when "gfld" is null) posted (#1) for review on master by Lalatendu Mohanty ([email protected])

@gluster-ant
Copy link
Collaborator Author

Time: 20140114T18:01:07
aavati at redhat commented:
REVIEW: http://review.gluster.org/6700 (geo-rep: Fixing null pointer dereference of "op_value") posted (#1) for review on master by Lalatendu Mohanty ([email protected])

@gluster-ant
Copy link
Collaborator Author

Time: 20140114T18:57:17
aavati at redhat commented:
REVIEW: http://review.gluster.org/6701 (core: Fixing Coverity issue "Use of uninitialized scalar variable") posted (#1) for review on master by Lalatendu Mohanty ([email protected])

@gluster-ant
Copy link
Collaborator Author

Time: 20140115T18:09:07
aavati at redhat commented:
COMMIT: http://review.gluster.org/6700 committed in master by Vijay Bellur ([email protected])

commit f3e227d
Author: Lalatendu Mohanty [email protected]
Date: Tue Jan 14 23:24:50 2014 +0530

geo-rep: Fixing null pointer dereference of "op_value"

Change-Id: Id39743eaa5a52cc7fd4e2a1378a23384f5ef1fed
BUG: 789278
Signed-off-by: Lalatendu Mohanty <[email protected]>
Reviewed-on: http://review.gluster.org/6700
Reviewed-by: Avra Sengupta <[email protected]>
Tested-by: Avra Sengupta <[email protected]>

@gluster-ant
Copy link
Collaborator Author

Time: 20140115T21:50:52
aavati at redhat commented:
REVIEW: http://review.gluster.org/6697 (libgfapi: Fixing possible dereferencing of null pointer "glfd") posted (#2) for review on master by Anand Avati ([email protected])

@gluster-ant
Copy link
Collaborator Author

Time: 20140116T08:59:11
aavati at redhat commented:
COMMIT: http://review.gluster.org/6697 committed in master by Vijay Bellur ([email protected])

commit c9008fe
Author: Lalatendu Mohanty [email protected]
Date: Tue Jan 14 12:35:54 2014 +0530

libgfapi: Fixing possible dereferencing of null pointer "glfd"

Fix: Putting a check so that pointer derefrence does not happen
when "gfld" is null

Change-Id: I281b10be445bbeec3a2728fc139d5ac94372e5b6
BUG: 789278
Signed-off-by: Lalatendu Mohanty <[email protected]>
Reviewed-on: http://review.gluster.org/6697
Tested-by: Gluster Build System <[email protected]>
Reviewed-by: Shyamsundar Ranganathan <[email protected]>
Reviewed-by: Vijay Bellur <[email protected]>

@gluster-ant
Copy link
Collaborator Author

Time: 20140116T14:15:00
aavati at redhat commented:
REVIEW: http://review.gluster.org/6701 (core: Fixing Coverity issue "Use of uninitialized scalar variable") posted (#2) for review on master by Lalatendu Mohanty ([email protected])

@gluster-ant
Copy link
Collaborator Author

Time: 20140116T15:10:49
aavati at redhat commented:
REVIEW: http://review.gluster.org/6701 (core: Fixing Coverity issue "Use of uninitialized scalar variable") posted (#3) for review on master by Lalatendu Mohanty ([email protected])

@gluster-ant
Copy link
Collaborator Author

Time: 20150303T06:23:00
aavati at redhat commented:
REVIEW: http://review.gluster.org/9584 (dht : logically dead code removed) posted (#5) for review on master by Humble Devassy Chirammal ([email protected])

@gluster-ant
Copy link
Collaborator Author

Time: 20150303T14:40:45
aavati at redhat commented:
COMMIT: http://review.gluster.org/9584 committed in master by Shyamsundar Ranganathan ([email protected])

commit 4ff3989
Author: Manikandan Selvaganesh [email protected]
Date: Thu Feb 5 10:59:48 2015 +0530

dht : logically dead code removed

CID :1124378
     1124401

Change-Id: Ib48e4a8d3fb12c4e0323a3946afb46eeb3926984
BUG: 789278
Signed-off-by: Manikandan Selvaganesh <[email protected]>
Reviewed-on: http://review.gluster.org/9584
Tested-by: Gluster Build System <[email protected]>
Reviewed-by: N Balachandran <[email protected]>
Reviewed-by: Shyamsundar Ranganathan <[email protected]>

@gluster-ant
Copy link
Collaborator Author

Time: 20150305T10:23:12
aavati at redhat commented:
REVIEW: http://review.gluster.org/9628 (dht : logical error and null dereference fixes.) posted (#7) for review on master by Humble Devassy Chirammal ([email protected])

@gluster-ant
Copy link
Collaborator Author

Time: 20150305T10:23:26
aavati at redhat commented:
REVIEW: http://review.gluster.org/9628 (dht : logical error and null dereference fixes.) posted (#8) for review on master by Humble Devassy Chirammal ([email protected])

@gluster-ant
Copy link
Collaborator Author

Time: 20150305T10:37:28
aavati at redhat commented:
REVIEW: http://review.gluster.org/9586 (glusterd: coverity fix.) posted (#3) for review on master by Humble Devassy Chirammal ([email protected])

@gluster-ant
Copy link
Collaborator Author

Time: 20150313T11:43:51
aavati at redhat commented:
REVIEW: http://review.gluster.org/9667 (posix : unchecked return value coverity fix) posted (#5) for review on master by Manikandan S Selvaganesh ([email protected])

@gluster-ant
Copy link
Collaborator Author

Time: 20150313T18:18:43
aavati at redhat commented:
REVIEW: http://review.gluster.org/9677 (libglusterfs : dead code fix.) posted (#3) for review on master by Humble Devassy Chirammal ([email protected])

@gluster-ant
Copy link
Collaborator Author

Time: 20150313T20:04:33
aavati at redhat commented:
REVIEW: http://review.gluster.org/9640 (fuse: Fixing dereference after null check) posted (#2) for review on master by Humble Devassy Chirammal ([email protected])

@gluster-ant
Copy link
Collaborator Author

Time: 20150315T15:43:57
aavati at redhat commented:
COMMIT: http://review.gluster.org/9556 committed in master by Vijay Bellur ([email protected])

commit 510b1f6
Author: Manikandan Selvaganesh [email protected]
Date: Tue Feb 3 13:17:19 2015 +0530

xlators/storage/bd : Unused value is removed.

CID:1128926

Change-Id: I5ad1229e225a36f995245a847db1a19609a18cd8
BUG: 789278
Signed-off-by: Manikandan Selvaganesh <[email protected]>
Reviewed-on: http://review.gluster.org/9556
Tested-by: Gluster Build System <[email protected]>
Reviewed-by: Humble Devassy Chirammal <[email protected]>
Reviewed-by: Kaleb KEITHLEY <[email protected]>
Reviewed-by: Raghavendra Bhat <[email protected]>
Reviewed-by: Vijay Bellur <[email protected]>

@gluster-ant
Copy link
Collaborator Author

Time: 20150315T15:45:53
aavati at redhat commented:
COMMIT: http://review.gluster.org/9640 committed in master by Vijay Bellur ([email protected])

commit d8c1885
Author: arao [email protected]
Date: Thu Feb 12 10:12:35 2015 +0530

fuse: Fixing dereference after null check

CID: 1124496

The pointer is not checked against null and is dereferenced anyway,
which is now checked.

Change-Id: Ib810546445596671b3656f01a14bbad02cdc221c
BUG: 789278
Signed-off-by: arao <[email protected]>
Reviewed-on: http://review.gluster.org/9640
Reviewed-by: Humble Devassy Chirammal <[email protected]>
Tested-by: Gluster Build System <[email protected]>
Reviewed-by: Vijay Bellur <[email protected]>

@gluster-ant
Copy link
Collaborator Author

Time: 20150316T04:50:25
aavati at redhat commented:
REVIEW: http://review.gluster.org/9667 (posix : unchecked return value coverity fix.) posted (#6) for review on master by Manikandan S Selvaganesh ([email protected])

@gluster-ant
Copy link
Collaborator Author

Time: 20150316T07:54:29
aavati at redhat commented:
REVIEW: http://review.gluster.org/9667 (posix : unchecked return value coverity fix) posted (#7) for review on master by Manikandan S Selvaganesh ([email protected])

@gluster-ant
Copy link
Collaborator Author

Time: 20150317T07:48:28
aavati at redhat commented:
REVIEW: http://review.gluster.org/9667 (posix : unchecked return value coverity fix.) posted (#8) for review on master by Manikandan S Selvaganesh ([email protected])

@gluster-ant
Copy link
Collaborator Author

Time: 20150317T08:04:29
aavati at redhat commented:
REVIEW: http://review.gluster.org/9553 (posix: Fixing buffer overrun coverity defects.) posted (#12) for review on master by Nandaja Varma ([email protected])

@gluster-ant
Copy link
Collaborator Author

Time: 20150318T12:18:18
aavati at redhat commented:
REVIEW: http://review.gluster.org/9553 (posix: Fixing buffer overrun coverity defects) posted (#13) for review on master by Nandaja Varma ([email protected])

@gluster-ant
Copy link
Collaborator Author

Time: 20150319T18:41:30
aavati at redhat commented:
REVIEW: http://review.gluster.org/9579 (gluster-cli : Removing logically dead code.) posted (#5) for review on master by Kaleb KEITHLEY ([email protected])

@gluster-ant
Copy link
Collaborator Author

Time: 20150320T11:21:39
aavati at redhat commented:
REVIEW: http://review.gluster.org/9628 (dht : logical error and null dereference fixes.) posted (#9) for review on master by Kaleb KEITHLEY ([email protected])

@gluster-ant
Copy link
Collaborator Author

Time: 20150324T18:24:34
aavati at redhat commented:
COMMIT: http://review.gluster.org/9679 committed in master by Vijay Bellur ([email protected])

commit d71418a
Author: Nandaja Varma [email protected]
Date: Wed Feb 18 16:40:03 2015 +0530

glusterd: Fixing wrong array comparison (Coverity fix)

Coverity CID: 1256175

Change-Id: Ib29fc2eaa54a7ce8369918e68bf117d0f04ca94d
BUG: 789278
Signed-off-by: Nandaja Varma <[email protected]>
Reviewed-on: http://review.gluster.org/9679
Reviewed-by: Vijaikumar Mallikarjuna <[email protected]>
Tested-by: Gluster Build System <[email protected]>
Reviewed-by: Humble Devassy Chirammal <[email protected]>
Reviewed-by: Kaleb KEITHLEY <[email protected]>
Reviewed-by: Vijay Bellur <[email protected]>

@gluster-ant
Copy link
Collaborator Author

Time: 20150325T08:28:46
aavati at redhat commented:
REVIEW: http://review.gluster.org/9658 (protocol-client: Fixing unchecked return value.) posted (#2) for review on master by Anusha B.Rao ([email protected])

@gluster-ant
Copy link
Collaborator Author

Time: 20150325T08:29:41
aavati at redhat commented:
REVIEW: http://review.gluster.org/9641 (features/marker: Fixing dereference after null check.) posted (#2) for review on master by Anusha B.Rao ([email protected])

@gluster-ant
Copy link
Collaborator Author

Time: 20150325T08:30:17
aavati at redhat commented:
REVIEW: http://review.gluster.org/9651 (io-cache: Removing Logically dead code.) posted (#2) for review on master by Anusha B.Rao ([email protected])

@gluster-ant
Copy link
Collaborator Author

Time: 20150325T08:30:43
aavati at redhat commented:
REVIEW: http://review.gluster.org/9646 (protocol-client: Removal of Logically dead code.) posted (#2) for review on master by Anusha B.Rao ([email protected])

@gluster-ant
Copy link
Collaborator Author

Time: 20150325T08:31:14
aavati at redhat commented:
REVIEW: http://review.gluster.org/9644 (features/quota: Fixing Logically dead code) posted (#2) for review on master by Anusha B.Rao ([email protected])

@gluster-ant
Copy link
Collaborator Author

Time: 20150325T08:31:40
aavati at redhat commented:
REVIEW: http://review.gluster.org/9637 (cli: Fixing dereference after null check) posted (#4) for review on master by Anusha B.Rao ([email protected])

@gluster-ant
Copy link
Collaborator Author

Time: 20150325T08:32:12
aavati at redhat commented:
REVIEW: http://review.gluster.org/9647 (protocol-server: Removal of Logically dead code.) posted (#2) for review on master by Anusha B.Rao ([email protected])

@gluster-ant
Copy link
Collaborator Author

Time: 20150325T08:55:16
aavati at redhat commented:
REVIEW: http://review.gluster.org/9663 (dht: Fixing dereference after null check.) posted (#2) for review on master by Anusha B.Rao ([email protected])

@gluster-ant
Copy link
Collaborator Author

Time: 20150330T06:54:29
aavati at redhat commented:
COMMIT: http://review.gluster.org/9667 committed in master by Vijay Bellur ([email protected])

commit b7d8567
Author: Manikandan Selvaganesh [email protected]
Date: Tue Feb 17 17:17:40 2015 +0530

posix : unchecked return value coverity fix.

CID   : 1124364

Change-Id: I1e16e3ff46b191ba2ea527e628c77a99a56f6c31
BUG: 789278
Signed-off-by: Manikandan Selvaganesh <[email protected]>
Reviewed-on: http://review.gluster.org/9667
Reviewed-by: Niels de Vos <[email protected]>
Reviewed-by: Kaleb KEITHLEY <[email protected]>
Tested-by: Gluster Build System <[email protected]>
Reviewed-by: Vijay Bellur <[email protected]>

@gluster-ant
Copy link
Collaborator Author

Time: 20150330T06:55:53
aavati at redhat commented:
COMMIT: http://review.gluster.org/9601 committed in master by Vijay Bellur ([email protected])

commit 298e94f
Author: Manikandan Selvaganesh [email protected]
Date: Fri Feb 6 16:29:09 2015 +0530

protocol/client : logical dead code removed

    CID :112438{2,3,4,5}
         11244{03,04,05,06,07,08,09,10,11,12,13,14,30,31,32,33}
         11244{34,35,36,37,38,39,40,41,42,43,44,56,57,58,59,60}
         11244{61,62,63,64,65,66,67,68,69,70}
         1128902

Change-Id: I1b53aeee83209728d5711540210d19314f4165bc
BUG: 789278
Signed-off-by: Manikandan Selvaganesh <[email protected]>
Reviewed-on: http://review.gluster.org/9601
Tested-by: Gluster Build System <[email protected]>
Reviewed-by: Vijay Bellur <[email protected]>

@sunnyku
Copy link
Contributor

sunnyku commented Mar 17, 2020

Clubbing all issues reported by Coverity at one place.
duplicate of #1060

@sunnyku sunnyku closed this as completed Mar 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants