mnisjk / cppWebSockets

A simple, lightweight c++ WebSockets server library
Other
128 stars 35 forks source link

Yet another "double free or corruption (out)" #8

Open mmueller-kaffeeschluerfercom opened 6 years ago

mmueller-kaffeeschluerfercom commented 6 years ago

Steps to reproduce:

  1. compile and install libwebsockets-2.3
  2. compile example echoserver from cppWebSockets
  3. run echoserver
  4. open index.html (from echoserver directory) in a browser (here: firefox 55.0.2)
  5. enter a long string in the textbox and click send

On one system (ubuntu 16.04), it crashes with strings of length 16, like "1234567890123456", on another (yocto on intel edison) after 128 characters.

This does not happen with the libwebsockets-test-echo, so I assume it is something with cppWebSockets. Any idea?

mmueller-kaffeeschluerfercom commented 6 years ago

I tried to use it with libwebsockets-2.0. The problem does not occur anymore. Can you please precise on which version of libwebsockets you worked while developing cppWebSockets? It seems to have compatibility issues with newer versions. I still have some segmentation faults in callback_main now and then...

HDBaggy commented 6 years ago

Yes I am also facing the same issue.

billpriest commented 2 years ago

So, I tracked this down and fixed it. While I was at it I modernized the code and fixed complaints from clang-tidy/lazy and cppcheck. Now the echoserver & chatserver apps run w/o crashing and are clean under valgrind. I'll try a pull request.

billpriest commented 2 years ago

0001-Changes-to-modernize-and-fix-memory-corruption.patch.gz

I tried to attach this yesterday; I guess it didn't work.