I recently found the blog post http://www.viva64.com/en/b/0281/,
where the author run his C++ static analyser (PVS Studio) against VirtualBox source code, and found a couple of issues.
As I know, he does not reported found issues.
I wonder are VirtualBox developers know about these issues?
Should I create bugtracker tikets for them?
issues found in VirtualBox source code checked by PSV Studio
-
- Posts: 6
- Joined: 19. Dec 2013, 06:37
-
- Site Moderator
- Posts: 39134
- Joined: 4. Sep 2008, 17:09
- Primary OS: MS Windows 10
- VBox Version: PUEL
- Guest OSses: Mostly XP
Re: issues found in VirtualBox source code checked by PSV St
Are the warnings useful? Just because a static analyzer flagged some warnings doesn't mean it is right.
-
- Posts: 6
- Joined: 19. Dec 2013, 06:37
Re: issues found in VirtualBox source code checked by PSV St
I know there should be false positive warnings, and maybe there are no serious bugs,
but most issues are suspicious, for example:
V626 Consider checking for misprints. It's possible that ',' should be replaced by ';'. ldrmemory.cpp 317
V583 The '?:' operator, regardless of its conditional expression, always returns one and the same value: g_acDaysInMonthsLeap[pTime->u8Month - 1]. time.cpp 453
but most issues are suspicious, for example:
V626 Consider checking for misprints. It's possible that ',' should be replaced by ';'. ldrmemory.cpp 317
Code: Select all
/*@file
*IPRT-Binary Image Loader, The Memory/Debugger Oriented Parts.*/
RTDECL(int) RTLdrOpenInMemory(....)
{
if (RT_SUCCESS(rc))
{
....
}
else
pfnDtor(pvUser), //<==
*phLdrMod = NIL_RTLDRMOD;
}
Code: Select all
static const uint8_t g_acDaysInMonths[12] =
{
/*Jan Feb Mar Arp May Jun Jul Aug Sep Oct Nov Dec */
31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31
};
static const uint8_t g_acDaysInMonthsLeap[12] =
{
/*Jan Feb Mar Arp May Jun Jul Aug Sep Oct Nov Dec */
31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31
};
static PRTTIME rtTimeNormalizeInternal(PRTTIME pTime)
{
....
unsigned cDaysInMonth = fLeapYear
? g_acDaysInMonthsLeap[pTime->u8Month - 1] //<==
: g_acDaysInMonthsLeap[pTime->u8Month - 1]; //<==
....
}
-
- Site Moderator
- Posts: 39134
- Joined: 4. Sep 2008, 17:09
- Primary OS: MS Windows 10
- VBox Version: PUEL
- Guest OSses: Mostly XP
Re: issues found in VirtualBox source code checked by PSV St
I agree, that comma looks suspicious given the indentation of the next line.
This is a user forum. Perhaps you should raise this on the developer mailing list rather than here.
This is a user forum. Perhaps you should raise this on the developer mailing list rather than here.
-
- Oracle Corporation
- Posts: 3362
- Joined: 7. Jun 2007, 09:11
- Primary OS: Debian Sid
- VBox Version: PUEL
- Guest OSses: Linux, Windows
- Location: Dresden, Germany
- Contact:
Re: issues found in VirtualBox source code checked by PSV St
Thank you for this notification. We went through these issues and fixed most of them. I don't think there was any serious issue (some of the issues reported in HostDrivers/Support were already fixed after 4.3.16) but nevertheless it makes sense to fix them. VBox 4.3.18 will contain a part of these fixes.
Thanks again!
Thanks again!
-
- Site Moderator
- Posts: 39134
- Joined: 4. Sep 2008, 17:09
- Primary OS: MS Windows 10
- VBox Version: PUEL
- Guest OSses: Mostly XP
Re: issues found in VirtualBox source code checked by PSV St
Frank, did you see the similar topic in the beta area?
-
- Oracle Corporation
- Posts: 3362
- Joined: 7. Jun 2007, 09:11
- Primary OS: Debian Sid
- VBox Version: PUEL
- Guest OSses: Linux, Windows
- Location: Dresden, Germany
- Contact:
Re: issues found in VirtualBox source code checked by PSV St
No, I didn't but these are the same reports AFAICS.