Replies: 4 comments 4 replies
-
Use AddressSanitizer and you will find your issue. Most likely heap-use-after-free. |
Beta Was this translation helpful? Give feedback.
-
I tried AddressSanitizer and it gave me the following error:
|
Beta Was this translation helpful? Give feedback.
-
Papyrus+0x236fd This is an offset in your binary. If you compile with -g you will see line numbers instead. |
Beta Was this translation helpful? Give feedback.
-
Aha yes. On line 85 you create std::string body on the stack then you capture it by ref in onData and let it die. You can do like this instead:
|
Beta Was this translation helpful? Give feedback.
-
I am trying to recieve a json body in uWS by adding all chunks to a string and parsing it when last is true, the json parsing works fine but when I want to return an early response because of missing json data the program segfaults, I tried removing any response part and it did not segfault, instead the client just waiting for a response (obviously).
https://pastes.dev/RRV6fw7mDA#L93
I am quite new to C++ itself so please dont be too harsh if its obvious.
Beta Was this translation helpful? Give feedback.
All reactions