Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CPP Server segfaults when user sends "/q" (quit) command #8

Open
lodger-c64 opened this issue Jun 30, 2019 · 4 comments
Open

CPP Server segfaults when user sends "/q" (quit) command #8

lodger-c64 opened this issue Jun 30, 2019 · 4 comments

Comments

@lodger-c64
Copy link

I just tested your code as I am in search of exactly something like this. But the CPP version crashes with a segfault everytime a user sends "/q" (quit).

@lodger-c64
Copy link
Author

This only happens when the server was compiled with a recent g++ compiler (e.g. 8.3.0.) , it seems.

@sidvishnoi
Copy link
Owner

Interesting.
I'm involved in other stuff presently. I'll try to look into it, but can't promise. Need to get recent version of g++ also. Thanks for reporting though 🙂
If you get curious and find the root cause, we can discuss here.

@lodger-c64
Copy link
Author

lodger-c64 commented Jun 30, 2019

I did some debugging using DDD with one version running on a Raspberry Pi with Raspbian Linux (compiled with g++ 6.x) that works fine and compared it with a version compiled with g++ 8.3.0 on a x86_64 Ubuntu PC.

The segfault happens in "serverChat.cc" at line 34.

With the g++ 6.x build the condition of the "for (auto &p : clients)" loop (line 34) is not matched and the code returns to the while loop. Everything is fine.

However, with the g++ 8.x build the code simpy segfaults at the same line (line 34). It happens during the second iteration of the "for ..." loop after handleLostConnection has been called.

May be an optimizing problem or a change with g++ handling exceptions or so. I haven't touched C++ code in a while. Maybe that helps, thank you very much for getting back to me.

P.S.: great software, quite interesting for retro people like me building a classic console based BBS based on Linux standard tools.

@sidvishnoi
Copy link
Owner

Hey! I got a chance to try running this with g++ 9.1.0. Couldn't reproduce this bug there unfortunately.
If I get my hands on 8.3.0, I'll try again and let you know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants