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

"nesting_level" class level variable in ParserCore class should be atomic to avoid data inconsistency. #46

Open
jagagit opened this issue Jan 22, 2019 · 3 comments
Assignees

Comments

@jagagit
Copy link

jagagit commented Jan 22, 2019

I was testing our voip java application with jain-sip-sdp-1.2.111. After two months,parsing didnt happened because of nesting_level had gone minus value.i just checked source code.it seems that nesting_level variable are static variable.

@vladimirralev
Copy link
Collaborator

Yeah nesting_level is meant for debugging parsing logic in single-threaded tests. You should be able to avoid issues like this if you disable parsing debug flag. nesting_level is almost useless in multithreaded code anyway. But it is a fair point, I can see it will cause a lot of trouble in multithreaded debug so at least it shouldn't go that bad.

If you want to send a pull request please go ahead, otherwise I will send in the patch tomorrow.

@vladimirralev vladimirralev self-assigned this Jan 22, 2019
@jagagit
Copy link
Author

jagagit commented Jan 22, 2019

bro .I found that HeaderParser class does not have condition as debug enabled or not. and it directly invoke dbg_enter("wkday"); method. I dont know how many class like this.

@vladimirralev
Copy link
Collaborator

Ouch. Good catch. Alright, I couldn't find other classes either by scanning quickly. I will figure something else out. Feel free to make a pull request for both anyway. Thanks.

vladimirralev added a commit to vladimirralev/jsip that referenced this issue Jan 22, 2019
vladimirralev added a commit that referenced this issue Jan 23, 2019
vladimirralev added a commit to vladimirralev/jsip that referenced this issue Jan 24, 2019
vladimirralev added a commit that referenced this issue Jan 24, 2019
kpouer pushed a commit to kpouer/restcomm-jain-sip that referenced this issue Dec 28, 2022
…in non-debug mode

(cherry picked from commit 113ac3304d9515afcf5207c2a1eb0cc8b6e588c1)
kpouer pushed a commit to kpouer/restcomm-jain-sip that referenced this issue Dec 28, 2022
…in non-debug mode

(cherry picked from commit 60a7e27030468d20cd0c88040b955b179797a928)
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