Bug 568881 - [macOS] Big Sur: NPE in ToolBar.layoutUnified
Summary: [macOS] Big Sur: NPE in ToolBar.layoutUnified
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.17   Edit
Hardware: Macintosh Mac OS X
: P3 normal with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 575659 569361
  Show dependency tree
 
Reported: 2020-11-17 05:22 EST by Thomas Singer CLA
Modified: 2021-11-14 09:09 EST (History)
4 users (show)

See Also:


Attachments
Test-case (42.34 KB, application/zip)
2021-11-05 05:16 EDT, Stephan Aßmus CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Singer CLA 2020-11-17 05:22:12 EST
We have received a couple of exceptions from different users on Big Sur (SWT 4940r7):

java.lang.NullPointerException
	at org.eclipse.swt.widgets.ToolBar.layoutUnified(SourceFile:588)
	at org.eclipse.swt.widgets.ToolBar.layout(SourceFile:655)
	at org.eclipse.swt.widgets.ToolBar.relayout(SourceFile:674)
	at org.eclipse.swt.widgets.ToolBar.createItem(SourceFile:301)
	at org.eclipse.swt.widgets.ToolItem.<init>(SourceFile:98)

Unfortunately, no snippet or details how to reproduce.
Comment 1 Stephan Aßmus CLA 2021-10-29 06:55:54 EDT
Apparently, this bug can be reproduced in our SWT-based app every single time when trying to open a "main window" (with a unified toolbar). The stack trace and source code lines are exactly as in the original report. Not yet sure if it can be reproduced in a more recent SWT version.
Comment 2 Stephan Aßmus CLA 2021-10-29 06:56:49 EDT
(In reply to Stephan Aßmus from comment #1)
> Apparently, this bug can be reproduced in our SWT-based app every single
> time when trying to open a "main window" (with a unified toolbar). The stack
> trace and source code lines are exactly as in the original report. Not yet
> sure if it can be reproduced in a more recent SWT version.

Sorry, I meant to add the crucial bit of information that this happens in macOS Monterey.
Comment 3 Lakshmi P Shanmugam CLA 2021-10-29 08:40:21 EDT
(In reply to Stephan Aßmus from comment #2)
> (In reply to Stephan Aßmus from comment #1)
> > Apparently, this bug can be reproduced in our SWT-based app every single
> > time when trying to open a "main window" (with a unified toolbar). The stack
> > trace and source code lines are exactly as in the original report. Not yet
> > sure if it can be reproduced in a more recent SWT version.
> 
> Sorry, I meant to add the crucial bit of information that this happens in
> macOS Monterey.

Can you pls provide a test case to reproduce the problem? Does it also happen on Big Sur?
Comment 4 Stephan Aßmus CLA 2021-10-29 11:58:27 EDT
It does not happen on Big Sur. Meanwhile, I have confirmed that it still happens with SWT 4.21.

I should be able to provide a minimal test case, since it happens while preparing the toolbar in a specific way, before any items are added.
Comment 5 Stephan Aßmus CLA 2021-11-05 05:16:18 EDT
Created attachment 287454 [details]
Test-case

Eclipse project for reproducing the crash. Import into Eclipse workspace, have SWT as "org.eclipse.swt" in the workspace along the test-case project, run Main class as Java application. Should work on Big Sur and crash on Monterrey.
Comment 6 Stephan Aßmus CLA 2021-11-05 05:22:36 EDT
For easy browsing: https://github.com/stippi/swt-unified-toolbar-crash
Comment 7 Stephan Aßmus CLA 2021-11-05 07:00:51 EDT
Meanwhile, I have updated the example project on GitHub (linked above) with more self-explanatory stuff in the UI and JavaDocs and so on.

For feedback on TrimArea and perhaps an alternative way to achieve the same thing, I would be very grateful.
Comment 8 Tim Mueller CLA 2021-11-14 09:09:10 EST
I can confirm this bug also using my application. Only happens if a unified toolbar is used and only in MacOS Monterey.