Skip to content
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

[TW#26962] esp_http_client crashes with is_async for non-ssl url #2624

Closed
devsaurus opened this issue Oct 23, 2018 · 2 comments
Closed

[TW#26962] esp_http_client crashes with is_async for non-ssl url #2624

devsaurus opened this issue Oct 23, 2018 · 2 comments

Comments

@devsaurus
Copy link
Contributor

Environment

  • Development Kit: []
  • Core (if using chip or module): [ESP32-Wrover]
  • IDF version (git rev-parse --short HEAD to get the commit id.): 7313e39
  • Development Env: [Make]
  • Operating System: [openSuse]
  • Power Supply: [USB|Battery]

Problem Description

I want to access a http://server/path url with esp_http_client in asynchronous mode but the core crashes.

Expected Behavior

Server is connected the same way as when is_async = false.

Actual Behavior

Guru Meditation Error: Core  0 panic'ed (InstrFetchProhibited). Exception was unhandled.

In case of is_async = true, function esp_http_client_connect() calls esp_transport_connect_async(), but the member _connect_async is not set for transport_tcp. NULL pointer is dereferenced and core panics.

Steps to reproduce

Compile the example below and execute. The example is an excerpt from https://github.com/espressif/esp-idf/blob/129d32772e5e5eafe88be5b9eb34687e84a6f8b8/examples/protocols/esp_http_client/main/esp_http_client_example.c

Code to reproduce this issue

esp_http_client_config_t config = {
  .url = "http://server/path",
  .event_handler = _http_event_handler,
  .is_async = true,
  .timeout_ms = 5000,
};
esp_http_client_handle_t client = esp_http_client_init(&config);
err = esp_http_client_perform(client);
@Alvin1Zhang Alvin1Zhang changed the title esp_http_client crashes with is_async for non-ssl url [TW#26962] esp_http_client crashes with is_async for non-ssl url Oct 24, 2018
@jitin17
Copy link
Contributor

jitin17 commented Oct 24, 2018

@devsaurus Thanks for bringing this to our notice. As of now, only asynchronous HTTPS connections are supported. Though it shouldn't have crashed for http URL, which will be resolved soon. And support for async HTTP wasn't added because it involved some changes in existing APIs, but it will be added soon.

@devsaurus
Copy link
Contributor Author

Thanks a lot for looking into this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants