Bugfix wrong use of qsort
- The qsort() function is defined as:
void qsort(void *base, size_t nmemb, size_t size,
int (*compar)(const void *, const void *));
and sorts an array with nmemb elements of size size.
- in the gNB scheduling functions, nmemb and size were swapped
- this was causing a stack overflow ending with a SEGFAULT under certain circumstances
This commit is contained in:
@@ -628,7 +628,7 @@ void pf_dl(module_id_t module_id,
|
||||
}
|
||||
}
|
||||
|
||||
qsort(UE_sched, sizeof(*UE_sched), sizeofArray(UE_sched), comparator);
|
||||
qsort(UE_sched, sizeofArray(UE_sched), sizeof(UEsched_t), comparator);
|
||||
UEsched_t *iterator = UE_sched;
|
||||
|
||||
const int min_rbSize = 5;
|
||||
|
||||
@@ -1705,7 +1705,7 @@ void pf_ul(module_id_t module_id,
|
||||
curUE++;
|
||||
}
|
||||
|
||||
qsort(UE_sched, sizeof(*UE_sched), sizeofArray(UE_sched), comparator);
|
||||
qsort(UE_sched, sizeofArray(UE_sched), sizeof(UEsched_t), comparator);
|
||||
UEsched_t *iterator=UE_sched;
|
||||
|
||||
/* Loop UE_sched to find max coeff and allocate transmission */
|
||||
|
||||
Reference in New Issue
Block a user