deadlock calling pppapi_free

Ivan_G
Posts: 1
Joined: Fri May 11, 2018 4:22 pm

deadlock calling pppapi_free

Postby Ivan_G » Fri May 11, 2018 4:40 pm

Hi,
I'm facing the following issue, (code attached below) once pppapi_free been called the current task goes to a deadlock, checking docs, seems that pppapi_free should be called inside tcpip thread but I didn't find any way to do that.
I also checked on espidf ppp example, but there isn't a ppp_pcb release.
Anyone has a full example of ppp re-creation?

All suggestions are welcome, thanks in advance

Code: Select all

static ppp_pcb *ppp = NULL;

static bool gsm_ppp_connect()
{
	ESP_LOGW(TAG, "gsm_ppp_connect 1");
	if(ppp != NULL)
	{
		pppapi_free(ppp);	
		ppp = NULL;
	}

	ESP_LOGW(TAG, "gsm_ppp_connect 2");
	
	ppp = pppapi_pppos_create(&ppp_netif, ppp_output_callback, ppp_status_cb, NULL);
	if (ppp == NULL) 
	{
		ESP_LOGE(TAG, "Error initializing PPPoS");
		return false;
	}

	ESP_LOGW(TAG, "gsm_ppp_connect 3");
	pppapi_set_default(ppp);
	
	ESP_LOGW(TAG, "gsm_ppp_connect 4");
	pppapi_set_auth(ppp, PPPAUTHTYPE_PAP, config->gsm_user, config->gsm_pass);
	
	ESP_LOGW(TAG, "gsm_ppp_connect 5");
	pppapi_connect(ppp, 0);
	
	ESP_LOGW(TAG, "gsm_ppp_connect 6");
	return true;
}

torarqui
Posts: 3
Joined: Thu Oct 03, 2019 11:17 am

Re: deadlock calling pppapi_free

Postby torarqui » Wed Oct 23, 2019 4:53 pm

Did you manage to resolve this issue? I have the same problem

Who is online

Users browsing this forum: No registered users and 44 guests