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

Is this a kind of assert ? #198

Open
mingodad opened this issue Sep 21, 2022 · 9 comments
Open

Is this a kind of assert ? #198

mingodad opened this issue Sep 21, 2022 · 9 comments

Comments

@mingodad
Copy link

Looking through the code of void gotHttpReply2 on Msg13.cpp I found this and it seems like a kind of poor man assert:

if ( replySize > replyAllocSize ) { char *xx=NULL;*xx=0; } //!!! here it'll segfault on purpose ?

Is this intentional ?

@tcreek
Copy link

tcreek commented Sep 21, 2022

Good luck on getting a response

@mingodad
Copy link
Author

Do you mean this is a dead project ?

@tcreek
Copy link

tcreek commented Sep 21, 2022

No, it is not dead and gets updates often, it's just the owner(s)/contributors do not bother reading the issues section.

@mingodad
Copy link
Author

Thank you for reply and advise about it !

@SaptakBhoumik
Copy link

I believe it is some exception handling method using signals. Note:-Just my assumption.

@mingodad
Copy link
Author

But that's a segfault I'm not sure any exception handler catch it, that's why I said maybe poor man assertion.

@SaptakBhoumik
Copy link

SaptakBhoumik commented Sep 22, 2022

But that's a segfault I'm not sure any exception handler catch it, that's why I said maybe poor man assertion.

You can use signals to catch it but this is just my assumption because there's better way of handling exception. I may be wrong as well

@tcreek
Copy link

tcreek commented Sep 22, 2022

It does seem to segfault as I cannot even get it to run on Debian 10/11. I have tried in 4/8/16GB systems and it segfaults out of memory every time.

@davidebaldini
Copy link

The expression { char *xx=NULL;*xx=0; } is copy-pasted everywhere in the sources, it is indeed a surrogate for assert.

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

4 participants