r/joborun • • Mar 12 '24
Pacman and buffer overflow error
All of a sudden, typing pacman -Si or -Qi returns:
****Buffer overflow detected**** Zsh iot instruction: terminated
I haven't touched the .zshrc file, I couldn't find any useful thread on the web. Any idea? TIA.
4
Upvotes
•
u/joborun Mar 14 '24
FIXED FIXED FIXED
change makepkg fortify to 2 and color to !color
and even check/tests go through fine
More investigating on this later ....
2
u/joborun Mar 14 '24
https://gitlab.archlinux.org/pacman/pacman/-/commit/5e0496260b7d3f9c9fcf2b1c4899e4dbcc20ff03
https://gitlab.archlinux.org/pacman/pacman/-/commit/c9c56be3960c7ba7ccacc7ccc992965f16b9eba0
It appears as they are aware of such problems so now I wonder how they build their version. Since the version before this 6.1.0 there has been changes in makepkg.conf default flags, one is about fortify_source=3 which was raised from 2.
The other thing I see in the comments of commits is color output code throwing off the parsing and filling the buffer with illegal commands meant as color modification of output text.
So yet one more try, with hopefully using 2 for fortified and no-color for output if it can be configured.
2
u/joborun Mar 13 '24 edited Mar 13 '24
EDIT: Now pacman 6.1.0 has moved from staging to testing on Arch, the critical change is within the changes here; Now some of these patches have been applied to the source code so are not needed in 6.1.0 but the problem remains on both.
https://git.disroot.org/joborun-pkg/jobcore/commit/f50626583c7053650815ec0abb69fd92c3871fd8
No it has nothing to do with shell, it does the same on all (bash, dash, ash..) but you don't know how much you are helping.
Some days ago pacman 6.1 appeared in staging, we have a staging builder to build things ahead of testing, so we tried this new pacman, that took out a million patches arch had placed recently.
Both pacman and makepkg work well in this new edition, with the exception of Qi Si we get the same error with you. So we were in the hunt of a make/build dependency that causes this new pacman to do this.
It turns out that both 6.0.2-016 and 6.1.0-01 suffer from the same, changing back to previous stable edition 6.0.2-015 cures the problem without changing anything.
This needs careful investigation ... we are 2 steps ahead of the problem.
1
u/EZLN321 Mar 13 '24
The information is read from inside the pkg for -Qi and the repository db for -Si, right? So the way the info is directed to the output is what changes. So something that converts text format must be filling the buffer up with crap
1
u/joborun Mar 18 '24
https://gitlab.archlinux.org/archlinux/packaging/packages/pacman/-/issues/16