OpenBoard-org / OpenBoard

OpenBoard is a cross-platform interactive whiteboard application intended for use in a classroom setting.
https://openboard.ch/
GNU General Public License v3.0
2.34k stars 423 forks source link

[Bug] Interactive widget crashes OpenBoard when editing #1054

Open Vekhir opened 1 month ago

Vekhir commented 1 month ago

Describe the bug

Some widgets can be edited (e.g. TicTacToe and, on dev, Dice). When editing, the Theme can be selected by clicking on the dropdown menu. However, OpenBoard immediately crashes upon clicking, This bug occurs with Qt 6.7.2, but not with Qt5.

To Reproduce

  1. Go to Interactivities and choose TicTacToe.wgt (DnD onto the board).
  2. Click on Edit in the top right corner of the widget.
  3. Click on pad or the downward arrow next to it.
  4. Wait a few seconds until crash.

Expected behavior

  1. OpenBoard does not crash
  2. A dropdown menu with available options shows up

Actual behavior

OpenBoard crashes with a segfault (SIGSEGV).

Additional resources

Running openboard with strace produces the stracelog.txt below (cut down; the click on pad happens in line 42) stracelog.txt

The same happens with the Dice widget on dev, where I actually encountered this issue first.

I checked the WebInspector, but the app crashes before anything shows up there when clicking on pad.

Context

Additional context

OS: Arch Linux Kernel: Linux 6.10.4-arch2-1 qt6-base: 6.7.2-1 qt5-base: 5.15.14+kde+r143-1

letsfindaway commented 1 month ago

Cannot reproduce here on openSUSE Leap 15.6 with Qt5.

kaamui commented 1 month ago

Hi @Vekhir,

thank you for reporting (and for all the efforts you put on OpenBoard!)

I can't reproduce the crash on Ubuntu 20.04 but I can see a theme issue on some interactivities as well. Maybe the crash occurs depending on the Qt WebEngine version involved.

The web inspector's console gives some information : ubw-main.js:16 Retrieve parameter value [undefined] as type [undefined] for key : [themes] so it might be an issue located in this file, on every interactivity handling style change this way.

It seems there is some missing part as fillParameters is never returning anything (preferenceKeys is always empty) :

https://github.com/OpenBoard-org/OpenBoard/blob/1665e2e570e5e76c75d9e8a4b7e9a3f0c5071736/resources/library/interactivities/Tic%20Tac%20Toe.wgt/js/lib/ubw-main.js#L55

I'm not much familiar with this part of OpenBoard. Maybe @letsfindaway has some tips about what could be missing ?

Vekhir commented 1 month ago

Motivated by the fact that my bug reports are seemingly unreproducible, I have systematically checked the Arch snapshots of the last 5 months. My findings are that the issue first occurs on 2024-06-24, that is Qt 6.7.2. All versions prior (tested 6.6.2, 6.7.0, 6.7.1 as of 2024-06-23) work fine.

The 6.7.2 changelog doesn't mention anything immediately obvious.

@letsfindaway Can you check with Qt 6.7.2 to reproduce the bug? Certainly seems like a regression, but I'd like to see it confirmed before writing a bug report.

letsfindaway commented 1 month ago

@letsfindaway Can you check with Qt 6.7.2 to reproduce the bug? Certainly seems like a regression, but I'd like to see it confirmed before writing a bug report.

I just built OpenBoard in a Tumblewed distrobox with Qt 6.7.2 and can reproduce the bug there. So I can confirm that it depends on the Qt version.

letsfindaway commented 1 month ago

The web inspector's console gives some information : ubw-main.js:16 Retrieve parameter value [undefined] as type [undefined] for key : [themes] so it might be an issue located in this file, on every interactivity handling style change this way.

It seems there is some missing part as fillParameters is never returning anything (preferenceKeys is always empty) :

https://github.com/OpenBoard-org/OpenBoard/blob/1665e2e570e5e76c75d9e8a4b7e9a3f0c5071736/resources/library/interactivities/Tic%20Tac%20Toe.wgt/js/lib/ubw-main.js#L55

This is not a problem but only warnings. As long as you have not edited the TicTacToe the cells have no associated data and fillParameters returns an empty list. If you edit one or more cells, then you will get a not-empty result from fillParameters. Same is for the theme or other variables: if you did not change the default value, then nothing is stored in the widget parameters.

Vekhir commented 1 month ago

Just tested with Qt 6.8.0beta3 and the issue occurs there too, so hasn't been fixed in the meantime.

Vekhir commented 1 month ago

I've opened a bug report on the Qt bug tracker: https://bugreports.qt.io/browse/QTBUG-128241