Bug 296330 - graphics/hugin crashes on startup after fresh install
Summary: graphics/hugin crashes on startup after fresh install
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Some People
Assignee: Robert Clausecker
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2026-06-27 23:22 UTC by Greg Lehey
Modified: 2026-06-30 19:09 UTC (History)
2 users (show)

See Also:
linimon: maintainer-feedback? (fuz)


Attachments
Automatically generated debug report (2.90 KB, application/zip)
2026-06-27 23:22 UTC, Greg Lehey
no flags Details
Makefile patch to work around the problem (735 bytes, patch)
2026-06-29 01:53 UTC, Greg Lehey
no flags Details | Diff
graphics/hugin: permit use of epoxy instead of glew (2.13 KB, patch)
2026-06-29 16:00 UTC, Robert Clausecker
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Greg Lehey freebsd_committer freebsd_triage 2026-06-27 23:22:30 UTC
Created attachment 272196 [details]
Automatically generated debug report

After a fresh install, hugin crashes with the message 

  ERROR: 08:37:15.422071 (/wrkdirs/usr/ports/graphics/hugin/work/hugin-2025.0.1/src/hugin1/hugin/GLViewer.cpp:157) SetUpContext(): Error initialising GLEW: Unknown error.
  WARN: 08:37:15.431470 (/wrkdirs/usr/ports/graphics/hugin/work/hugin-2025.0.1/src/hugin_base/panodata/Panorama.h:639) isDirty(): modification status mismatch.
  Abort trap                 (core dumped) hugin

A popup appears: 

  Error initializing GLEW
  Fast preview window can not be opened.

I have seen this "initializing GLEW" error on other machines, but there it was recoverable.  This is a fresh install, and the problem is repeatable and fatal.

System:  

  FreeBSD bde.lemis.com 14.4-STABLE FreeBSD 14.4-STABLE #2: Thu May 14 21:57:38 AEST 2026     grog@bde.lemis.com:/usr/obj/hydra/home/src/FreeBSD/git/stable/14/amd64.amd64/sys/GENERIC amd64

The attachment is a debug report generated at the time of the crash.
Comment 1 Robert Clausecker freebsd_committer freebsd_triage 2026-06-28 08:43:59 UTC
Thank you for your report.

I cannot reproduce this issue on my machine and have reported it to the hugin-ptx mailing list.  Will keep you posted.
Comment 2 Robert Clausecker freebsd_committer freebsd_triage 2026-06-28 09:42:03 UTC
On the hugin-ptx list, it was said:

> From INSTALL_cmake
>
> 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. Alternatively 
> you can also use the epoxy library instead of GLEW, which does the detection at 
> run time. To build with epoxy add -DBUILD_WITH_EPOXY=on to the CMake command line.

Did you change any port options in the dependencies?

We do not currently have epoxy wired up into the port options, but I can look into adding that if you want to try it out.
Comment 3 Robert Clausecker freebsd_committer freebsd_triage 2026-06-28 09:43:26 UTC
Alternatively, which graphics driver and GPU do you use? The old nvidia-driver-340 does not support EGL at all...
Comment 4 Darren Mulligan 2026-06-28 13:02:33 UTC
(In reply to Robert Clausecker from comment #2)

I had the same problem, finding the same cause of GLEW being built without EGL support causing hugin to crash when opening the GL preview window.

I did as hugin instructed, taking glew out of USE_GL and adding -DBUILD_WITH_EPOXY=on to CMAKE_ARGS and it works correctly. libepoxy was already being brought in by other depends but perhaps it should be made an explicit dependency.

I don't see why it doesn't crash everyone since the port was updated to wxgtk32 as GLEW looks to have never supported EGL on FreeBSD (there is no config/Makefile.freebsd-egl as there is for linux-egl).
Comment 5 Greg Lehey freebsd_committer freebsd_triage 2026-06-29 01:53:10 UTC
Created attachment 272235 [details]
Makefile patch to work around the problem
Comment 6 Greg Lehey freebsd_committer freebsd_triage 2026-06-29 01:54:49 UTC
(In reply to Darren Mulligan from comment #4)
Yes, this worked around the problem.  Thanks.  I'm attaching diffs to the Makefile.

fuz@, I'd strongly recommend applying the patch and maybe adding something to the pkg-msg noting that the other options may work.
Comment 7 Robert Clausecker freebsd_committer freebsd_triage 2026-06-29 08:19:42 UTC
Thanks, will have a look at the patch and perhaps commit it.
Comment 8 Robert Clausecker freebsd_committer freebsd_triage 2026-06-29 16:00:50 UTC
Created attachment 272268 [details]
graphics/hugin: permit use of epoxy instead of glew

I plan to use attached patch to address the issue.
It adds a new toggle to switch between GLEW and EPOXY at compile time.
The patch is as of now untested; please test and let me know if it does the trick.
Comment 9 Greg Lehey freebsd_committer freebsd_triage 2026-06-30 07:04:46 UTC
(In reply to Robert Clausecker from comment #8)
I can confirm that this works as expected, not just on the test machine (bde), but also on my main machine (hydra).
Comment 10 commit-hook freebsd_committer freebsd_triage 2026-06-30 19:08:48 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=2fa6358ccc39f9ef705ca209fc9dacf276ef69df

commit 2fa6358ccc39f9ef705ca209fc9dacf276ef69df
Author:     Robert Clausecker <fuz@FreeBSD.org>
AuthorDate: 2026-06-29 15:57:53 +0000
Commit:     Robert Clausecker <fuz@FreeBSD.org>
CommitDate: 2026-06-30 19:06:31 +0000

    graphics/hugin: permit use of libepoxy instead of glew

    Some users report problems with hugin coming from graphics/glew not
    being built with EGL support.  Permit using libepoxy instead of
    graphics/glew for OpenGL stuff and make it the default to work around
    this issue.  Building with graphics/glew remains available as an option.

    PR:             296330, 296368
    Reported by:    grog
    Tested by:      grog
    MFH:            2026Q2

 graphics/hugin/Makefile | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)
Comment 11 Robert Clausecker freebsd_committer freebsd_triage 2026-06-30 19:09:37 UTC
Thank you for your report, proposed patch, and testing!
Comment 12 commit-hook freebsd_committer freebsd_triage 2026-06-30 19:09:50 UTC
A commit in branch 2026Q2 references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=14e9dfc4dbd4f334665ad57143bc4289be07a295

commit 14e9dfc4dbd4f334665ad57143bc4289be07a295
Author:     Robert Clausecker <fuz@FreeBSD.org>
AuthorDate: 2026-06-29 15:57:53 +0000
Commit:     Robert Clausecker <fuz@FreeBSD.org>
CommitDate: 2026-06-30 19:08:34 +0000

    graphics/hugin: permit use of libepoxy instead of glew

    Some users report problems with hugin coming from graphics/glew not
    being built with EGL support.  Permit using libepoxy instead of
    graphics/glew for OpenGL stuff and make it the default to work around
    this issue.  Building with graphics/glew remains available as an option.

    PR:             296330, 296368
    Reported by:    grog
    Tested by:      grog
    MFH:            2026Q2

    (cherry picked from commit 2fa6358ccc39f9ef705ca209fc9dacf276ef69df)

 graphics/hugin/Makefile | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)