-
Notifications
You must be signed in to change notification settings - Fork 636
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
outchannel: eleminate type cast for compatibility reasons #5056
base: master
Are you sure you want to change the base?
Conversation
Thanks for the PR, but we need to dig deeper into the root cause. I do not see why this can validly fix the issue. Note: I do not say "it does not", I just say "I do not understand why it works". I dug up some ARM v7 references, and char is by default unsigned so the same as unsigned char == uchar. So there is no reason why switching from char to uchar should make a difference. Even worse: if it really does, we have probably many more places inside the codebase that we would need to look at. As such, I think it is vital to understand the root cause. @SchorppDA would yo be willing to do a small rounds of debugging with more instrumentation to help nail this issue (I do not have a reproducer at hand)? Besides that, the patch is also a kind of cleanup. It makes little sense to use |
I also did not really understand the cause, and therefore can understand why the PR is not yet accepted. |
Thanks! If you just recompile the original code - without changes: does the problem persist? The reason is that I wonder if some compile time options by the packager influence the behavior. Also, can you confirm that |
side-note: I see invalid CI failures. It looks like some external testbench artifacts went away. I need to fix this via separate PR. Must have happened recently, maybe on Jan, 1st. |
It is still not clear to me what is meant by "packager". But without the change the error is persistent in my setup. |
The person/process which creates the binary package. Or did you manually compile and install?
Do you see that dbgprintf inside the debug log? From the accompanying issue, I thought it was said that that Anyhow, can you apply this patch and post the relevant debug output:
|
Just FYI: #5063 I would still be interested in the output of proposed patch above so that we can finally debug the issue in |
@SchorppDA do you have any updates for me? |
Hi @rgerhards , I am in the same situation as OP, also finding this problem after upgrading the Yocto embedded build system to the Kirkstone (4) release. I applied your debug patch, but with that in place the issue does not occur.
With the changes of this PR in mind, I found the following note in 'man isspace':
Going back to the original code, I tried the following:
In all the above cases, the error still occurred and the debug output is:
I then applied basically the same patch as proposed in this PR, additionally removing the cast to 'int' (which makes the call to isspace in line with the example in the man page):
In this case, the error is gone and debug output is:
Finally, I compared the assembly for skip_Comma between this patched version and the original unchanged version.
Please find the full assembly for skip_Comma attached: As far as I can see, So in conclusion, I do think that removing the casts between char and unsigned char is a correct fix. If there are other calls to such functions ( |
Hi @rgerhards, unfortunately I could not work on the problem the last weeks. I will update my PR with the fixes from @patrickdepinguin and make an attempt of a better commit message |
99bd812
to
774014b
Compare
According to the manpage the input for isspace must be of type unsigend char. Remove all unnecessary type cast to achieve this.
774014b
to
5c4f0ff
Compare
Hi @rgerhards , would you have some time to look at this again please? |
sry, I have somehow overlooked the recent activity on this tracker. Even more unfortunately, I will probably not be able to check details before mid-April (but will try to be faster). Please note that with the above-mentioned new style config in place, this issue has lower priority for me. Every can apply that patch and use new style with the new config. While I agree that this patch here seems to solve the problem, I have not yet a sound explanation why it does so. I do not like to merge just on the "seems to work" basis, even if it for sure is an improvement over the current situation: I would like to understand the core issue , so that I can also check if there are related areas in code. And also once I merge, everybody else probably looses interest in the issue ;-) Again: #5063 is the solution for anyone looking to solve the situation right now. |
@patrickdepinguin I read your great post #5056 (comment) in-depth. It really is helpful. Just let me check some other things. |
OK, the int cast stems back to some compatibility issue with BSD build - but that was 16 years ago. I wonder if someone could confirm the new patch on BSD. It was only a warning druing build, if my mail archive doesn't misguide me. 489a51b#diff-7035bccafe4326c231eb577068f80a66304550db628ede2ceb9a12b7c000b243 Alternatively, we could do a "stupid save bet" by casting @patrickdepinguin what's you take on this? |
TBH, I cannot outrule that the BSD warning 16 yrs ago was for exactly the issue we now see. Unfortunately, I do not have any more info available. :-( |
Hi @rgerhards, sorry for the late reply, this slipped my mind. I think the best approach should be to align with the man page of
The NetBSD man page does also: (https://man.netbsd.org/NetBSD-9.1/isspace.3)
and that linked section says: (https://man.netbsd.org/NetBSD-9.1/ctype.3)
Going back to the rsyslog code, all users of |
May I ask if there is any news? |
Any update on this? |
Fixes #5047