Modify
Warning Please read the Ticket HowTo before creating or commenting on a ticket. Failure to do so may cause your ticket to be rejected or result in a slower response.

Opened 10 months ago

Closed 10 months ago

Last modified 10 months ago

#11612 closed Patch - Bug Fix (fixed)

Patch to check the return value from posix_fadvise in fileringbuffer.cpp - fixes coverity 746748 and 766747

Reported by: Gary Buhrmaster <gary.buhrmaster@…> Owned by: Gary Buhrmaster <gary.buhrmaster@…>
Priority: minor Milestone: 0.27
Component: MythTV - General Version: Master Head
Severity: medium Keywords:
Cc: Ticket locked: no

Description

Static analysis determined that the return value from posix_fadvise was not checked. Check the return, and log if failed (only debug level logging, since fadvise should never fail in the first place, and if it does fail it should not matter (it is, after all, only a hint) but if debugging, the failure might tell one something).

Fixes coverity 746748 and 746747

github ref: https://github.com/garybuhrmaster/mythtv/commit/e6bbaf778585fd2b8f930d61164cfe0622744d93

github git-am ref: https://github.com/garybuhrmaster/mythtv/commit/e6bbaf778585fd2b8f930d61164cfe0622744d93.patch

Attachments (0)

Change History (4)

comment:1 Changed 10 months ago by danielk

If these advisory calls don't work we don't really want to spam the logs. They are just intended to give the operating system a heads up if it supports it.

comment:2 Changed 10 months ago by Gary Buhrmaster <gary.buhrmaster@…>

Since the only errors returned per the spec (which would only result in logs if running at the file debug level anyway) will occur with a programming error (bad fd, bad advise option specification), the logs would not be spammed (unless there is something else seriously broken in some new codes). fadvise does not return an error if it simply decides to ignore the offset/sizes (it simple ignores the advise, and moves on), so logs would never be generated in those cases.

comment:3 Changed 10 months ago by Gary Buhrmaster <gary.buhrmaster@…>

  • Owner set to Gary Buhrmaster <gary.buhrmaster@…>
  • Resolution set to fixed
  • Status changed from new to closed

In 351c36ac73d664a370b9b12c655604c03ba71ca1/mythtv:

Check the return value from posix_fadvise

Static analysis determined that the return value
from posix_fadvise was not checked. Check the
return, and log if failed (only debug level
logging, since fadvise should never fail in the
first place, and if it does fail it should not
matter (it is, after all, only a hint) but if
debugging, the failure might tell one something).

Fixes coverity 746748 and 746747

Fixes #11612.

Signed-off-by: Paul Harrison <pharrison@…>

comment:4 Changed 10 months ago by paulh

  • Milestone changed from unknown to 0.27

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'new'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.