[ZBX-6584] Possible agent crash when processing logrt[] key on windows platform Created: 2013 May 08 Updated: 2017 May 30 Resolved: 2013 May 10 |
|
Status: | Closed |
Project: | ZABBIX BUGS AND ISSUES |
Component/s: | Agent (G) |
Affects Version/s: | 1.8.16rc2 |
Fix Version/s: | 1.8.17rc1, 2.0.7, 2.1.0 |
Type: | Incident report | Priority: | Critical |
Reporter: | Andris Zeila | Assignee: | Unassigned |
Resolution: | Fixed | Votes: | 0 |
Labels: | log, logrt | ||
Remaining Estimate: | Not Specified | ||
Time Spent: | Not Specified | ||
Original Estimate: | Not Specified | ||
Environment: |
Windows |
Issue Links: |
|
Description |
If the monitored log file was moved in the time before checking for its existence and opening it, then on windows platform agent would crash. |
Comments |
Comment by Andris Zeila [ 2013 May 08 ] |
Fixed in development branch svn://svn.zabbix.com/branches/dev/ZBX-6584 |
Comment by dimir [ 2013 May 08 ] |
The problem happens when a log file was removed between agent calling stat() and open() on a log file. When this happens open() results in an error and next call to close() results in crash. Steps to reproduce:
Before the fix the check for close was in place but it just checked for file descriptor != 0, it did not handle situation when it would be -1. The fix is to call close() only when file descriptor is greater than 0. Successfully tested. |
Comment by dimir [ 2013 May 09 ] |
The problem does not happen with log items, only logrt. |
Comment by Andris Zeila [ 2013 May 09 ] |
Released in: |
Comment by Oleksii Zagorskyi [ 2013 May 10 ] |
Reopen to add labels - could be useful for future. |
Comment by dimir [ 2013 May 10 ] |
So, a real world case could be as follows:
Technically the problem is incorrect error handling of open() system call. |
Comment by dimir [ 2013 May 10 ] |
Another point, the crash is possible only on a Windows platform. |