Skip to content
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

compile failure: memset overflows destination (-Werror=stringop-overflow) #243

Open
jwdevel opened this issue Feb 11, 2025 · 1 comment
Open

Comments

@jwdevel
Copy link

jwdevel commented Feb 11, 2025

I recently tried to build this plugin standlone, on Debian Linux, and hit a compile error (or rather: warning-treated-as-error).

Here is my session:

$ cmake -S . -B build -DBUILD_OUT_OF_TREE=On && cmake --build build
-- Configuring done
-- Generating done
-- Build files have been written to: /home/jrw/dev/external/obs-move-transition/build
[ 10%] Building C object CMakeFiles/move-transition.dir/move-filter.c.o
In file included from /usr/include/obs/util/profiler.h:4,
                 from /usr/include/obs/obs.h:22,
                 from /usr/include/obs/obs-module.h:20,
                 from /home/jrw/dev/external/obs-move-transition/move-transition.h:3,
                 from /home/jrw/dev/external/obs-move-transition/move-filter.c:1:
In function ‘darray_push_back_new’,
    inlined from ‘move_filter_update’ at /home/jrw/dev/external/obs-move-transition/move-filter.c:360:17:
/usr/include/obs/util/darray.h:210:9: error: ‘memset’ writing 60 bytes into a region of size 0 overflows the destination [-Werror=stringop-overflow=]
  210 |         memset(last, 0, element_size);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In function ‘darray_push_back_new’,
    inlined from ‘move_filter_update’ at /home/jrw/dev/external/obs-move-transition/move-filter.c:414:17:
/usr/include/obs/util/darray.h:210:9: error: ‘memset’ writing 60 bytes into a region of size 0 overflows the destination [-Werror=stringop-overflow=]
  210 |         memset(last, 0, element_size);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
gmake[2]: *** [CMakeFiles/move-transition.dir/build.make:104: CMakeFiles/move-transition.dir/move-filter.c.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/move-transition.dir/all] Error 2
gmake: *** [Makefile:156: all] Error 2

I don't know if this is a false alarm, or real problem (I'm not familiar with this codebase).

Environment info:

  • changeset: 0f97047
  • OBS version: 29.0.2.1-1+b1 (linux)
  • gcc: Debian 12.2.0-14
@jwdevel
Copy link
Author

jwdevel commented Feb 11, 2025

I bisected this, and it was introduced in bf93acb.

(I guess that makes sense, since that's when the code with the warning was added)

The last tagged release that builds with no problem for me is 3.0.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant