#898 Error on GetEditControl for Category Dialog

v4.1
closed
Classes (182)
5
2012-08-14
2010-04-02
Jon Wolfers
No

Hi,

I see this behaviour in 4.0.0 and 4.0.1 but not in 3.2.0
Hopefully this is not relevant, but 4.0 tests were done on Vista Home premium SP2 and 3.2.0 tests done on XP Pro SP3

Here is the console session with the error

C:\ooRexx>rexx test
Creating Dialog
419 - obj~hDlg = pDialog~catalog['handles'][category]
89 - ctrlobj = class~new(self, id, category)
107 - forward message "GetControl" Arguments (arr)
221 - trigger = self~getEditControl(59,1)
Error 98 running C:\ooRexx\OODWIN32.CLS line 419: Execution error
Error 98.905: Deadlock detected on a guarded method

I attach a test file - pardon all the junk - I have stripped most stuff out of the real app.

thanks,

Jon

Discussion

  • Jon Wolfers

    Jon Wolfers - 2010-04-02

    crashes (but continues) on 4.0 ok on 3.2

     
  • Mark Miesfeld

    Mark Miesfeld - 2010-04-02

    Jon,

    The reason this worked in 3.2.0 and doesn't work in later releases is due to a bug that was in the way attributes were handled. All attributes were being treated as unguarded, even when they were not marked unguarded.

    The problem in your program comes from your PalmScheduleChecks() method. You start that on another thread, from InitControl().

    self~start(PalmScheduleChecks)

    Then the first line in PalmScheduleChecks() is:

    trigger = self~getEditControl(59,1)

    The problem is, during all the initializationfor a catgory dialog, there is a lot of access to the Catalog attribute of the Category dialog, which is guarded. Each of your Init<Page> methods is "getting" a lot of controls. For each 'get' control there is a look up of the dialog handle in the Catalog directory.

    Normally this is fine, because all the Init<page> methods are guarded and they all run sequentially. When you do a start of PalmScheduleChecks() then suddenly things are not running sequentially.

    You can fix this in your program by moving:

    self~start(PalmScheduleChecks)

    from the InitControl() method, which runs first:

    self~catalog['names'] = .array~of("Control","Manual Entry","Search","Review","Reports")

    to the last thing in InitReports(), which runs last:

    / ------------------------------------------------------------------------- /
    ::method InitReports
    / ------------------------------------------------------------------------- /

    self~start(PalmScheduleChecks) / set auto alert for palm inv files /

    By placing it there, your

    trigger = self~getEditControl(59,1)

    happens after all the other 'get' controls are finished, and you no longer dead lock.

    The other thing that fixes it is to make the Catalog attribute unguarded. In OODIALOG.cls have line 2976 read:

    ::method Catalog attribute private unguarded / A directory that contains internal data /

    I'll have to think about whether attribute should be unguarded or not.

     
  • Jon Wolfers

    Jon Wolfers - 2010-04-02

    Hi Mark,

    I should have been able to work that out for myself.

    I have moved the call to the end of the initreports method and it works both in the small test script, but also in the enormous application.

    I don't imagine anyone much uses the categorydialog class so that's why this hasn't come up before.

    I'm happy to close this tracker unless you want it to remain open until you decide on the desirability of having the catalog attribute unguarded.

    thanks for your help - I'm one step nearer to migrating to 4.0.

    Jon

     
  • Mark Miesfeld

    Mark Miesfeld - 2010-05-24

    Jon,

    More a note to myself, so I don't have to keep re-readin this. I'm going to leave this open so that I take a closer look at whether the category attribute should be unguarded or not.

     
  • Mark Miesfeld

    Mark Miesfeld - 2010-08-10

    Committed revision 6091.

     
  • Mark Miesfeld

    Mark Miesfeld - 2010-09-11

    Committed revision 6172.

    4.1.0 merge.

     
  • Mark Miesfeld

    Mark Miesfeld - 2010-12-05

    The fix for this item was in the 4.1.0 release.

     


Anonymous

Cancel  Add attachments





Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks