0
아마도 누군가 나를 도울 수 있습니다. 내 프로젝트에서 동적 할당 링크 된 목록을 사용하고 있습니다. 그리고 난 그냥보고 있어요, 그 이유를 모르겠지만, 나는 그것을 컴파일려고하면 그냥 :(왜 SIGABRT (동적 할당)가 표시됩니까?
void insertLast (TList *list, wchar_t *string) {
TWord *newWord;
if ((newWord = malloc (sizeof(TWord))) == NULL)
exit (EXIT_FAILURE);
newWord->prev = list->tail;
newWord->next = NULL;
newWord->word = malloc(wcslen(string) * sizeof(wchar_t));
wcscpy(newWord->word, string);
if (list->tail != NULL) {
list->tail->next = newWord;
} else {
list->head = newWord;
}
list->tail = newWord;
}
작동하지 않습니다
lab: malloc.c:3096: sYSMALLOc: Assertion `(old_top == (((mbinptr) (((char  &((av)->bins[((1) - 1) * 2])) - __builtin_offsetof (struct malloc_chunk, fd)))) && old_size == 0) || ((unsigned long) (old_size) >= (unsigned long)((((__builtin_offsetof (struct malloc_chunk, fd_nextsize))+((2 * (sizeof(size_t))) - 1)) & ~((2 * (sizeof(size_t))) - 1))) && ((old_top)->size & 0x1) && ((unsigned long)old_end & pagemask) == 0)' failed.
중단됨
나는이 문제를 왜 어쩌면 누군가는 말할 수