-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ikcp_release crash in android #437
Comments
are you using one kcp object in different threads? |
when I use it , i will lock it. this is my code , like this // this will call pthread_mutex_lock, I have open PTHREAD_MUTEX_RECURSIVE
status = lock_acquire(tp->timer_lock);
if (status != SUCCESS) {
LOG(4, ("kcp session restarted failed, lock is null"));
return status;
}
itr = hash_first(tp->all_sess, &itr_val);
char key[0x50] = {'\0'};
while (itr) {
void *entry = hash_this(tp->all_sess, itr);
const char *k = Session_C_GetAddrStr(entry);
memcpy(key, k, ansi_strlen(k));
LOG(5, (THIS_FILE, "kcp restart session: %s, %d ready to release it", key, ansi_strlen(key)));
Session_C_Destroy(entry);
entry = NULL;
hash_set(NULL, tp->all_sess, key, ansi_strlen(key), 0, entry);
itr = hash_next(tp->all_sess, itr);
}
status = lock_release(tp->timer_lock);
if (status != SUCCESS) {
LOG(4, (tp->base.obj_name,"SIP kcp session restarted failed, lock release is null"));
return status;
} and This crash only occurs once on Huawei phones. At present, there is no recurrence |
It has nothing to do with specific hardware, pure algorithm code. |
I know. I have found a crash fix in latest issue, It may be caused by it. |
Description
I meet it in android when I call ikcp_release method. maybe I have a error usage,someone can give me some suggestion?
Version
libkcp
this version maybe old, but I have compare lastest ikcp, have no any big change.
Stack
The text was updated successfully, but these errors were encountered: