netconn_new crashing "STACKOVERFLOW"

dmorar
Posts: 2
Joined: Wed Oct 25, 2017 9:29 pm

netconn_new crashing "STACKOVERFLOW"

Postby dmorar » Wed Oct 25, 2017 9:45 pm

Hello,

I have been working with the esp32, trying to get my httpserver from esp8266.

I migrated the code to the new architecture and it seems to receive just fine data, but when i try to netconn_write i get a stackoverflow detection.

This is a snippet of the code i'm using:

Code: Select all

    xSemaphoreTake(write_socket_lock, portMAX_DELAY);
    _httpserver_response_header(buffer, response);
    if (strlen(buffer) > 0) {
        ets_printf("\n\n\n\nbefore crash\n");
        netconn_write(request->conn, buffer, strlen(buffer), NETCONN_COPY);
        ets_printf("after write 1\n");
        netconn_write(request->conn, response->body, response->body_len, NETCONN_COPY);
        ets_printf("after crash 2\n");
    }    
    xSemaphoreGive(write_socket_lock);
    ets_printf("after semaphore\n");
I tried to use NOCOPY, but somewhere in this forums someone suggested to use NETCONN_COPY instead. And this is what i get on monitor:

Code: Select all

before crash
***ERROR*** A stack overflow in task server80.start has been detected.

I appreciate any help you can provide to debug this.

Thanks.

DM

ESP_Angus
Posts: 2344
Joined: Sun May 08, 2016 4:11 am

Re: netconn_new crashing "STACKOVERFLOW"

Postby ESP_Angus » Thu Oct 26, 2017 2:18 am

Where you call vTaskCreate() to create this task, increase the stack size value.

dmorar
Posts: 2
Joined: Wed Oct 25, 2017 9:29 pm

Re: netconn_new crashing "STACKOVERFLOW"

Postby dmorar » Thu Oct 26, 2017 3:18 pm

Hi Angus,

I can't believe this was the issue and i didn't see it. Thank you so much. That solved the problem.

:D

DM

Who is online

Users browsing this forum: No registered users and 111 guests