[CDRIVER-2575] misaligned address in mongoc-client.c Created: 28/Mar/18 Updated: 28/Oct/23 Resolved: 25/Apr/18 |
|
| Status: | Closed |
| Project: | C Driver |
| Component/s: | libmongoc |
| Affects Version/s: | 1.9.3 |
| Fix Version/s: | 1.10.0 |
| Type: | Task | Priority: | Major - P3 |
| Reporter: | Jeroen Ooms [X] | Assignee: | Unassigned |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
UBSAN is reporting the following problem, even when I compile without BSON_EXTRA_ALIGN:
|
| Comments |
| Comment by Githook User [ 25/Apr/18 ] | ||
|
Author: {'email': 'kevin.albertson@10gen.com', 'username': 'kevinAlbs', 'name': 'Kevin Albertson'}Message: | ||
| Comment by A. Jesse Jiryu Davis [ 05/Apr/18 ] | ||
|
Need to memcpy from "data" to a local uint16_t before calling ntohs. | ||
| Comment by Jeroen Ooms [X] [ 29/Mar/18 ] | ||
|
This case was using gcc 7.3.0 from debian unstable with:
I get a lot of alignment errors if I compile with
but that is expected. However it should not give any alignment errors when compiling without this macro. Also these sanitizers check at runtime so perhaps my examples are not hitting all libmongoc code. | ||
| Comment by A. Jesse Jiryu Davis [ 29/Mar/18 ] | ||
|
Thanks Jeroen, which compiler version and flags please? We're a little confused because -fsanitize=address gives us many more warnings than this one. | ||
| Comment by Jeroen Ooms [X] [ 28/Mar/18 ] | ||
|
I'm using 1.9.3 on Linux. So this is about this line in the C driver:
| ||
| Comment by Kevin Albertson [ 28/Mar/18 ] | ||
|
Hi Jeroen, what version of the C driver are you using and what platform are you building it on? |