Hi all, On Tue, 30 May 2023 12:59:18 -0700 "'Sam Clegg' via emscripten-discuss" <emscripten-discuss@googlegroups.com> wrote:
> On Tue, May 30, 2023 at 12:10 PM 'Dieter Weidenbrück' via > emscripten-discuss <emscripten-discuss@googlegroups.com> wrote: > > > All, > > with lots of debug lines I am able to isolate one error in my code, > > however, I have not been able yet to build a reduced test case for it. > > I tested this with a single worker to avoid races. > > > > The pointer in question got allocated in the worker first. Later I needed > > to enlarge the size. Using code like the following snippet I detected that > > the content of the reallocated block was different from the original one > > (considering the old size only, of course): > > Assume p is the block that was allocated initially with size oldSize: > > #define smallChunkSize 256 > > uint8_T test1[smallChunkSize],test2[smallChunkSize]; > > uint8Ptr_T p = (uint8Ptr_T)myP; > > uint8Ptr_T newP = 0L; > > int i,n; > > > > n = min(oldSize,smallChunkSize); memcpy(test1,p,n); > > newP = realloc(p,newSize); > > assert(newP != 0L); > > > > memcpy(test2,newP,n); > > > > for (i=0;i<n;i++){ > > assert(test1[i] == test2[i]); please trim the quoted parts of the emails: https://en.wikipedia.org/wiki/Posting_style . 70 kilibytes emails are appalling . -- Shlomi Fish https://www.shlomifish.org/ What Makes Software Apps High Quality - https://shlom.in/sw-quality Rindolf is the Evil twin brother of Rudolph and Randolph, Santa’s goody-two- shoes reindeer, who are among his arch-enemies. He is also one of the cornerstones of the Evil Reindeer Evil World Domination Evil Conspiracy, which aims to spread Evil in general and Reindeer Evil in particular around the world. Please reply to list if it's a mailing list post - https://shlom.in/reply . -- You received this message because you are subscribed to the Google Groups "emscripten-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-discuss+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/emscripten-discuss/20230531043221.4a93b535%40shlomifish.org.