<div dir="ltr"><div class="gmail_default" style="font-size:small">ANDREW, Perhaps I duplicated this incorrectly, but when I add after the line    CFLAGS += $(static_incs)  the line <br><div>CFLAGS += -Wall -fsanitize=alignment   in guicast/Makefile to demonstrate the problem, I just get compiler errors. I also set the environment variable LDFLAGS and when I do    echo $LDFLAGS    it shows    -fsanitize=alignment   .<br></div><div>Did I make a mistake?  Did I miss a step?  The only steps I read in your email was:</div><div>   (1) modify guicast/Makefile to add another CFLAGS line<br></div><div>   (2) set environment variable for LDFLAGS   (before LDFLAGS had no value)<br></div><div><br></div><div></div><div>See below for the end of my log file.</div><div><br></div></div><div class="gmail_default" style="font-size:small"></div><div class="gmail_default" style="font-size:small"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">/usr/bin/ld: /tmp/cinelerra-5.1/cinelerra/../guicast/x86_64/libguicast.a(bclistboxitem.o): in function `BC_ListBoxItem::compare_item_text(void const*, void const*)':<br>/tmp/cinelerra-5.1/guicast/bclistboxitem.C:162: undefined reference to `__ubsan_handle_type_mismatch_v1'<br>/usr/bin/ld: /tmp/cinelerra-5.1/guicast/bclistboxitem.C:163: undefined reference to `__ubsan_handle_type_mismatch_v1'<br>/usr/bin/ld: /tmp/cinelerra-5.1/guicast/bclistboxitem.C:163: undefined reference to `__ubsan_handle_type_mismatch_v1'<br>/usr/bin/ld: /tmp/cinelerra-5.1/guicast/bclistboxitem.C:162: undefined reference to `__ubsan_handle_type_mismatch_v1'<br>/usr/bin/ld: /tmp/cinelerra-5.1/cinelerra/../guicast/x86_64/libguicast.a(bclistboxitem.o): in function `ArrayList<BC_ListBoxItem*>::del(BC_ListBoxItem*&)':<br></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">/tmp/cinelerra-5.1/guicast/arraylist.h:14: undefined reference to `__ubsan_handle_type_mismatch_v1'<br>/usr/bin/ld: /tmp/cinelerra-5.1/cinelerra/../guicast/x86_64/libguicast.a(bclistboxitem.o):/tmp/cinelerra-5.1/guicast/arraylist.h:14: more undefined references to `__ubsan_handle_type_mismatch_v1' follow<br>collect2: error: ld returned 1 exit status<br>make[2]: *** [Makefile:607: x86_64/lv2ui] Error 1<br></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">make[2]: *** Waiting for unfinished jobs....<br>make[2]: Leaving directory '/tmp/cinelerra-5.1/cinelerra'<br>make[1]: *** [Makefile:582: all-recursive] Error 1<br>make[1]: Leaving directory '/tmp/cinelerra-5.1'<br></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">make: *** [Makefile:529: all] Error 2<br></blockquote></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Nov 23, 2022 at 11:37 PM Andrew Randrianasulu <<a href="mailto:randrianasulu@gmail.com">randrianasulu@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto"></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">---------- Forwarded message ---------<br>От: <strong class="gmail_sendername" dir="auto">Андрей Рандрианасулу</strong> <span dir="auto"><<a href="mailto:randrik@mail.ru" target="_blank">randrik@mail.ru</a>></span><br>Date: чт, 24 нояб. 2022 г., 09:33<br>Subject: unaligned load in bctheme<br>To: randrianasulu <<a href="mailto:randrianasulu@gmail.com" target="_blank">randrianasulu@gmail.com</a>><br></div><br><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><div>I got this:</div><div> </div><div><div><div>bash-5.1$  /dev/shm/cinelerra/cinelerra-5.1/bin/cin</div><div>Cinelerra Infinity - built: Nov 24 2022 08:52:45</div><div>git://<a href="http://git.cinelerra-gg.org/goodguy/cinelerra.git" rel="noreferrer" target="_blank">git.cinelerra-gg.org/goodguy/cinelerra.git</a></div><div>(c) 2006-2019 Heroine Virtual Ltd. by Adam Williams</div><div>2007-2020 mods for Cinelerra-GG by W.P.Morrow aka goodguy</div><div>Cinelerra is free software, covered by the GNU General Public License,</div><div>and you are welcome to change it and/or distribute copies of it under</div><div>certain conditions. There is absolutely no warranty for Cinelerra.</div></div><div> </div><div><div>build plugin index for: /dev/shm/cinelerra/cinelerra-5.1/bin/plugins</div><div>PluginFFilter::new_ffilter(overlay_opencl)</div><div>  err: Input/output error</div><div>PluginFFilter::new_ffilter(xfade_opencl)</div><div>  err: Input/output error</div><div>[openclsrc_814 @ 0xb78f400] OpenCL source requires output dimensions to be specified.</div><div>PluginFFilter::new_ffilter(openclsrc)</div><div>  err: Invalid argument</div><div>bctheme.C:458:15: runtime error: load of misaligned address 0x098a364d for type 'int', which requires 4 byte alignment</div><div>0x098a364d: note: pointer points here</div><div> 45 47 27 00 48 21 00  00 31 30 38 30 74 6f 34  38 30 2e 70 6e 67 00 00  00 00 00 31 30 38 30 74  6f</div><div>             ^</div><div>Total excess of backups: -50</div><div>Session time: 0:00:07</div><div>Cpu time: user: 0:00:03.699 sys: 0:00:00.480</div><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><div> </div><div><div><div>--<br>Андрей  Рандрианасулу</div></div></div></div>
</div>
</blockquote></div>