[SERVER-21529] Sign of log severity values may get lost, depending on compiler Created: 18/Nov/15 Updated: 23/Nov/16 Resolved: 22/Dec/15 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Portability |
| Affects Version/s: | None |
| Fix Version/s: | 3.2.5, 3.3.0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Bryan Chan | Assignee: | Andrew Morrow (Inactive) |
| Resolution: | Done | Votes: | 0 |
| Labels: | code-only, ppc64le_3_2_backport | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||
| Operating System: | ALL | ||||||||
| Backport Completed: | |||||||||
| Sprint: | Platforms E (01/08/16) | ||||||||
| Participants: | |||||||||
| Description |
|
LogSeverity::Log().toInt() returns a possibly negative integer, which is cast into a char in several places, with the assumption that char's are signed by default. This assumption is not true for all platforms; GCC on ppc64 and s390x treats char's as unsigned by default. This causes the unit test server_options_test to fail on those platforms. The fix is to explicitly declare LogComponentSettings::_minimumLoggedSeverity as a signed char array. |
| Comments |
| Comment by Githook User [ 08/Mar/16 ] |
|
Author: {u'username': u'acmorrow', u'name': u'Andrew Morrow', u'email': u'acm@mongodb.com'}Message: (cherry picked from commit 07b2e02ffddbd9998b8c738895f3fae85b592176) |
| Comment by Githook User [ 22/Dec/15 ] |
|
Author: {u'username': u'acmorrow', u'name': u'Andrew Morrow', u'email': u'acm@mongodb.com'}Message: |