Skip to content

HTTPS | ESP32 | Core 0 panic'ed #85

Open
@r-zlotorzynski

Description

@r-zlotorzynski

Hello
I have a problem with the library on the ESP32 platform. The situation is as follows:

  1. I start the HTTPS server
  2. I connect to the server using a browser
      - the browser makes a connection on 2-3 sockets (this is its nature and we will not change it :))
  3. TLS negotiation is carried out correctly
  4. GET requests are received
  5. Reply is carried out by me
  6. Sockets are closed (some with error)
  7. Error closing (Core 0 panic'ed)

I present the exact outline of the situation in the logs.

First of all - I added a few logs (CLOSING n) in the HTTPSConnection.cpp file in the closeConnection () method to better explain the situation :

image

The result is this debug:

[HTTPS:I:     25987] New connection. Socket FID=56
[HTTPS:D:     35182] Data on Socket FID=56
[HTTPS:I:     35184] Request: GET / (FID=56)
[HTTPS:I:     35185] New connection. Socket FID=57
[HTTPS:E:     35187] SSL_new failed. Aborting handshake. FID=57
[HTTPS:W:     35189] CLOSING 1
[HTTPS:W:     35191] CLOSING 5
[HTTPS:I:     35194] Connection closed. Socket FID=57
[HTTPS:D:     35200] Free headers
[HTTPS:W:     35202] CLOSING 1
[HTTPS:W:     35205] CLOSING 5
[HTTPS:D:     35211] Data on Socket FID=56
[HTTPS:D:     35212] Header: Host = rz-gdansk.example.pl (FID=56)
[HTTPS:D:     35217] Header: Connection = keep-alive (FID=56)
[HTTPS:D:     35223] Header: Cache-Control = max-age=0 (FID=56)
[HTTPS:D:     35228] Header: DNT = 1 (FID=56)
[HTTPS:D:     35233] Header: Upgrade-Insecure-Requests = 1 (FID=56)
[HTTPS:D:     35239] Header: User-Agent = Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.163 Safari/537.36 (FID=56)
[HTTPS:D:     35253] Header: Sec-Fetch-Dest = document (FID=56)
[HTTPS:D:     35259] Header: Accept = text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9 (FID=56)
[HTTPS:D:     35274] Header: Sec-Fetch-Site = cross-site (FID=56)
[HTTPS:D:     35280] Header: Sec-Fetch-Mode = navigate (FID=56)
[HTTPS:D:     35285] Header: Sec-Fetch-User = ?1 (FID=56)
[HTTPS:D:     35292] Data on Socket FID=56
[HTTPS:D:     35294] Header: Accept-Encoding = gzip, deflate, br (FID=56)
[HTTPS:D:     35301] Header: Accept-Language = pl-PL,pl;q=0.9,en-US;q=0.8,en;q=0.7 (FID=56)
[HTTPS:D:     35309] Header: Cookie = io=Bxxbiyg_RSYlvrEWAAAA (FID=56)
[HTTPS:D:     35315] Headers finished, FID=56
[HTTPS:D:     35320] Resolving resource...
[HTTPS:D:     35323] Keep-Alive activated. FID=56
[HTTPS:D:     35327] Creating buffered response, size: 1400
		
		
		IN THIS PLACE I AM SENDING A RESPONSE 
		
		
[HTTPS:D:     35965] Printing headers
[HTTPS:D:     35971] Draining response buffer


		THIS PLACE IS COMPLETING SENDING A RESPONSE 


[HTTPS:D:     37630] Data on Socket FID=56
[HTTPS:E:     37631] An receive error occured, FID=56
[HTTPS:W:     37631] CLOSING 1
[HTTPS:W:     37631] CLOSING 2
[HTTPS:W:     37633] CLOSING 3
[HTTPS:W:     37636] CLOSING 5
[HTTPS:I:     37639] Connection closed. Socket FID=56
[HTTPS:D:     37644] Free headers

Guru Meditation Error: Core  0 panic'ed (LoadProhibited). Exception was unhandled.
Core 0 register dump:
PC      : 0x401a91e5  PS      : 0x00060a30  A0      : 0x800e6d10  A1      : 0x3ffdd440
A2      : 0x00000000  A3      : 0x3ffc2774  A4      : 0x3f40655f  A5      : 0x00000000
A6      : 0x3ffdd3fc  A7      : 0x3ffdd3fc  A8      : 0x800e6e44  A9      : 0x3ffdd420
A10     : 0x00000000  A11     : 0x00000000  A12     : 0x4dc1ce84  A13     : 0x3ffc2b9c
A14     : 0x3ffdd3dc  A15     : 0x3ffdd3dc  SAR     : 0x00000004  EXCCAUSE: 0x0000001c  
EXCVADDR: 0x00000018  LBEG    : 0x400014fd  LEND    : 0x4000150d  LCOUNT  : 0xffffffff

Backtrace: 0x401a91e5:0x3ffdd440 0x400e6d0d:0x3ffdd460 0x400e4c93:0x3ffdd480 0x401a6c3e:0x3ffdd4a0 0x400e6011:0x3ffdd4c0 0x400e362e:0x3ffdd6a0 0x400d7709:0x3ffdd6d0 0x4008bffd:0x3ffdd760   

Rebooting...

So my question is, did anyone else have such a problem?

To avoid this error, I have temporarily removed the line shown in the screenshot below. Will this solution not affect the library's operation?

image

File
HTTPConnection.cpp -> int HTTPConnection::updateBuffer()

After commenting on this line, the problem does not occur.

Thank you in advance for your help.
Greetings

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions