<div dir="auto"><div><br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">вс, 4 дек. 2022 г., 03:39 Phyllis Smith <<a href="mailto:phylsmith2017@gmail.com">phylsmith2017@gmail.com</a>>:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="gmail_quote"><br>
<div><div>so i tried to instrument cingg to see if  she does any unaligned access</div><div> </div><div> </div><div>I added</div><div> </div><div> </div><div><div><div>diff --git a/cinelerra-5.1/guicast/Makefile b/cinelerra-5.1/guicast/Makefile</div><div>index 04d5a2e5..b724c668 100644</div><div>--- a/cinelerra-5.1/guicast/Makefile</div><div>+++ b/cinelerra-5.1/guicast/Makefile</div><div>@@ -116,6 +116,7 @@ UTILS = $(OBJDIR)/bootstrap $(OBJDIR)/pngtoh $(OBJDIR)/pngto</div><div>raw</div><div> BCXFER = xfer/$(OBJDIR)/xfer.stamp</div></div><div> </div><div><div> CFLAGS += $(static_incs)</div><div>+CFLAGS += -Wall -fsanitize=alignment</div></div><div> </div><div><div> $(shell echo $(CFLAGS) > $(OBJDIR)/c_flags)</div><div> $(shell echo $(OBJS) > $(OBJDIR)/objs)</div><div> </div><div> </div><div>and same -fsanitize=alignment to LDFLAGS env. variable before make.</div></div></div></div></div></blockquote><div><br></div><div style="font-size:small" class="gmail_default">On 4 different systems I was only able to include in guicast/Makefile, the CFLAGS += $(-fsanitize=alignment) and set the LDFLAGS environment variable to -fsanitize=alignment in order to compile.  But when I ran bin/cin I never got any errors of the type "bctheme.C:458:15: runtime error: load of misaligned address".  This was Fedora 32, Ubuntu 16, Debian 32-bit 9.1, and Debian 11.0.  I only loaded a file, played a little of it, and added a plugin as a test (maybe there was something in particular I should have tried?)<br></div></div></div></blockquote></div></div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto">no, it was right on startup on Slackware 15.0 (mostly) 32-bit over 64-bit kernel....</div><div dir="auto"><br></div><div dir="auto">I'll try on ppc32 machine hopefully soon (ppc/sparc/alpha said to be much more sensitive to such errors)</div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><div style="font-size:small" class="gmail_default"></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="gmail_quote"><div><div><div><div> </div><br><div><div><div>so patch below fixes this error.</div><div> </div><div>Can you please test it on various arches and distros?</div></div></div><div> </div></div></div><div> </div><div><div><div>diff --git a/cinelerra-5.1/guicast/bctheme.C b/cinelerra-5.1/guicast/bctheme.C</div><div>index 1ec64c7f..9addf9f7 100644</div><div>--- a/cinelerra-5.1/guicast/bctheme.C</div><div>+++ b/cinelerra-5.1/guicast/bctheme.C</div><div>@@ -455,7 +455,10 @@ void BC_Theme::overlay(VFrame *dst, VFrame *src, int in_x1, int in_x2, int shift</div></div><div> </div><div><div> void BC_Theme::set_data(unsigned char *ptr)</div><div> {</div><div>-       int hdr_sz = *(int*)ptr - sizeof(int);</div><div>+       //int hdr_sz = *(int*)ptr - sizeof(int);</div><div>+       int hdr_sz = 0;</div><div>+       memcpy(&hdr_sz, ptr, sizeof(int));</div><div>+       hdr_sz -= sizeof(int);</div><div>        unsigned char *cp = ptr + sizeof(int);</div><div>        unsigned char *dp = cp + hdr_sz;</div><div>        int start_item = images.size();</div><div>lines 7-28/28 (END)</div></div></div><br></div></div></blockquote><div><span class="gmail_default" style="font-size:small">Next I added the above patch, and all 4 systems compiled and ran the same limited set of commands to load and play a video file.  So </span><span class="gmail_default" style="font-size:small">it seems OK to check into GIT.  Just to verify, only the bctheme.C patch should be checked in - right?</span></div></div></div>
</blockquote></div></div></div>