loentar / ngrest

Fast and easy C++ RESTful WebServices framework
Apache License 2.0
465 stars 94 forks source link

ngrest crashes upon CTRL + C #83

Open raadiy opened 2 years ago

raadiy commented 2 years ago

Hi Dmitry,

I made some recent changes to bring up the ngrest server using two shared libraries/objects (It was originally one, I modularized them into two libraries). When I exit the ngrest server (ctrl + c), it crashes every time with the following message. Do you have any suggestions for troubleshooting this.

====

I/12-02-2022 03:09:35.832 Server startup time: 9.643ms I/12-02-2022 03:09:35.832 Simple ngrest server started on port 9098. I/12-02-2022 03:09:35.832 Deployed services: http://localhost:9098/ngrest/services ^CI/12-02-2022 03:09:48.120 Stopping server I/12-02-2022 03:09:48.120 Server finished /home/raajesh/bin/ngrest: line 612: 1638578 Segmentation fault (core dumped) ngrestserver -l "$IP" -p $PORT -s "$BUILD_DIR/services" Server crashed. Waiting for project modifications...

====

Regards Raajesh

loentar commented 2 years ago

Try attaching to the ngrest process with gdb. press Ctrl+C in ngrest and examine stack in gdb

Also Valgrind is the good tool to find memory errors. If you use QtCreator, it's easy to access it from Debug menu : Change "Debugger" to "Memcheck"

image

raadiy commented 2 years ago

Thank you Dmitry, I too had a similar debugging thought process to try this, but posted the question if any similar issues was seen in the past as well. Will try this.