[Bug 2089779] Re: Buffer overflow in autopkgtest of wesnoth

2024-12-12 Thread Christian Ehrhardt 
Thanks Simon and Jeremy! -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/2089779 Title: Buffer overflow in autopkgtest of wesnoth To manage notifications about this bug go to: https://bugs.launchpad.

[Bug 2089779] Re: Buffer overflow in autopkgtest of wesnoth

2024-12-12 Thread Jeremy Bícha
This bug was fixed in the package libsdl2 - 2.30.10+dfsg-1 Sponsored for Simon McVittie (smcv) --- libsdl2 (2.30.10+dfsg-1) unstable; urgency=medium * New upstream stable release - Support multiple joystick buttons outputting the same gamepad button - Improve portability of

[Bug 2089779] Re: Buffer overflow in autopkgtest of wesnoth

2024-12-12 Thread Simon McVittie
> That means we can drop that delta (O2 and reproducible builds) on the merge of the next version Debian unstable now has 2.30.10, which I believe contains the relevant upstream changes. Please resync if appropriate. -- You received this bug notification because you are a member of Ubuntu Bugs,

[Bug 2089779] Re: Buffer overflow in autopkgtest of wesnoth

2024-12-04 Thread Christian Ehrhardt 
This fully migrated and works now. Furthermore upstream was great and quick, they have fixes for the crash and the LTO warning in the latest and the 2.30.x branch. Reproducible builds is merged in both as well. That means we can drop that delta (O2 and reproducible builds) on the merge of the nex

[Bug 2089779] Re: Buffer overflow in autopkgtest of wesnoth

2024-12-03 Thread Launchpad Bug Tracker
This bug was fixed in the package libsdl2 - 2.30.9+dfsg-1ubuntu1 --- libsdl2 (2.30.9+dfsg-1ubuntu1) plucky; urgency=medium * d/rules: reduce to -O2 to fix crashes that occur when combining O3 with LTO (LP: #2089779) -- Christian Ehrhardt Thu, 28 Nov 2024 10:31:47 +0100 ** C

[Bug 2089779] Re: Buffer overflow in autopkgtest of wesnoth

2024-12-03 Thread Christian Ehrhardt 
Uploaded as 2.30.9+dfsg-1ubuntu1 and checking proposed migration in a bit ... -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/2089779 Title: Buffer overflow in autopkgtest of wesnoth To manage notifi

[Bug 2089779] Re: Buffer overflow in autopkgtest of wesnoth

2024-12-03 Thread Launchpad Bug Tracker
** Merge proposal linked: https://code.launchpad.net/~paelzer/ubuntu/+source/libsdl2/+git/libsdl2/+merge/477653 -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/2089779 Title: Buffer overflow in au

[Bug 2089779] Re: Buffer overflow in autopkgtest of wesnoth

2024-12-03 Thread Christian Ehrhardt 
Tried O2 in variants via - export DEB_CFLAGS_MAINT_APPEND = -O2 - export DEB_LDFLAGS_MAINT_APPEND = -Wl,-O2 Tested: - ldflags + cflags = works - cflags = works - ldflags = still crashing Ok, in that case cflags alone is the smallest (and more common) yet working change to add. -- You received t

[Bug 2089779] Re: Buffer overflow in autopkgtest of wesnoth

2024-12-02 Thread Christian Ehrhardt 
Interesting build warning libtool: link: ranlib build/.libs/libSDL2_test.a libtool: link: ( cd "build/.libs" && rm -f "libSDL2_test.la" && ln -s "../libSDL2_test.la" "libSDL2_test.la" ) In function 'SDL_memcpy_REAL', inlined from 'SDL_SetCurrentDisplayMode' at /home/ubuntu/SDL/src/video/SDL_

[Bug 2089779] Re: Buffer overflow in autopkgtest of wesnoth

2024-12-02 Thread Christian Ehrhardt 
I used it more like a shotgun, but with local attribute((optimize(2)) in the place of the warning and back up the stack of the crash I got still a crash. I'll use it a bit more widely and if working then refine that throughout tomorrow as it is iterating "modify + run (for some time)". If OTOH no

[Bug 2089779] Re: Buffer overflow in autopkgtest of wesnoth

2024-12-02 Thread Christian Ehrhardt 
I checked if O3->O2 alone would also fix the issue - it does. Julian had a great suggestion: """ I'd argue disable -O3; but it may also be fruitful to look where it crashes and force -O2 for that function using `attribute((optimize(2))` (re @paelzer: Hi, if LTO+O3 ...) """ Before the debugging

[Bug 2089779] Re: Buffer overflow in autopkgtest of wesnoth

2024-12-02 Thread Christian Ehrhardt 
I could now, knowing that it is O3+LTO also reproduce it with upstream git :-) I checked the former 2.30.6 which would also behave the same way if LTO and O3 are enabled, so at the end it wasn't the new version of libsdl2 at all. I submitted it to upstream for their awareness. Reproducible build

[Bug 2089779] Re: Buffer overflow in autopkgtest of wesnoth

2024-12-02 Thread Christian Ehrhardt 
As a bonus of debugging this, the reproducible builds have fallen out as well. The patch that I use works (that is what was tested above) and it is stable in its binaries across 10 builds: md5sum 0*/usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0*.objdump cd47f413db025e99b4d888e84fac4a31 00/usr/lib/x

[Bug 2089779] Re: Buffer overflow in autopkgtest of wesnoth

2024-12-02 Thread Christian Ehrhardt 
Second check good, the non-lto build makes it work. buntu@autopkgtest:~$ /usr/games/wesnoth-1.18 -m --controller 1:ai --controller 2:ai --nogui Battle for Wesnoth v1.18.3 x86_64 Started on Mon Dec 2 12:48:04 2024 Data directory: /usr/share/games/wesnoth/1.18 User configuration di

[Bug 2089779] Re: Buffer overflow in autopkgtest of wesnoth

2024-12-02 Thread Christian Ehrhardt 
Just also adding -flto=auto to LDFLAGS (in addition to CFLAGS) did not start to cause the issue on the git build. But I think it is worth trying export DEB_BUILD_MAINT_OPTIONS=optimize=-lto in the PPA builds. And indeed the no-LTO build in: https://launchpad.net/~paelzer/+archive/ubuntu/lp-208

[Bug 2089779] Re: Buffer overflow in autopkgtest of wesnoth

2024-12-02 Thread Christian Ehrhardt 
I was re-verifying some of the major decision points to make sure this goes the right paths (after all this crossed three digits of builds overall) and as my gut feeling told me, something is even more odd. I went back and ended up no more being able to reproduce the good case. Not even with the P

[Bug 2089779] Re: Buffer overflow in autopkgtest of wesnoth

2024-11-29 Thread Christian Ehrhardt 
New build, this time without debug-symbol and therefore no stripping on build. Results: 10x with "fixed reproducible build (or crap)" patch - 10x fail 10x rebuild "as-is" - 10x fail So I have a single magic build that works in [1] and all others fail :-/ Even 10 of what should be the same. ?What

[Bug 2089779] Re: Buffer overflow in autopkgtest of wesnoth

2024-11-29 Thread Christian Ehrhardt 
:-/ I accidentally built 20 times repro instead of 10/10 and one had a failing builder (not build) They ALL triggered the crash - at least it seems not flaky. So maybe, it is more the debugsymbol stripping as assumed above. Because in the try to be Let me do a few without, at least it Oddly bu

[Bug 2089779] Re: Buffer overflow in autopkgtest of wesnoth

2024-11-29 Thread Christian Ehrhardt 
Ok, this loves to stay weird :-/ The rebuild fails as well! Which leaves very little difference left :-/ PPA build yesterday, works https://launchpad.net/ubuntu/+source/libsdl2/2.30.9+dfsg-1build1/+build/29317183 Archive build yesterdday, fails https://launchpad.net/ubuntu/+source/libsdl2/2.30.9+

[Bug 2089779] Re: Buffer overflow in autopkgtest of wesnoth

2024-11-29 Thread Christian Ehrhardt 
** Attachment added: "good.buildinfo" https://bugs.launchpad.net/ubuntu/+source/libsdl2/+bug/2089779/+attachment/5841032/+files/good.buildinfo -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/2089779

[Bug 2089779] Re: Buffer overflow in autopkgtest of wesnoth

2024-11-29 Thread Christian Ehrhardt 
** Attachment added: "bad.buildinfo" https://bugs.launchpad.net/ubuntu/+source/libsdl2/+bug/2089779/+attachment/5841033/+files/bad.buildinfo -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/2089779 T

[Bug 2089779] Re: Buffer overflow in autopkgtest of wesnoth

2024-11-29 Thread Christian Ehrhardt 
** Attachment added: "good.buildlog" https://bugs.launchpad.net/ubuntu/+source/libsdl2/+bug/2089779/+attachment/5841030/+files/good.buildlog -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/2089779 T

[Bug 2089779] Re: Buffer overflow in autopkgtest of wesnoth

2024-11-29 Thread Christian Ehrhardt 
** Attachment added: "bad.buildlog" https://bugs.launchpad.net/ubuntu/+source/libsdl2/+bug/2089779/+attachment/5841031/+files/bad.buildlog -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/2089779 Tit

[Bug 2089779] Re: Buffer overflow in autopkgtest of wesnoth

2024-11-28 Thread Christian Ehrhardt 
Uploading libsdl2_2.30.9+dfsg-1build1.dsc Uploading libsdl2_2.30.9+dfsg-1build1.debian.tar.xz Uploading libsdl2_2.30.9+dfsg-1build1_source.buildinfo Uploading libsdl2_2.30.9+dfsg-1build1_source.changes Waiting for build and re-tests ... -- You received this bug notification because you are a mem

[Bug 2089779] Re: Buffer overflow in autopkgtest of wesnoth

2024-11-28 Thread Christian Ehrhardt 
Uh wait, the bad build in proposed was against ALL in -proposed (as of 13 days ago). But the PPA build was against plucky as-is. Let me change the PPA dependencies to include proposed and rebuild once more ... (just to make sure nothing still in -proposed is what breaks this and would break the

[Bug 2089779] Re: Buffer overflow in autopkgtest of wesnoth

2024-11-28 Thread Christian Ehrhardt 
The only reasonable thing in there with a function is the lib itself. $ find good good good/usr good/usr/share good/usr/share/doc good/usr/share/doc/libsdl2-2.0-0 good/usr/share/doc/libsdl2-2.0-0/README.md good/usr/share/doc/libsdl2-2.0-0/CREDITS.txt good/usr/share/doc/libsdl2-2.0-0/changelog.gz

[Bug 2089779] Re: Buffer overflow in autopkgtest of wesnoth

2024-11-28 Thread Christian Ehrhardt 
Very interesting - both the 2.30.6 but even the 2.30.9+dfsg-1ubuntu1~pluckyppa1 no change rebuild work. $ sudo apt install libsdl2-2.0-0=2.30.9+dfsg-1ubuntu1~pluckyppa1 .. works So something was wrong when built as https://launchpad.net/ubuntu/+source/libsdl2/2.30.9+dfsg-1 Which was better now t

[Bug 2089779] Re: Buffer overflow in autopkgtest of wesnoth

2024-11-28 Thread Christian Ehrhardt 
Adding the cflgas from our build to the mix: $ git clean -xfd $ git clean checkout . $ export CFLAGS="-Wdate-time -D_FORTIFY_SOURCE=3 -g -O2 -Werror=implicit-function-declaration -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -flto=auto -ffat-lto-objects -fstack-protector-strong -fstack-c

[Bug 2089779] Re: Buffer overflow in autopkgtest of wesnoth

2024-11-28 Thread Christian Ehrhardt 
The test in infra against: wesnoth-1.18/1:1.18.3-1 postgresql-common/267 python3-defaults/3.12.7-1 openmpi/5.0.5-6 boost1.83/1.83.0-3.2ubuntu3 worked. Thereby all others are un-entangled ** Changed in: boost1.83 (Ubuntu) Status: New => Fix Released ** Changed in: python3-defaults (Ubunt

[Bug 2089779] Re: Buffer overflow in autopkgtest of wesnoth

2024-11-28 Thread Christian Ehrhardt 
Between versions could most likely be packaging, upstream or something in the build env changing. Most changes are in the upstream version, so let me try how https://github.com/libsdl-org/SDL.git behaves. This is only what is in libsdl2-2.0-0:amd64 2.30.9+dfsg-1 Not the other s

[Bug 2089779] Re: Buffer overflow in autopkgtest of wesnoth

2024-11-28 Thread Christian Ehrhardt 
The crash itself is, despite debuginfod, not more informative than the following: (gdb) bt #0 __pthread_kill_implementation (threadid=, signo=6, no_tid=0) at ./nptl/pthread_kill.c:44 #1 __pthread_kill_internal (threadid=, signo=6) at ./nptl/pthread_kill.c:78 #2 __GI___pthread_kill (threadid=,

[Bug 2089779] Re: Buffer overflow in autopkgtest of wesnoth

2024-11-28 Thread Christian Ehrhardt 
I can recreate this locally, and really the new libsdl2 seems to be the culprint. Fine: $ sudo ~/work/autopkgtest/autopkgtest/runner/autopkgtest --no-built-binaries --apt-upgrade --shell wesnoth-1.18_1.18.3-1.dsc -- qemu --ram-size=8192 --cpus 2 ~/work/autopkgtest-plucky-amd64.img Triggers the

[Bug 2089779] Re: Buffer overflow in autopkgtest of wesnoth

2024-11-28 Thread Christian Ehrhardt 
Always passed in oracular https://autopkgtest.ubuntu.com/packages/w/wesnoth-1.18/oracular/amd64 In Plucky it seems to fail mostly with: libsdl2 | 2.30.9+dfsg-1 (oracular had 2.30.6+dfsg-1) And at the same time still working otherwise https://autopkgtest.ubuntu.com/packages/w/wesnoth-1.18/plucky

[Bug 2089779] Re: Buffer overflow in autopkgtest of wesnoth

2024-11-27 Thread Graham Inggs
** Also affects: wesnoth-1.18 (Ubuntu) Importance: Undecided Status: New -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/2089779 Title: Buffer overflow in autopkgtest of wesnoth To manage n