Octave exited with signal 6

Using octave command ‘plot(1:5)’ in GUI-mode produces below messages to the terminal:

$ Gtk-Message: 14:29:34.143: Failed to load module "xapp-gtk3-module"
QIBusPlatformInputContext: invalid portal bus.
Qt: Session management error: None of the authentication protocols specified are supported
octave exited with signal 6

in ‘terminal mode’ the messages is as:

octave:1> plot(1:5)
fatal: caught signal Aborted -- stopping myself...

This is with:

$ lsb_release -a
LSB Version:	core-11.1.0ubuntu2-noarch:printing-11.1.0ubuntu2-noarch:security-11.1.0ubuntu2-noarch
Distributor ID:	Linuxmint
Description:	Linux Mint 20.3
Release:	20.3
Codename:	una

and

$ nvidia-smi 
Mon Feb  7 14:33:01 2022       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 510.47.03    Driver Version: 510.47.03    CUDA Version: 11.6     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  NVIDIA GeForce ...  Off  | 00000000:02:00.0 Off |                  N/A |
| N/A   64C    P0    N/A /  N/A |    490MiB /  4096MiB |      8%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|    0   N/A  N/A      1078      G   /usr/lib/xorg/Xorg                238MiB |
|    0   N/A  N/A      1640      G   cinnamon                           36MiB |
|    0   N/A  N/A      1910      G   /usr/lib/firefox/firefox          174MiB |
|    0   N/A  N/A      2353      G   ...AAAAAAAAA= --shared-files       38MiB |
+-----------------------------------------------------------------------------+

Which version of Octave and how did you install it?

The octave version is:
GNU Octave, version 6.4.0
and I installed it using the Linuxmint flatpak:
flatpak install org.octave.Octave

Might be related to Flatpak Octave 5.2.0 crashes when plotting on Linux Mint 18.3 · Issue #108 · flathub/org.octave.Octave (github.com)

Does running flatpak update help for you, too?

Currrent flatpak version and installed programs:

$ flatpak --version
Flatpak 1.12.2
$ flatpak list
Name                                Application ID                                   Version       Branch       Installation
Mesa                                org.freedesktop.Platform.GL.default              21.1.8        20.08        system
nvidia-470-86                       org.freedesktop.Platform.GL.nvidia-470-86                      1.4          system
Intel                               org.freedesktop.Platform.VAAPI.Intel                           20.08        system
openh264                            org.freedesktop.Platform.openh264                2.1.0         2.0          system
Mint-Y Gtk Theme                    org.gtk.Gtk3theme.Mint-Y                                       3.22         system
KDE Software Development Kit        org.kde.Sdk                                                    5.15         system
GNU Octave                          org.octave.Octave                                6.4.0         stable       system

The flatpak update is doing following:

$ flatpak update
Looking for updates…
        ID                                                     Branch           Op           Remote           Download
 1. [|] org.freedesktop.Platform.GL.nvidia-510-47-03           1.4              i            flathub          329.3 MB / 329.6 MB

The earlier flatpak NVIDIA driver looks like out of date vs. installed NVIDIA driver.
This looks like fixing the crash problem, but still warning messages appear as below:

$ Gtk-Message: 22:54:16.519: Failed to load module "xapp-gtk3-module"
QIBusPlatformInputContext: invalid portal bus.
Qt: Session management error: None of the authentication protocols specified are supported

Now there is 2 NVIDIA drivers:

$ flatpak list
Name                               Application ID                                     Version       Branch       Installation
Mesa                               org.freedesktop.Platform.GL.default                21.1.8        20.08        system
nvidia-470-86                      org.freedesktop.Platform.GL.nvidia-470-86                        1.4          system
nvidia-510-47-03                   org.freedesktop.Platform.GL.nvidia-510-47-03                     1.4          system
Intel                              org.freedesktop.Platform.VAAPI.Intel                             20.08        system
openh264                           org.freedesktop.Platform.openh264                  2.1.0         2.0          system
Mint-Y Gtk Theme                   org.gtk.Gtk3theme.Mint-Y                                         3.22         system
KDE Software Development Kit       org.kde.Sdk                                                      5.15         system
GNU Octave                         org.octave.Octave                                  6.4.0         stable       system

Can I remove the driver 470-86 version?

If you enter the command

sudo flatpak uninstall org.freedesktop.Platform.GL.nvidia-470-86

flatpak would give a Yes/No-warning if another app needed it.

Alternatively, you can see if it would be automatically removed anyways:

sudo flatpak uninstall --unused