Skip to content

segmentation fault with HTTP Response with big JSON body #114

Description

@ishansheth

Hi,

I am using your library and i am getting a crash inside the library when the HTTPResponse has around 78 K big JSON payload.
The crash happens at IoReaderImpl.cpp line number 33 according to gdb.

There i think the buffer is filled with payload data iteratively. On the first iteration its ok and around 16 K data is filled in the buffer. In the second iteration its failing and crashing

Would you be able to tell what is the cause of it? Is there a place where i need to configure the buffer size?

Here are the traces :

[2021-04-21 15:54:04.929226] [0x00007fec8f94b700] [trace] Created timer StartReceiveFromServer for {Connection c4996c71-4b6a-4263-9589-167b77817459 {Socket socket# 9 10.161.70.168:38894 <--> 10.161.70.150:80}}
[2021-04-21 15:54:04.929344] [0x00007fec8f94b700] [trace] DataReaderStream: Chained to N9restc_cpp10DataReaderE
[2021-04-21 15:54:04.929493] [0x00007fec8f94b700] [trace] Created timer IoReaderImpl for {Connection c4996c71-4b6a-4263-9589-167b77817459 {Socket socket# 9 10.161.70.168:38894 <--> 10.161.70.150:80}}
[2021-04-21 15:54:04.939901] [0x00007fec8f94b700] [trace] Canceled timer IoReaderImpl
[2021-04-21 15:54:04.939979] [0x00007fec8f94b700] [trace] Read #14480 bytes from 0x7fec88001e20
[2021-04-21 15:54:04.940007] [0x00007fec8f94b700] [trace] DataReaderStream::Fetch: Fetched buffer with 14480 bytes.
[2021-04-21 15:54:04.940039] [0x00007fec8f94b700] [trace] ReadServerResponse: getc_bytes is 17
[2021-04-21 15:54:04.940062] [0x00007fec8f94b700] [trace] HTTP Response: HTTP/1.1 200 OK
[2021-04-21 15:54:04.940115] [0x00007fec8f94b700] [trace] Server: nginx/1.16.1
[2021-04-21 15:54:04.940153] [0x00007fec8f94b700] [trace] Date: Wed, 21 Apr 2021 13:54:17 GMT
[2021-04-21 15:54:04.940210] [0x00007fec8f94b700] [trace] Content-Type: application/json
[2021-04-21 15:54:04.940248] [0x00007fec8f94b700] [trace] Content-Length: 14339
[2021-04-21 15:54:04.940301] [0x00007fec8f94b700] [trace] Connection: keep-alive
[2021-04-21 15:54:04.940329] [0x00007fec8f94b700] [trace] ReadHeaderLines: getc_bytes is 157
[2021-04-21 15:54:04.940392] [0x00007fec8f94b700] [trace] Canceled timer StartReceiveFromServer
[2021-04-21 15:54:04.940496] [0x00007fec8f94b700] [trace] Done-handler is destroyed
[2021-04-21 15:54:04.940685] [0x00007fec919d1c00] [trace] DataReaderStream::ReadSome: Returning buffer with 14323 bytes.
[2021-04-21 15:54:04.940995] [0x00007fec919d1c00] [trace] Created timer IoReaderImpl for {Connection c4996c71-4b6a-4263-9589-167b77817459 {Socket socket# 9 10.161.70.168:38894 <--> 10.161.70.150:80}}
Segmentation fault

your input would be really helpful.

Regards,

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions