aborts on startup when built against wxwidgets3.2

Bug #1989723 reported by Andreas Metzler
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Hugin
Fix Released
Undecided
Unassigned

Bug Description

Hello,

I have tried building hugin 2021.0 against wxwidgets3.2. It builds fine (some new deprecation warnings), but the binary is non-functional. It aborts immediately on startup, offering to save some debugging info (attached).

cu Andreas

Revision history for this message
Andreas Metzler (k-launchpad-downhill-at-eu-org) wrote :
Revision history for this message
tmodes (tmodes) wrote :

What was the last working wxWidgets versions?
Was it from the 3.0.x series? If so then it is only faint related to the wxWidgets 3.2 version.
It was already fixed in the repository (changeset edfddc6070ca). See also https://groups.google.com/g/hugin-ptx/c/kSrBFdINUnY

If the last working version was from the 3.1.x series, we have to dig deeper. The debug report indicates to a crash in hugin_utils::GetUserAppDataDir in file src/hugin_base/hugin_utils/utils.cpp, line 461. But I hope it was the first one.

Changed in hugin:
status: New → Incomplete
Revision history for this message
Andreas Metzler (k-launchpad-downhill-at-eu-org) wrote : Re: [Bug 1989723] Re: aborts on startup when built against wxwidgets3.2

On 2022-09-15 tmodes <email address hidden> wrote:
> What was the last working wxWidgets versions?
> Was it from the 3.0.x series? If so then it is only faint related to the wxWidgets 3.2 version.
> It was already fixed in the repository (changeset edfddc6070ca). See also https://groups.google.com/g/hugin-ptx/c/kSrBFdINUnY
[...]

Hello Thomas,

3.0.x. I will doublecheck and report back.

thanks, cu Andreas

Revision history for this message
Andreas Metzler (k-launchpad-downhill-at-eu-org) wrote :

On 2022-09-15 Andreas Metzler <email address hidden> wrote:
> On 2022-09-15 tmodes <email address hidden> wrote:
>> What was the last working wxWidgets versions?
>> Was it from the 3.0.x series? If so then it is only faint related to the wxWidgets 3.2 version.
>> It was already fixed in the repository (changeset edfddc6070ca). See also https://groups.google.com/g/hugin-ptx/c/kSrBFdINUnY
> [...]

> 3.0.x. I will doublecheck and report back.
[...]

Indeed the patch fixes the crash. Thanks!

However I get a assertion error when running [Create panorama...] from
the assistant:
----------------
ASSERT INFO:
./src/common/sizer.cpp(2267): assert "CheckSizerFlags(!((flags) & (wxALIGN_RIGHT)))" failed in DoInsert(): wxALIGN_RIGHT will be ignored in this sizer: only vertical alignment flags can be used in horizontal sizers

DO NOT PANIC !!

If you're an end user running a program not developed by you, please ignore this message, it is harmless, and please try reporting the problem to the program developers.

You may also set WXSUPPRESS_SIZER_FLAGS_CHECK environment variable to suppress all such checks when running this program.

If you're the developer, simply remove this flag from your code to avoid getting this message. You can also call wxSizerFlags::DisableConsistencyChecks() to globally disable all such checks, but this is strongly not recommended.

BACKTRACE:
[1] wxBoxSizer::DoInsert(unsigned long, wxSizerItem*)
[2] wxEntry(int&, wchar_t**)
[3] __libc_start_main
----------------

cu Andreas

Revision history for this message
tmodes (tmodes) wrote :

Please test the attached patch.

I'm testing also with wxWidgets 3.2 and don't get the assert. So it just a guess.

Revision history for this message
Andreas Metzler (k-launchpad-downhill-at-eu-org) wrote :

On 2022-09-16 tmodes <email address hidden> wrote:
> Please test the attached patch.
[...]

That fixes the warning, thanks.

I have found a third issue. After starting up, klicking on [Preview
Panorama (OpenGL)] yields an error (and nothing else:

----------
Error initializing GLEW
Fast preview window cannot be opened.
----------
with this message on the console:
ERROR: 14:13:49.978869 (./src/hugin1/hugin/GLViewer.cpp:133) SetUpContext(): Error initialising GLEW: Unknown error.

Klicking on [Preview Panorama (OpenGL)] succeeds.

cu Andreas

--
`What a good friend you are to him, Dr. Maturin. His other friends are
so grateful to you.'
`I sew his ears on from time to time, sure'

Revision history for this message
tmodes (tmodes) wrote :

This is a known build issue.

From the INSTALL_cmake file in Hugins base directory:
Note: On Linux wxWidgets 3.1.5 and later is by default compiled with EGL support for the wxGLCanvas class. In this case you need to activate EGL support explicitly also in GLEW, otherwise there are crashes when intializing the wxGLCanvas.

Revision history for this message
tmodes (tmodes) wrote :

Hi Andreas,

does it works now?
How can the build instruction be more clear? Suggestions are always welcome.

Revision history for this message
Andreas Metzler (k-launchpad-downhill-at-eu-org) wrote :

On 2022-09-25 tmodes <email address hidden> wrote:
> Hi Andreas,

> does it works now?
> How can the build instruction be more clear? Suggestions are always welcome.
[...]

Hello Thomas,

I do not think hugin can do anything about it but the EGL situation
seems to broken globally.

WX really should be built with EGL and everybody seems to be doing so.
Quoting https://bugs.debian.org/1020640
| AIUI, wxWidgets needs EGL for wxGLCanvas to work under Wayland.
|
| With 3.0, we had a hack in place to force use of X11 if the wx GL
| library was loaded:
|
| https://sources.debian.org/src/wxwidgets3.0/3.0.5.1%2Bdfsg-5/debian/patches/force-x11-for-wxgl.patch/
|
| That was better than not working, but doesn't seem a desirable long term
| solution.

OTOH glew EGL support does not seem to ready. Debian does not enable it,
afaict fedora does not either and OpenSuse has dropped it again:
| * Sat Aug 21 2021 Atri Bhattacharya <email address hidden>
| - Revert building with EGL support, as it breaks mutliple apps
| (boo#1189524).
There is known breakage on the glew side:
https://github.com/nigels-com/glew/issues/321
https://github.com/nigels-com/glew/issues/315

Archlinux builds with EGL but does some patching
https://archlinuxarm.org/packages/armv7h/glew/files

cu Andreas

--
`What a good friend you are to him, Dr. Maturin. His other friends are
so grateful to you.'
`I sew his ears on from time to time, sure'

Revision history for this message
tmodes (tmodes) wrote :

Sorry, I wasn't aware of the OpenGL ES/GLEW/wxWidgets problems.
The bug appeared some time ago: https://bugs.launchpad.net/hugin/+bug/1938453
And there the build fix for glew worked.
Not sure how to work around. There are some functions in the fast preview which are using GLEW function. Not sure if it is feasible to find a replacement.

Revision history for this message
tmodes (tmodes) wrote :

The default branch does now allow to use the epoxy library instead of GLEW (see https://bugs.launchpad.net/hugin/+bug/2007178 )
The use the epoxy library add -DBUILD_WITH_EPOXY=on to the CMake command line. Epoxy should detect at run-time if you are using GLX or EGL and so improve the situation (hopefully).

Changed in hugin:
milestone: none → 2023.0beta1
status: Incomplete → Fix Committed
tmodes (tmodes)
Changed in hugin:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.