httpcontext pointer is getting null whcih is causing crash. #1671
Unanswered
varma08420
asked this question in
Q&A
Replies: 1 comment 2 replies
-
You need to use onAborted and make sure you don't touch the HttpResponse after aborted |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have compiled all your examples from uSockets and ran all types of routes, which works perfectly fine.i have implemented almost same simple form of http server using App. i observed that for cases in which http body is received , in those cases while responding after processing the data, my application getting crashed at
#0 0x00000000004e9ed3 in us_socket_context_loop (ssl=1, context=0x0) at src/context.c:134
#1 0x000000000047cbdc in uWS::AsyncSocket::getLoopData (this=0x7f13037ef770)
at /data1/myhome/mahendrae/sib/SIB/genesys/GENESYS/genesysPF//third_party/uWS/include/AsyncSocket.h:86
#2 0x000000000047c26e in uWS::AsyncSocket::isCorked (this=0x7f13037ef770)
at /data1/myhome/mahendrae/sib/SIB/genesys/GENESYS/genesysPF//third_party/uWS/include/AsyncSocket.h:151
#3 0x000000000047ac6a in uWS::HttpResponse::cork(ofats::any_invocable<void ()>&&) (this=0x7f13037ef770, handler=...)
at /data1/myhome/mahendrae/sib/SIB/genesys/GENESYS/genesysPF//third_party/uWS/include/HttpResponse.h:498
#4 0x000000000047358c in RtLIX1Handler::rtSendRespToLim (this=0x2e83590, a_li_resp_data=..., ap_resp=0x7f13037ef770, ap_db_op_data=0x7f12e0090a30,
a_target_vector=std::vector of length 0, capacity 0)
at /data1/myhome/mahendrae/sib/SIB/APP/app_logic/code/LI/RtLIX1Handler/src/RtLIX1Handler.cpp:2488
#5 0x000000000047761f in RtLIX1Handler::rtHandleFileDumpResponse (this=0x2e83590, ap_resp_data=0x7f13037df710)
at /data1/myhome/mahendrae/sib/SIB/APP/app_logic/code/LI/RtLIX1Handler/src/RtLIX1Handler.cpp:3588
#6 0x000000000046d5ed in RtLIX1Handler::rtHandleTransactionRequest (this=0x2e83590, ap_http_req_data=0x7f13037ed320)
at /data1/myhome/mahendrae/sib/SIB/APP/app_logic/code/LI/RtLIX1Handler/src/RtLIX1Handler.cpp:1288
#7 0x0000000000480490 in RtLIHttpHandler::rtSendDataToWrkr (this=0x2e96330, ap_res=0x7f13037ef770,
ap_rest_req_data=0x7eefc0 RtLIHttpHandler::m_rest_req_data, a_data_size=355)
at /data1/myhome/mahendrae/sib/SIB/APP/app_logic/code/LI/RtLIHttpHandler/src/RtLIHttpHandler.cpp:627
i have been using single thread to receiving and responding back. i tried to run above case with ASAN to pin point the reason but it runs perfectly fine with asan compiled lib/bin. which made me clue less. from code i observed that when write function gets called context is retrived which returned as null. I have also used res->cork and in lamda i tried to write response back to client. i can also provide any futhure info if you require. i have used latest version 20.46. And also i observed that when i dont send body in cases where onData handler implemented then res pointer gets null by the time i respond back is this behavior expected??!!
Thanks
Beta Was this translation helpful? Give feedback.
All reactions