Crow icon indicating copy to clipboard operation
Crow copied to clipboard

Fix example-chat

Open keith-dev opened this issue 1 year ago • 4 comments

example-chat has runtime errors because std::function<> is assigned null in places.

This is a fix for that, with unittests.

keith-dev avatar Jan 18 '24 15:01 keith-dev

What is the exact error? As far as I see in the code, these handlers are checked for null before calling them. Maybe problem is with example?

mrozigor avatar Jan 29 '24 18:01 mrozigor

> What is the exact error? As far as I see in the code, these handlers are checked for null before calling them. Maybe problem is with example?

The application crashes, segfaults. I ran it on Android 15 under Termux (clang) and Linux (probably clang again) where it crashed.

Using gdb, the crash is caused by assigning null to a std::function.

The crash can be reproduced on Lunux by compiling with clang and just using example-chat, the faulty code is in Crow, not the example.

The check for null isn't the problem, it's assigning null that's the problem.

keith-dev avatar Jan 30 '24 10:01 keith-dev

Ok, thanks for info. So the only thing is that you can create lambda_wrapper with nullptr.

mrozigor avatar Feb 02 '24 20:02 mrozigor