Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 328413

Summary: Table with SWT.VIRTUAL style: Crashes and Problems
Product: z_Archived Reporter: Wolfgang Röckelein <mail>
Component: ERCPAssignee: ercp.eswt <ercp.eswt-inbox>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3    
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Wolfgang Röckelein CLA 2010-10-21 16:56:31 EDT
- doing a "new TableColumn" after setItemCount gives a NPE
- doing no "new TableColumn" gives an NPE:
Exception in thread "main" java.lang.NullPointerException
	at org.eclipse.swt.widgets.Table.addColumn(Table.java:288)
	at org.eclipse.swt.widgets.TableColumn.<init>(TableColumn.java:73)
	at org.eclipse.swt.widgets.Table.addItem(Table.java:230)
	at org.eclipse.swt.widgets.TableItem.<init>(TableItem.java:119)
	at org.eclipse.swt.widgets.Table.tableCallback(Table.java:1650)
- tableItem.setBackground in the "table.addListener (SWT.SetData, new Listener () { public void handleEvent (Event event) {" gives an crash in native code
Unhandled exception Type=Segmentation error

Java_com_ibm_ugl_eswt_expanded_OS_TreeItem_1SetItemCount:0x003D0E37 [0x003C8F40 +0x00007EF7]

Thread: main (priority 5) (LOCATION OF ERROR)
 NATIVE   com/ibm/ugl/eswt/expanded/OS.TableItem_SetBackground(III)V
 00000052 org/eclipse/swt/widgets/TableItem.setBackground(Lorg/eclipse/swt/graphics/Color;)V
 00000069 net/neobp/neo/nms/notification/view/NotificationListwindow$2.handleEvent(Lorg/eclipse/swt/widgets/Event;)V
 0000016a org/eclipse/swt/widgets/EventTable.sendEvent(Lorg/eclipse/swt/widgets/Event;)V  (@10426652)
 00000019 org/eclipse/swt/widgets/Widget.sendEvent(Lorg/eclipse/swt/widgets/Event;)V
 000000a9 org/eclipse/swt/widgets/Widget.sendEvent(ILorg/eclipse/swt/widgets/Event;Z)V
 000000b1 org/eclipse/swt/widgets/Table.tableCallback(III)I
- Disposing the table when there were items added through scrolling the table for approx half of the table gives an crash in native code:
Unhandled exception Type=Segmentation error

Java_com_ibm_ugl_eswt_expanded_OS_TreeItem_1SetItemCount:0x003D0BF6 [0x003C8F40 +0x00007CB6]

Thread: main (priority 5) (LOCATION OF ERROR)
 NATIVE   com/ibm/ugl/eswt/expanded/OS.TableColumn_Delete(I)V
 0000000f org/eclipse/swt/widgets/Table.destroyColumn(Lorg/eclipse/swt/widgets/TableColumn;)V
 00000009 org/eclipse/swt/widgets/TableColumn.releaseWidget()V
 00000060 org/eclipse/swt/widgets/Table.releaseWidget()V
 0000001f org/eclipse/swt/widgets/Composite.releaseWidget()V
 0000001f org/eclipse/swt/widgets/Composite.releaseWidget()V
 00000043 org/eclipse/swt/widgets/Decorations.releaseWidget()V
 00000027 org/eclipse/swt/widgets/Shell.releaseWidget()V
 00000019 org/eclipse/swt/widgets/Widget.dispose()V
 0000000d org/eclipse/swt/widgets/Control.dispose()V
 00000023 org/eclipse/ercp/swt/mobile/MobileShell.dispose()V

- deeper cause for this is that there are still items while the Columns are disposed. However, almost all time not all items can be disposed, which results in a crash at the column dispose. Disposing all items in a loop gives "<java.lang.RuntimeException: Unexpected native exception: Unable to remove item::The operation completed successfully.>" for most items. Using setItemCount(0) gives the same exception. Crash for column dipose is:
Unhandled exception Type=Segmentation error

Java_com_ibm_ugl_eswt_expanded_OS_TreeItem_1SetItemCount:0x003D0BF6 [0x003C8F40 +0x00007CB6]

 NATIVE   com/ibm/ugl/eswt/expanded/OS.TableColumn_Delete(I)V
 0000000f org/eclipse/swt/widgets/Table.destroyColumn(Lorg/eclipse/swt/widgets/TableColumn;)V
 00000009 org/eclipse/swt/widgets/TableColumn.releaseWidget()V
 00000019 org/eclipse/swt/widgets/Widget.dispose()V

- Note that the disposing crashes to not appear, if the table is not scrolled by the user/program!
Comment 1 Wolfgang Röckelein CLA 2010-10-26 14:00:17 EDT
Part of the crashes were due to a DLL version mixup. Unfortunatly the check that the version of the jar and the dll are the same does not seem to work.

Valid and reproducable is however the crash in tableItem.setBackground inside a "table.addListener (SWT.SetData, new Listener() { public void handleEvent (Event event) {"
Comment 2 Wolfgang Röckelein CLA 2010-10-28 15:35:59 EDT
(In reply to comment #1)
> Part of the crashes were due to a DLL version mixup. Unfortunatly the check
> that the version of the jar and the dll are the same does not seem to work.

Spoke too soon. All crashes are real and happen both on Win32 and on WM6.