http://bugs.winehq.org/show_bug.cgi?id=33239
Bug #: 33239 Summary: VisualBasic arrays of User Defined Type (UDTs) with strings Product: Wine Version: unspecified Platform: x86 OS/Version: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: -unknown AssignedTo: wine-bugs@winehq.org ReportedBy: mod@navsoft.com Classification: Unclassified
Created attachment 43964 --> http://bugs.winehq.org/attachment.cgi?id=43964 Uses a simple program to test where the crash occurs
I use arrays of UDTs which work under MS Windows. (Any version post Win 2000 except ME.) The program also works happily on a Mac using a Parallels virtual machine.
These fail under WINE if one or more of the fields is a string. The "TYPE" order makes no difference.
UDTs which contain only numbers are not affected.
Failure occurs on any attempt to "ReDim" or "Erase" the array. The problem does not occur when the strings are fixed length or for flat UDTs containing strings of undeclared length. Prior to a crash, the content of the UDTs can be read and written to.
Trying to write a simple program produces strange results. I tried initially on an old PC and found that it would crash simply by redimming the arrays but when installed under Parallels, it will handle simple arrays and only crashes as I start to get more adventurous; i.e. using a UDT type declared in a DLL but otherwise identical.
My main program can be downloaded at http://navsoft.com/AstroNav_Setup.exe. It makes no claims to being compatible with WINE but there are references to the problem area elsewhere in this forum by Users who would like to run it under WINE.
AstroNav uses UDTs extensively. The problem is the Almanac screen where multi dimension UDTs are widely used. With AstroNav, simply declaring and then destroying the arrays will cause a crash. [There is also a problem with WINE's treatment of SetGraphicsMode which I have not yet pinned down but will hopefully circumvent very shortly. (The SetGraphicsMode API does not work quite as Microsoft claim so removing it, is probably desirable.)]
The attached backtrace was caused by the following code. The crash occurs only for Command4_Click() and only on the third press. (Rapid pressing will cause a "The array is temporarily locked" error/ crash.)
FORM CODE ========== Private Type My_UDT n1 As Long s1 As String s2 As String End Type
Private mUDT() As My_UDT Private DLL_UDT() As Main_Almanac_Columns
Private Sub Command1_Click() ' NO PROBLEM NOW BUT SIMILAR CODE CAUSED A Dim i As Long ' CRASH ON AN OLDER PC ReDim mUDT(99)
For i = 0 To 99 mUDT(i).s1 = "Some String" mUDT(i).s2 = "Some String" Next i
ReDim mUDT(99) End Sub
Private Sub Command2_Click() ' SAME AS ABOVE BUT USING A GLOBAL UDT Dim i As Long ' = A BIT MORE ADVENTUROUS ReDim gUDT(99)
For i = 0 To 99 gUDT(i).s1 = "Some String" gUDT(i).s2 = "Some String" Next i
ReDim gUDT(99) End Sub
Private Sub Command3_Click() ' MORE ADVENTUROUS; PASSING DATA USING Compile_Data ' Public Property Get gUDT = My_Module_UDT End Sub
Private Sub Command4_Click() ' CRASHES ON THE THIRD CLICK ON MY MAIN Alt_Compile_Data ' MACHINE DLL_UDT = My_DLL_UDT End Sub
MODULE CODE =========== Private DLL_UDT() As Main_Almanac_Columns
Type Module_UDT n1 As Long s1 As String s2 As String End Type
Private mUDT() As Module_UDT Public gUDT() As Module_UDT
'\ THE MODULE LEVEL TEST
Sub Compile_Data() Dim i As Long
ReDim mUDT(71)
For i = 0 To 71 With mUDT(i) .n1 = i .s1 = i .s2 = i End With Next i End Sub
Public Property Get My_Module_UDT() As Module_UDT() My_Module_UDT = mUDT End Property
'\ USING THE IDENTICAL TYPE DECLARED IN A MODULE Sub Alt_Compile_Data() Dim i As Long
ReDim DLL_UDT(71)
For i = 0 To 71 With DLL_UDT(i) .Gap = i .sGHA = i .sDec = i End With Next i End Sub
Public Property Get My_DLL_UDT() As Main_Almanac_Columns() My_DLL_UDT = DLL_UDT End Property
http://bugs.winehq.org/show_bug.cgi?id=33239
Nikolay Sivov bunglehead@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Version|unspecified |1.4
--- Comment #1 from Nikolay Sivov bunglehead@gmail.com 2013-03-18 06:16:52 CDT --- Wine-1.4 you're using is really old, you need to test with recent dev version 1.5.26. It's possible it has something to do with BSTR cache, but it's too early to be sure about that.
http://bugs.winehq.org/show_bug.cgi?id=33239
--- Comment #2 from Nikolay Sivov bunglehead@gmail.com 2013-03-18 06:18:30 CDT --- Also when update to 1.5.26 please attach +ole,+variant,+tid log as a text file if it still doesn't work for you.
http://bugs.winehq.org/show_bug.cgi?id=33239
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |download
http://bugs.winehq.org/show_bug.cgi?id=33239
Nikolay Sivov bunglehead@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Depends on| |27976
--- Comment #3 from Nikolay Sivov bunglehead@gmail.com 2013-03-18 15:19:05 CDT --- I just tried with 1.5.26 and I'm getting a crash from bug 27976 in GDI code, assuming it's not related to described VB problem
http://bugs.winehq.org/show_bug.cgi?id=33239
Nikolay Sivov bunglehead@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Depends on|27976 |
http://bugs.winehq.org/show_bug.cgi?id=33239
Nikolay Sivov bunglehead@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Depends on| |27976
http://bugs.winehq.org/show_bug.cgi?id=33239
--- Comment #4 from Michael O'Dougherty mod@navsoft.com 2013-03-18 16:36:14 CDT --- The bug is similar to Bug Report 22976 except that I have distilled it down here to the handling of arrays. There may also be an issue in 22976 with the GDI call to SetGraphicsMode API.
I can supply a compiled exe for testing of the simple program for testing if you want. Can I add a simple EXE as an attachment here?
Will revert once I can get Ubuntu 12.XX to work as it fails under Parallels.
http://bugs.winehq.org/show_bug.cgi?id=33239 Bug 33239 depends on bug 27976, which changed state.
Bug 27976 Summary: Software Astronav Crash http://bugs.winehq.org/show_bug.cgi?id=27976
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution|--- |FIXED
http://bugs.winehq.org/show_bug.cgi?id=33239
--- Comment #5 from Bruno Jesus 00cpxxx@gmail.com --- (In reply to Michael O'Dougherty from comment #4)
I can supply a compiled exe for testing of the simple program for testing if you want. Can I add a simple EXE as an attachment here?
Yes, please. Now that AstroNav bug is fixed a sample to test this would be very useful.
https://bugs.winehq.org/show_bug.cgi?id=33239
Damjan Jovanovic damjan.jov@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Ever confirmed|0 |1 CC| |damjan.jov@gmail.com Status|UNCONFIRMED |NEEDINFO
--- Comment #6 from Damjan Jovanovic damjan.jov@gmail.com --- Hi Michael, how do you reproduce this bug in your app? Just by opening the "Almanac" screen from the "Screen" menu?
If so, it opens perfectly fine, many times, under both Wine 4.0 on Ubuntu 16.04, and the latest Wine Git (after version 5.14) on FreeBSD 12.1. Would that mean this bug has been fixed?
https://bugs.winehq.org/show_bug.cgi?id=33239
Ken Sharp imwellcushtymelike@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |Abandoned? URL| |http://navsoft.com/AstroNav | |_Setup.exe