Opened 20 months ago

Last modified 19 months ago

#10329 new defect

ffmpeg output: *** stack smashing detected ***: terminated

Reported by: hydra3333 Owned by:
Priority: normal Component: undetermined
Version: git-master Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description (last modified by hydra3333)

Oh dear. I just built (cross-compiled under Ubuntu/mingw64) ffmpeg with ' -O3 -fstack-protector-all -D_FORTIFY_SOURCE=2 ' and received the follow output:

ffmpeg.exe -h
*** stack smashing detected ***:  terminated

So, it now crashes immediately.

I have cross-compiled it like that for a few years, the last time being 2023.04.03 and that runs fine.
"The only thing that has changed" is:

  • latest mingw64 under the latest Ububtu 22.04.2
  • added a couple of new dependencies eg brotli (which "shouldn't" affect 'ffmpeg -h')

Help ! How do I "fix" that ?

Change History (10)

comment:1 by hydra3333, 20 months ago

Description: modified (diff)

comment:2 by hydra3333, 20 months ago

Ah. Damn.

Even building commit 774d358e0fd520ab9503447c5f8f5e1633b96e39 (2023.04.02) with almost nothing enabled

./configure --prefix=/home/u/Desktop/_working/workdir/win64_output/ffmpeg_testonly.installed --arch=x86_64 --target-os=mingw64 --cross-prefix=x86_64-w64-mingw32- --pkg-config=pkg-config --pkg-config-flags=--static --disable-shared --enable-static --disable-w32threads --enable-pthreads --enable-cross-compile --target-exec=wine --enable-runtime-cpudetect --enable-gpl --enable-version3 --extra-version="testonly" --enable-pic --enable-gray --disable-autodetect --disable-ffplay --disable-ffprobe --disable-doc

still yields:

ffmpeg.exe -h
*** stack smashing detected ***:  terminated

Since the build system is effectively unchanged between producing a working ffmpeg and producing a broken one like the above,
it means the combination of the latest Ubuntu 20.04.2 / mingw64 git head is unusable for building ffmpeg any more.
When run in a VM, Ubuntu 20.04.1 (which used to be OK) effecitvely forces one to upgrade to 20.04.2 ... and that breaks mingw64 tagged version 10 ... which means mingw64 git head ust be used ... and that combo fails.

I'm inclined to try an old Ubuntu 20.04.1 without any 'sudo apt -y update' nor 'sudo apt -y upgrade' and mingw tagged as v10, and see what happens just in case something nefarious is going on.

Version 0, edited 20 months ago by hydra3333 (next)

comment:3 by hydra3333, 20 months ago

And now

  • ubuntu 22.04.1 insists on trying to upgrade to 22.04.2.
  • a normal user can no longer install gcc related stuff into ubuntu 22.04.1 to then build stuff.

I am really beginning to hate ubuntu, and I never use that word.

Does anyone have suggestions on a "better" linux that works cross-compiling ffmpeg ?

sudo apt install -y g++-12
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 libstdc++-12-dev : Depends: libc6-dev (>= 2.13-0ubuntu6) but it is not installable
E: Unable to correct problems, you have held broken packages.

comment:4 by Balling, 20 months ago

sudo apt install -y g++-12

That is not how you install gcc. You use a meta package: sudo apt install build-essential

comment:5 by hydra3333, 20 months ago

OK. Had been using it for some time, but will revert to your advice asap.

comment:6 by hydra3333, 20 months ago

Using a fresh copy of the VM,

sudo apt install -y build-essential
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 libc6-dev : Depends: libc6 (= 2.35-0ubuntu3) but 2.35-0ubuntu3.1 is to be installed
E: Unable to correct problems, you have held broken packages.

It was worth a try.

comment:7 by hydra3333, 20 months ago

I suppose I should try it with out sudo apt -y update first.
Have given up though.

Last edited 20 months ago by hydra3333 (previous) (diff)

comment:8 by hydra3333, 20 months ago

ok, yeah, can't find any way around "* stack smashing detected *: terminated"
no matter what I try that issue persists.

am trying MABS with '-fstack-protector-all -D_FORTIFY_SOURCE=2' just to see what happens.

edit:
the MABS exe works OK.
so, a build system which used to work fine for literally years now no longer cross-compiles a working ffmpeg with ubuntu 22.04.2 and mingw64 git head (or the tagged v10 release).
I guess that means bye bye ubuntu and hello MABS in a windows sandbox.

Last edited 20 months ago by hydra3333 (previous) (diff)

comment:9 by hydra3333, 20 months ago

Ah.

Used WSL and it's inbuilt Ubuntu 20.04 and (eventually) a working mingw64 v11.0.1 and built an ffmpeg.

Same Result:

ffmpeg.exe -h
*** stack smashing detected ***:  terminated

Hmm. Looking like mingw is the culprit.

Now to try a mingw64 v9.0.0 and see if that works under ubuntu 20.04 (it used to).

Last edited 20 months ago by hydra3333 (previous) (diff)

comment:10 by hydra3333, 19 months ago

Best advice I have received so far is to dump Ubuntu and try archlinux.
Hmm, Arch is not listed as a supported guest for vmware.

Note: See TracTickets for help on using tickets.