SheenBidi: PopulateBidiChain in some situations leaves SBBidiType portion of memory uninitialized.
I checked with valgrind that on every run it reports “==2247== Warning: unimplemented fcntl command: 1033 ==2247== Thread 32: ==2247== Conditional jump or move depends on uninitialised value(s) ==2247== at 0x14B4107: SBAlgorithmCreateParagraph” I tried to narrow down the part of memory which is uninitialized according to valgrind and it came out that if I will add in CreateParagraphContext function just after BidiChainInitialize additional code
for (int i = 0;i < length;++i) fixedTypes[i] = SBBidiTypeNil;
the valgrind is not reporting any problem.
I followed PopulateBidiChain code and it looks that in some cases it can omit initialization of some links in the chain. I do not understand sheenbidi well enough to say if this mean we have a data error in such case. Anyway application is not crashing because of it, the only visible problem so far is valgrind report.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 17 (12 by maintainers)
Commits related to this issue
- Initialize memory of bidi chain This fixes an error of reading uninitialized memory, as reported by Valgrind. Fixes #19. — committed to InfoTeddy/SheenBidi by InfoTeddy 3 years ago
- Initialize memory of bidi chain This fixes an error of reading uninitialized memory, as reported by Valgrind. Fixes #19. — committed to InfoTeddy/SheenBidi by InfoTeddy 3 years ago
- Update SheenBidi to 2.9.0 This fixes our problem with Valgrind reporting a jump based on an uninitialized value; see https://github.com/Tehreer/SheenBidi/issues/19 Just to be sure nothing unexpected... — committed to Daaaav/VVVVVV by Daaaav a year ago
- Update SheenBidi to 2.9.0 This fixes our problem with Valgrind reporting a jump based on an uninitialized value; see https://github.com/Tehreer/SheenBidi/issues/19 Just to be sure nothing unexpected... — committed to TerryCavanagh/VVVVVV by Daaaav a year ago
- Update SheenBidi to 2.9.0 This fixes our problem with Valgrind reporting a jump based on an uninitialized value; see https://github.com/Tehreer/SheenBidi/issues/19 Just to be sure nothing unexpected... — committed to TerryCavanagh/VVVVVV by Daaaav a year ago
I have added valgrind job in the linux workflow as part of commit 7bcdd13. It’s passing now as shown in Make - Valgrind job. Hopefully such issues will be easily caught by the CI in future.
No, this is just luck. https://stackoverflow.com/a/8029624
Can confirm it looks like that solves it!