Bug? B4J v9.5 BETA Need to restart IDE after a long Log causes IDE error.

William Lancee

Well-Known Member
Licensed User
Longtime User
The IDE stops working after the following. It happens in both release and debug mode.

B4X:
10079    USB_Silver_5    Oscar Peterson    Night Train    05-Moten Swing.wav
10080    USB_Silver_5    Oscar Peterson    Night Train    06-Easy Does It.wav
10081    USB_Silver_5    Oscar Peterson    Night Train    07-Honey Dipper.wav
10082    USB_Silver_5    Oscar Peterson    Night Train    08-Things Ain't What They Used to Be.wav
10083    USB_Silver_5    Oscar Peterson    Night Train    09-I Got It Bad and That Ain't Good.wav
10084    USB_Silver_5    Oscar Peterson    Night Train    10-Band Call.wav
10085    USB_Silver_5    Oscar Peterson    Night Train    11-Hymn to Freedom.wav
10086    USB_Silver_5    Oscar Peterson    Night Train    folder.jpg
10087    USB_Silver_5    Perlman and Zukerman    Violin Duets    01-Moszkowski Two Violins and Piano.wav
10088    USB_Silver_5    Perlman and Zukerman    Violin Duets    02-Shostakovich Violin Duets.wav
10089    USB_Silver_5    Perlman and Zukerman    Violin Duets    03-Prokofiev Sonata op56.wav
10090    USB_Silver_5    Perlman and Zukerman    Violin Duets    folder.jpg
[IDE message - 9:52:37]
An error occurred.
Destination array was not long enough. Check destIndex and length, and the array's lower bounds.
 

Attachments

  • logProblem.zip
    205.4 KB · Views: 211

William Lancee

Well-Known Member
Licensed User
Longtime User
More testing. Use above .zip file (to get asset file) and modify code or use zip below.
Why would I run the same code twice? This is the smallest project I could make to illustrate the problem.
In the actual app, the Log is populated with a variety of outputs. The problem was very hard to track down. After the cryptic Error message,
nothing worked anymore. I had to check a lot of things before realizing it had something to do with the Logs.

B4X:
Private Sub B4XPage_Created (Root1 As B4XView)
    Root = Root1
    Root.LoadLayout("MainPage")

    catalog = File.ReadList(File.DirAssets, "MusicCatalog.txt")

    Dim cnt As Long
    For i = 0 To catalog.Size - 1
        Dim s As String = catalog.Get(i)
        cnt = cnt + 1
        Log("A " & cnt & TAB & s)
    Next

'    The above works, but if you uncomment the next section, the above does not
'    It stops at A 5187 and disables the IDE
'    And this is just a copy of the above code
'    Why would the addition of this section disable the above?

'    Dim cnt As Long
'    For i = 0 To catalog.Size - 1
'        Dim s As String = catalog.Get(i)
'        cnt = cnt + 1
'        Log("B " & cnt & TAB & s)
'    Next


 
    ExitApplication
End Sub
 

Attachments

  • LogProb2.zip
    205.4 KB · Views: 205
Last edited:

tchart

Well-Known Member
Licensed User
Longtime User
I don’t think this is a new issue or related to the beta. I’ve reported this before on older versions.
 

tchart

Well-Known Member
Licensed User
Longtime User
 

William Lancee

Well-Known Member
Licensed User
Longtime User
B4X:
Build modules tree: 0
B4J version: 9.50 BETA #1
.Net version: 4.0.30319.42000
Ini folder: C:\Users\willi\AppData\Roaming\Anywhere Software\B4J
Global Java version: 11
Build modules tree: 0
Gui: 695
Build modules tree: 15
Build modules tree: 15
Build modules tree: 0
*** no reuse ***
*** no reuse ***
*** no reuse ***
... about 45 more of these
*** no reuse ***
*** no reuse ***
*** no reuse ***
Gui: 285
Compilation task: 292.7629
Compilation task: 93.6323
woke up.
*** no reuse ***
Compilation task: 93.6353
Compilation task: 2234.2964
System.ArgumentException: Destination array was not long enough. Check destIndex and length, and the array's lower bounds.
   at System.Array.Copy(Array sourceArray, Int32 sourceIndex, Array destinationArray, Int32 destinationIndex, Int32 length, Boolean reliable)
   at i.Read(Byte[] buffer, Int32 off, Int32 count)
   at h.a(Stream A_0, Boolean A_1)
   at go.a(Object A_0)

This is with attached zip (same as post #2 with section uncommented. The assets are included.

P.S. I have edited the title to include "Beta".
 

Attachments

  • logProb3.zip
    205.5 KB · Views: 204

William Lancee

Well-Known Member
Licensed User
Longtime User
Tested more.

After I widened the log window, there is no more error! So there you are.
If I narrow it more the error occurs earlier.


Still a bug though.
 

William Lancee

Well-Known Member
Licensed User
Longtime User
Also @Informatix and @tchart are right, I ran the test n v9.3 and the error is the same. So not a new Bug in v9.5 Beta.
As @tchart pointed out in an earlier post: "As it only happens sometimes its very hard to track down."
 

William Lancee

Well-Known Member
Licensed User
Longtime User
@agraham Thank you for testing. So the problem occurs as a combination of number of Log lines and log window size.

Note that when the error occurs, the Log does not display the latest lines. On my setup, in logProb#2, when the "B" section is run it breaks the IDE, but only part of the "A" is displayed.
 
Last edited:

William Lancee

Well-Known Member
Licensed User
Longtime User
Possibly the total number of characters in the Log and size of Log window area?

Here is the sequence:

1. To check for a bug in my logic, I logged the progress of my App
2. The aforementioned bug popup occurs.
3. I widen the Log window to see where my App stops.
4. I rerun the App, no more logs, no error, not anything - IDE not frozen, can still edit, but not run
5. I restart the IDE, this time everything runs without error popup
6. I resize my log window to my normal and do some stuff and rerun
7. The error pops up and 2. to 6. repeats
8. I think it may be the "capacity" of the Log window, so I don't display the large number of lines.
9. Everything worked fine at that point, I moved on.

Since I was using v9.5 Beta and since I have never experienced this before, I thought I should report the error.
Apparently it is an old unresolved intermittent bug that I was unaware of.

It may be appropriate to change the title of this thread and/or for @Erel to move it.
 
Top