Segfault using uuid_compare() in <uuid/uuid.h>
| Originator: | justatheory | ||
| Number: | rdar://22370147 | Date Originated: | 2015-08-20 |
| Status: | Open | Resolved: | |
| Product: | Developer Tools | Product Version: | OS X 10.10 and 10.11 |
| Classification: | Crashing | Reproducible: | Always |
Summary:
The uuid_compare() function imported form <uuid/uuid.h> segfaults.
Steps to Reproduce:
1. Use `xcode-select --install ` to install the command-line tools.
2. Paste this code into testprog.c:
#include <stdio.h>
#include <uuid/uuid.h>
int main(void) {
int i;
char s[37];
uuid_t u,uu;
uuid_generate(u);
uuid_generate(uu);
/* uuid_parse(s,u); */
i = uuid_compare(u,uu);
printf("Success!\n");
return 0;
}
3. Run this command:
cc -luuid -o testprog testprog.c && ./testprog
Expected Results:
Output should be "Success!"
Actual Results:
Program segfaults.
Version:
OS X El Capitan 10.11 Beta (15A225f)
Notes:
Uncomment the uuid_parse() line and the segfault goes away.
Configuration:
First seen in Yosemite. Crash persists in El Capitan Beta
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!
Apple Developer Relations 09-Oct-2015 02:44 PM
Engineering has the following feedback for you:
I'm not sure where that -luuid comes from but that's certainly not Apple code as UUID is part of libc on OS X.
So for all I know it could be a bug or buffer overflow in that library.
We are now closing this bug report.
If you have questions or comments about the resolution, please update your bug report with that information so we can respond.