-
Notifications
You must be signed in to change notification settings - Fork 737
Crash when logging invalid characters #662
Comments
Can you write a simple test case which will cause this crash? I would really appreciate so I can iterate on it and fix xctool eventually. |
But most likely crash is hit at this line: https://github.com/facebook/xctool/blob/master/Common/TaskUtil.m#L127. |
Thanks for the hint @ExtremeMan . A few notes:
I will continue my investigation until I catch the string causing the exception, but at least there is a work-around for now. I'll let you know when I have a simple test for it. |
I am able to reproduce the bug with this quick&dirty test: static void dummy_test(void){
FILE*fp = fopen("/tmp/test.txt", "r");
if (fp) {
char *line = NULL;
size_t linecap = 0;
ssize_t linelen;
while ((linelen = getline(&line, &linecap, fp)) > 0)
fprintf(stderr, "%s\n", line);
fclose(fp);
}
} With test.txt. Interesting enough: copying/pasting file content in a variable and escaping quotes lead to no exception. |
Thanks for the example. I am able to reproduce locally. |
Can you try this branch for me - https://github.com/facebook/xctool/tree/nekto/utf8_handling? |
Yep, it solves the issue! |
Using master version, tests are crashing consistently when invoked from Jenkins using XCode7.2 (SDK 9:2). Before updating to master, I was getting crashes similar to #555 and #650. I am/was also affected by #623 hence I had to strip XML after xctool completed, so there was always an issue with bad characters I am dumping in logs. Any clue? (except of removing logs!).
The text was updated successfully, but these errors were encountered: