View Issue Details

IDProjectCategoryView StatusLast Update
0007401MMW v4Framework: Scripts/Extensionspublic2012-11-11 01:11
Reporterzvezdan Assigned To 
PriorityhighSeverityminorReproducibilityrandom
Status closedResolutionfixed 
Product Version4.0 
Fixed in Version4.1 
Summary0007401: Error -2147418113 with SDB.Tree.AddNode during startup and AV on exit [MM4]
DescriptionMagic Nodes script has a possibility to select a Magic node which was last selected on the exit during startup of the program. That part of code worked fine with MM3, but with MM4 it generates an error randomly on line SDB.Tree.AddNode. It seems that this error happens only if SDB.Progress is active (displayed) in that moment. There are two error boxes on the startup, one displaying Error: -2147418113 with the script name and the line number where error occurred, and the another error box saying "Error happened during script execution: Catastrophic failure". When such error happens, the another (third) AV error dialog box appears on the program exit and MediaMonkey.exe stays left in memory.

You could try with the uploaded version of Magic Nodes (you should turn off the option "Skip expanding of the Magic Nodes branch during start-up", select some Magic node, e.g. "Genre, Artist, Album, Dics #" and restart program several times), or you could try the next test script (unfortunately, that error very rarely happens with that script and because of that it is hardly to reproduce; with Magic Nodes it happens more often):

Option Explicit

Sub OnStartup()
    Dim oMyNode1
    Dim oCurNode
    Dim oPrgTimer

    Set oPrgTimer = SDB.CreateTimer(5000)
    oPrgTimer.Enabled = False
    Set SDB.Objects("MNoPrgTimer") = oPrgTimer
    Script.RegisterEvent oPrgTimer, "OnTimer", "oPrgTimer_OnTimer"

    Set oMyNode1 = SDB.MainTree.CreateNode
    oMyNode1.Caption = "Test Node 1"
    SDB.MainTree.AddNode SDB.MainTree.Node_Library, oMyNode1, 1
    oMyNode1.UseScript = Script.ScriptPath
    oMyNode1.OnFillChildren = "OnFillChildren1"
    SDB.ProcessMessages
    oMyNode1.Visible = True
    oMyNode1.HasChildren = True

    oMyNode1.Expanded = True
    Set oCurNode = SDB.MainTree.FirstChildNode(oMyNode1)
    If Not oCurNode Is Nothing Then
        SDB.MainTree.CurrentNode = oCurNode
        oCurNode.Expanded = True
    End If
End Sub

Sub OnFillChildren1(oCurNode)
    Dim oMyNode2

    oCurNode.HasChildren = False
    oCurNode.HasChildren = True

    Set oMyNode2 = SDB.MainTree.CreateNode
    SDB.MainTree.AddNode oCurNode, oMyNode2, 3
    oMyNode2.HasChildren = False
    oMyNode2.Caption = "Test Node 2"
    oMyNode2.HasChildren = True
    Script.RegisterEvent oMyNode2, "OnFillChildren", "OnFillChildren2"
End Sub

Sub OnFillChildren2(oCurNode)
    Dim oMyNode3
    Dim oProgBar

    If SDB.Objects("MNoProgress") Is Nothing Then
        Set SDB.Objects("MNoProgress") = SDB.Progress
    End If
    SDB.Objects("MNoProgress").Text = "OnFillChildren"
    'SDB.Tools.Sleep 1000

    Set oMyNode3 = SDB.MainTree.CreateNode
    oMyNode3.Caption = "Test Node 3"
    SDB.MainTree.AddNode oCurNode, oMyNode3, 3
    Script.RegisterEvent oMyNode3, "OnFillTracks", "OnFillTracks"
    SDB.Objects("MNoPrgTimer").Enabled = True
End Sub

Sub OnFillTracks(oCurNode)
    If SDB.Objects("MNoProgress") Is Nothing Then
        Set SDB.Objects("MNoProgress") = SDB.Progress
    End If
    SDB.Objects("MNoProgress").Text = "OnFillTracks"
    SDB.Objects("MNoPrgTimer").Enabled = True
End Sub

Sub oPrgTimer_OnTimer(oTimer)
    oTimer.Enabled = False
    If Not SDB.Objects("MNoProgress") Is Nothing Then
        Set SDB.Objects("MNoProgress") = Nothing
    End If
End Sub
TagsNo tags attached.
Attached Files
MagicNodes-4.1.mmip (129,050 bytes)
Zvezdan - WINXP.zip (81,221 bytes)
Fixed in build1601

Activities

jiri

2011-03-03 15:32

administrator   ~0023522

I suppose that it's related to the new handling due to multiple tabs support, so assigning to Petr.

petr

2011-04-26 20:44

developer   ~0024487

I'm unable to reproduce in 1367

peke

2011-04-30 02:40

developer   ~0024609

Verified 1367 No reproduce Closing

zvezdan

2011-04-30 07:35

updater   ~0024615

How could you mark some issue as resolved and close this ticket if I still has the same problem even with b1367? Did you see that Reproducibility is marked as random? It cannot be reproduced if you try it just few times. However, with the attached version of the Magic Nodes script I could reproduce it 3 of 10 times (you should not try it with the newer versions of that script from my site because they have added On Error Resume Next in the front of the problematic SDB.Tree.AddNode line).

Steps to reproduce the problem:
1. forget about the test script which I posted in Description and install the attached Magic Nodes script;
2. start program, open the Options dialog box, turn off the "Skip expanding of the Magic Nodes branch during start-up" option and turn on the "Show elapsed time in the progress bar after SQL queries" option on the Magic Nodes tab;
3. select "Genre, Artist, Album, Dics #" node from the "Magic Nodes" node;
4. restart the program several times.

petr

2011-04-30 19:51

developer   ~0024645

I've tried many times without any issue.
Also i can't see bugreport from you. Can you send me privately a details so i can identify your bugreport ?

zvezdan

2011-04-30 22:21

updater   ~0024658

I have sent you the bug report files to your e-mail. However, I don't know how could they help you since they are generated on AV error when closing the program. I think it is more important to discover why the error with AddNode is happening during start-up.

zvezdan

2011-05-01 11:03

updater   ~0024681

It seems that the mentioned bug with AddNode is happening less frequently with almost empty, newly created database (but it still happens).

However, there is one similar and probably related bug which I forgot to report since it appears even less then the mentioned, but it is happening more often with the almost empty database (3 tracks, one .avi file). With that error there is just one error message box "Error -2147418113 ..." during start-up on the SDBTreeNode.Expanded line; there is not the error box saying "Error happened during script execution: Catastrophic failure", nor the AV error dialog box on the program exit.

rusty

2011-05-04 22:48

administrator   ~0024843

Last edited: 2011-05-05 05:45

I tried to reproduce this by following the repro steps at http://www.ventismedia.com/mantis/view.php?id=7401#c24615 close to 30 times, but couldn't.

Tested with build 1369 on Win7 x64.

Zvezdan, anything different about your environment that you think might account for the fact that the bug is only occurring on your system?

I'm reducing the priority to 'high' until we can reproduce the issue on another system.

michal

2011-05-05 06:42

developer   ~0024852

On XP, I've reproduced the problem twice (following the given steps cca 20 times), but then tried about 40 times the same steps and no error...

zvezdan

2011-05-05 08:27

updater   ~0024855

Folks, please try to understand me. It is not my intention to blame your program without any reason, I just want to help you to fix its bugs and inconsistencies. This bug is not critical to me since I am not using MM4, but MM4 users could have problems because of the mentioned bug. It could be affected not only those users who use Magic Nodes, but maybe ones with some another script, maybe even ones with the program itself in some specific situations. I think because of that it is recommended for you to remove all possible bugs, not matter how rare they occur. Believe me, I am getting this error much more often then you, sometimes 10 times in a row, but never rarer then 2 times out of 10.

I tried it on 4 different machines with different setups:
1. XP SP2, installed beside of MM3, tried 3 different databases, one with 15000 tracks, one with 2000 tracks (not mine, but from one user) and one with 3 tracks;
2. XP SP2, installed for the first time, tried empty database and one with 2000 tracks;
3. XP SP2, installed beside of MM3, tried database with 40 tracks.
4. Vista, installed beside of MM3, tried empty database and one with 2000 tracks.

I have tried 1333, 1343, 1344, 1345, 1346, 1348, 1358, 1367, 1368, skinned/non-skinned, installed Magic Nodes in global/local folder... all the same.

As I said, it seems that the error with AddNode occurs more often with filled databases and error with oNode.Expanded = True occurs more often with empty databases. Also, it seems that these errors occur more often in XP then in Vista.

jiri

2011-05-05 08:38

administrator   ~0024856

Zvezdan, sure, we'd also like to find out what's going on, it's just that noone can reasonably reproduce here. Anyway, we plan to add more debug messages to the next build, so that when you reproduce it and send us a debug log, it will hopefully reveal more useful information for us. Thanks for your help!

petr

2011-06-14 19:09

developer   ~0026135

Marking as resolved. Feel free to reopen when reproduced in latest build (include debuglog, please).

zvezdan

2011-06-14 21:40

updater   ~0026138

It is still happening in 1389.

jiri

2011-06-15 05:55

administrator   ~0026141

Zvezdan, please include a new debug log.

zvezdan

2011-06-15 08:58

updater   ~0026142

The last time when petr asked for a debug log I sent it to him in e-mail, but didn't get any response. I chose to sent a debug log every time when an access violation error occurs, did you got anything from me? What is a point of sending that debug log if you don't analyze it?

Anyway, I need to repeat, in my opinion in this case this access violation error and the corresponding debug log is useless since it occurs on the exit of the program. It is more important if you could find a reason why I am getting the error message on the start of the program (that error message is the normal one, not access violation, so there is not a debug log for that error).

Yes, the access violation error on the exit occurs every time when I get the mentioned error on the start, so obviously they are related, but they could happen in totally different parts of code, i.e. fixing a reason of the access violation error could not solve a bug causing the error on the start.

jiri

2011-06-15 13:17

administrator   ~0026148

Zvezdan, I mean a debug log using DbgView tool, not a crash report generated automatically on AV - you are right that it isn't useful in this case.

zvezdan

2012-03-02 16:49

updater   ~0030603

I discovered that MM4 is trying to select the node which was last selected on the exit even for nodes that are not its native, i.e. the custom nodes like Magic nodes (in MM3 it was selected only its native nodes). So, I removed the code from the script which selects a node during start-up, letting the program to do that. Unfortunately, I am still getting the mentioned -2147418113 error message, but instead of the second dialog saying "Error happened during script execution: Catastrophic failure", I am now getting the another error dialog telling "Error during player initialization." There is still the AV error on the exit of the program and the MM instance left in memory. I have attached the new debug log file which I got when the error occurred.

Developers, would you do something with this problem, please? I really don't like if/when your users blame my scripts because of bugs in your program.

By the way, your algorithm for expanding custom nodes on the start-up is not working always correctly with Magic nodes, i.e. sometimes MM expands wrong MN folder and/or selects wrong Magic node.

jiri

2012-03-06 10:35

administrator   ~0030623

Zvezdan, the latest problem can be reproduced consistently? If so, please link the URL of the version of the script causing the problem and add any info needed to reproduce (expand particular nodes?) and assign to Ludek then. Thanks.

zvezdan

2012-03-06 13:10

updater   ~0030627

Well, the problem is random as before, it is not manifesting every time. As I said, the only difference than before is with the second dialog box (if you remember, there are two error boxes, one immediately after another). The last official version of Magic Nodes has removed part of code which selects node during start-up letting the program to do that (http://solair.eunet.rs/~zvezdand/MagicNodes.htm).

You could use the same steps to reproduce the problem as before (0024615) or this:
1. start the program and install the official version of Magic Nodes;
2. open the Options dialog box, turn off the "Skip expanding of the Magic Nodes branch during start-up" option and turn on the "Show elapsed time in the progress bar after SQL queries" option on the Magic Nodes tab;
3. expand "Genre, Artist, Album, Dics #" node from the "Magic Nodes" node;
4. select any sub-node from it, e.g. Alt. Rock (if you have it);
5. restart the program several times, but make sure that the same node is selected every time before closing the program, because MM has a problem with that as I mentioned in the previous post (it sometimes expands wrong MN folder and/or selects wrong Magic node on the start-up).

I cannot assign issues to anybody, I suppose this is because I am marked as an updater.

jiri

2012-03-06 13:24

administrator   ~0030628

Ludek, could you look into it?

Ludek

2012-03-12 18:12

developer   ~0030656

Last edited: 2012-03-12 18:14

I cannot reproduce any issue. Tested on Win XP, latest MM build. I tried to restart MM at least 50 times. Maybe I would need to have same MM.DB? Is there a debug log available?

zvezdan

2012-03-12 23:07

updater   ~0030657

http://www.ventismedia.com/mantis/view.php?id=7401#c30603: "I have attached the new debug log file which I got when the error occurred."

http://www.ventismedia.com/mantis/view.php?id=7401#c24855: "I tried it on 4 different machines with different setups:
1. XP SP2, installed beside of MM3, tried 3 different databases, one with 15000 tracks, one with 2000 tracks (not mine, but from one user) and one with 3 tracks;
2. XP SP2, installed for the first time, tried empty database and one with 2000 tracks;
3. XP SP2, installed beside of MM3, tried database with 40 tracks.
4. Vista, installed beside of MM3, tried empty database and one with 2000 tracks.

I have tried 1333, 1343, 1344, 1345, 1346, 1348, 1358, 1367, 1368, skinned/non-skinned, installed Magic Nodes in global/local folder... all the same."

zvezdan

2012-03-15 18:51

updater   ~0030694

It seems that this bug happens only with some add-ons with dockable panel. Although I think that I had the same problem even with only Magic Nodes installed alone, but now I could only reproduce it if I have installed as well:
- Event Logger, or
- Lyrics Viewer, or
- Song Information Panel.

It is interesting that the error happens no matter if the dockable panel is displayed during start-up or not (if it is disabled in the View menu).

I cannot reproduce it even after many attempts with:
- MonkeyRok, nor
- Playlist Manager.

By the way, if I don't get the error dialog box during the start-up then I would get one another bug with those "problematic" add-ons with dockable panel. For example, if my last selected node before the exit is "House" inside of "Genre, Artist, Album, Dics #" (which means that "Genre, Artist, Album, Dics #" is expanded displaying all genres), after the start-up I could get that node expanded, but also some another node from the same level, e.g. "Top 20...", and inside of it I would get nodes with genres even if that node doesn't contains nodes with genres, but some another nodes (e.g. "Top 20 rated Artists" and similar), and inside of that node ("Top 20...") I would get selected node, but not inside of "Genre, Artist, Album, Dics #":
http://img842.imageshack.us/img842/968/addnodebug1.png

If I collapse and expand "Top 20..." then it displays sub-nodes correctly:
http://img52.imageshack.us/img52/4793/addnodebug2.png

I repeat, this happens only if I don't get the mentioned error dialog.

zvezdan

2012-03-16 07:31

updater   ~0030695

I knew that I remember correctly. Here is what is (was) happening. If you install Magic Nodes 4.1 which is attached with this issue, you would get the mentioned errors even if you have only Magic Nodes add-on installed. However, if you install Magic Nodes 4.2 which is the last official version downloadable from my site, you would get the errors only if you have installed Event Logger or Lyrics Viewer or Song Information Panel as well.

Just to remind you, the difference between those two versions of Magic Nodes is in that v4.2 has removed part of code which selects Magic node during start-up letting the program to do that.

Ludek

2012-03-18 23:25

developer   ~0030713

I haven't reproduced the problems, but I revised the related parts of code and there was really a problem that was most probably root of the problems you described.
Actually I was able to reproduce something related/similar:
If you focus 'Now Playing' node immediatelly after startup (before the right Magic node is selected) then there can be AV (reproduced once).

This and the problems you described should be fixed in build 1601.
So please verify in 1601.

peke

2012-11-11 01:11

developer   ~0033083

Verified 1605