You are viewing a plain text version of this content. The canonical link for it is here.
Posted to qa@openoffice.apache.org by Lucien Mathay <MA...@live.fr> on 2022/06/10 13:05:38 UTC

bug report strange behaviour usertypes

Hi,

I am sorry to seek help and at the same time report a strange behaviour, 
for a problem on which I can not find the origin.

I have a strange behaviour in an OOBasic program, and to make it simple 
I pruned down the question to the 12 lines of program which are 
displayed here :

option explicit

Type ZONEDIALOG
   hauteur   As Long
   largeur   As Long
End Type

Dim ZDstack(0 To 2) As ZONEDIALOG

Function Auto_Open()
     dim quoi as long
   quoi = 2  'const_xyz
   msgbox "OK"
End Function


The strange behaviour is as follows :

  * when executing this program, the message "Ok" comes up as expected,
    everything is fine and there is no error.

  * However now, consider the constant "2" at line 'quoi = 2' : if you
    replace this constant "2" by "const_xyz" (which is obviously
    undefined), observe what happens during thenext executions :
      o first execution brings up the message "Ok" : the error was not
        detected, although option explicit is active ... but that is not
        yet the biggest problem
      o executing a second time brings up "Basic execution error 9 :
        index out of the assigned range" at the line 'Dim ZDStack'

  * Now if reverting back to the constant "2" by removing "const_xyz"
    and putting the constant "2" in place again, it is also abnormal :
      o first execution shows "Ok"
      o following executions bring up "Basic execution error 9 : index
        out of the assigned range" at the line 'Dim ZDStack'


There is however a background to this behaviour : this file is issued 
from a full program showing this problem by removing all the unnecessary 
functions and sheets out of the program.
If this small portion of code is copied to a fresh calc file, the 
strange behaviour does not show up.  Therefore, I suspect the behaviour 
to be caused by something else than just the code ; this is why I 
appended the file to this mail, for you to be able to debug.

I compared the sections of the file with the xml sections of a fresh 
document, and I found differences only in content.xml, settings.xml and  
styles.xml, but nothing that could explain me why this behaviour.

If a charitable person could analyse this file, it would help me getting 
running the full program from which it is issued ... and it would 
probably expose a new bug in OO.  It won't be an easy job however I 
believe, therefore I am really thankful in advance !

Lucien
PS: I tried the file on two versions of OO and one LibreOffice, it does 
not make any difference.

Re: bug report strange behaviour usertypes

Posted by Lucien Mathay <MA...@live.fr>.
Actually, maybe I have a clue (by me it always comes after sleep)
I would best describe it as a scenario :

- when the code of the basic is modified, as per point 3 below, OO 
probably sets a flag
- when executing the program, as in point 4, OO checks this flag and if 
the code of the basic has been modified, it parses the section of the 
definitions (Consts, Dims and Types).
   Thus the first execution runs flawless.
- when executing the program a second time, as in point 5, OO checks the 
flag and does not parse the section of the definitions again as nothing 
has been changed, this reduces execution time.
- however, when finishing the execution of the basic code in point 4, OO 
more than probably has done some sort of cleanup in its storage allocation.
   And in doing that it could maybe have wiped out the storage of the 
definition "Type ZONEDIALOG"
   Therefore when executing point 5, this storage would be missing, 
hence the error message.

With the knowledge you have, does this scenario seem valid ?

Thanks,
Lucien.

Le 15/06/22 à 16:52, Lucien Mathay a écrit :
> Hi all,
>
> the version 4.1.13 I tested does not make any difference with regard 
> to the bug 'strange behaviour usertypes' reported earlier. 
> (unfortunately ; why would it have made a difference anyway ? :-)
>
> I still worked on this problem and managed to further simplify the 
> code showing the problem.  It is shown here, along with the steps 
> necessary to show the strange behaviour :
>
>     option explicit
>
>     Type ZONEDIALOG
>       hauteur   As Long
>       largeur   As Long
>     End Type
>
>     Dim ZDstack(0 To 2) As ZONEDIALOG
>
>     Sub Main()
>       dim quoi as Long
>       quoi = ID_UNDEFINED
>       msgbox "OK"
>     End Sub
>
>
> If you want to show the problem : use the attached file, (as it does 
> not show up when this code is copied into a fresh sheet), then follow 
> the steps :
>
>  1. Execute the code : -> error "undefinded variable" on ID_UNDEFINED
>     : which is perfectly normal ; program stops.
>  2. Execute the code again : -> the same error "undefinded variable" ;
>     program stops.  (as expected, but this point is just there to
>     check this :-).
>  3. Replace "ID_UNDEFINED" by a constant : "quoi = 2"
>  4. Execute the code : message box "OK" : and you think the problem is
>     solved, ... BUT ...
>  5. Execute the code again : -> error 9 "index out of defined range"
>     at "Dim ZDstack(0 To 2) As ZONEDIALOG" ; and the program
>     continues, as it displays "OK"
>  6. Execute the code again : -> same error 9 as point 5.
>  7. Now ! Modify the code :
>     Replace "OK" by "Really OK ?"
>  8. Execute the code : message box "Really OK ?" : no more error 9 !
>                                  , and this is due to the fact that
>     the code has been modified
>  9. Execute the code again : -> error 9 appears again ; and program
>     continues, as it displays "Really OK ?"
>
> The stack dump here attached shows that the exception "error 9" is 
> thrown from within "basic::NameContainer::getByName",
> and the exception specifies 
> "com::sun::star::container::NoSuchElementException", which is 'thrown 
> by child access methods of collections, if the addressed child does 
> not exist'.
>
> Just as if the "Type ZONEDIALOG" definition would have been removed 
> from memory ?
>
> Does anyone have any clue of what is going on ?
>
> Thanks alot if you have !
>
> Lucien.
>
> Le 10/06/22 à 17:03, Lucien Mathay a écrit :
>> Ah, sorry, I am not yet used to this exercise with 'Reply to List' !
>>
>> Lucien
>> Le 10/06/22 à 16:44, Carl Marcum a écrit :
>>> Hi All,
>>>
>>> I got reply this off-list so I'll add it here:
>>>
>>> OO on 4.1.6 and 4.1.12,  installed on Windows XP
>>>  and
>>> LibreOffice Version: 6.0.7.3 Build ID: 1:6.0.7-0ubuntu0.18.04.11
>>>
>>> Best regards,
>>> Carl
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: qa-unsubscribe@openoffice.apache.org
>> For additional commands, e-mail: qa-help@openoffice.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:qa-unsubscribe@openoffice.apache.org
> For additional commands, e-mail:qa-help@openoffice.apache.org

Re: bug report strange behaviour usertypes

Posted by Lucien Mathay <MA...@live.fr>.
Hi all,

the version 4.1.13 I tested does not make any difference with regard to 
the bug 'strange behaviour usertypes' reported earlier. (unfortunately ; 
why would it have made a difference anyway ? :-)

I still worked on this problem and managed to further simplify the code 
showing the problem. It is shown here, along with the steps necessary to 
show the strange behaviour :

    option explicit

    Type ZONEDIALOG
       hauteur   As Long
       largeur   As Long
    End Type

    Dim ZDstack(0 To 2) As ZONEDIALOG

    Sub Main()
       dim quoi as Long
       quoi = ID_UNDEFINED
       msgbox "OK"
    End Sub


If you want to show the problem : use the attached file, (as it does not 
show up when this code is copied into a fresh sheet), then follow the 
steps :

 1. Execute the code : -> error "undefinded variable" on ID_UNDEFINED :
    which is perfectly normal ; program stops.
 2. Execute the code again : -> the same error "undefinded variable" ;
    program stops.  (as expected, but this point is just there to check
    this :-).
 3. Replace "ID_UNDEFINED" by a constant : "quoi = 2"
 4. Execute the code : message box "OK" : and you think the problem is
    solved, ... BUT ...
 5. Execute the code again : -> error 9 "index out of defined range" at
    "Dim ZDstack(0 To 2) As ZONEDIALOG" ; and the program continues, as
    it displays "OK"
 6. Execute the code again : -> same error 9 as point 5.
 7. Now ! Modify the code :
    Replace "OK" by "Really OK ?"
 8. Execute the code : message box "Really OK ?" : no more error 9 !
                                  , and this is due to the fact that the
    code has been modified
 9. Execute the code again : -> error 9 appears again ; and program
    continues, as it displays "Really OK ?"

The stack dump here attached shows that the exception "error 9" is 
thrown from within "basic::NameContainer::getByName",
and the exception specifies 
"com::sun::star::container::NoSuchElementException", which is 'thrown by 
child access methods of collections, if the addressed child does not exist'.

Just as if the "Type ZONEDIALOG" definition would have been removed from 
memory ?

Does anyone have any clue of what is going on ?

Thanks alot if you have !

Lucien.

Le 10/06/22 à 17:03, Lucien Mathay a écrit :
> Ah, sorry, I am not yet used to this exercise with 'Reply to List' !
>
> Lucien
> Le 10/06/22 à 16:44, Carl Marcum a écrit :
>> Hi All,
>>
>> I got reply this off-list so I'll add it here:
>>
>> OO on 4.1.6 and 4.1.12,  installed on Windows XP
>>  and
>> LibreOffice Version: 6.0.7.3 Build ID: 1:6.0.7-0ubuntu0.18.04.11
>>
>> Best regards,
>> Carl
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: qa-unsubscribe@openoffice.apache.org
> For additional commands, e-mail: qa-help@openoffice.apache.org
>

Re: bug report strange behaviour usertypes

Posted by Lucien Mathay <MA...@live.fr>.
Ah, sorry, I am not yet used to this exercise with 'Reply to List' !

Lucien
Le 10/06/22 à 16:44, Carl Marcum a écrit :
> Hi All,
>
> I got reply this off-list so I'll add it here:
>
> OO on 4.1.6 and 4.1.12,  installed on Windows XP
>  and
> LibreOffice Version: 6.0.7.3 Build ID: 1:6.0.7-0ubuntu0.18.04.11
>
> Best regards,
> Carl
>


---------------------------------------------------------------------
To unsubscribe, e-mail: qa-unsubscribe@openoffice.apache.org
For additional commands, e-mail: qa-help@openoffice.apache.org


Re: bug report strange behaviour usertypes

Posted by Carl Marcum <cm...@apache.org>.
Hi All,

On 6/10/22 9:30 AM, Carl Marcum wrote:
> Hi Lucien,
>
> On 6/10/22 9:05 AM, Lucien Mathay wrote:
>> Hi,
>>
>> I am sorry to seek help and at the same time report a strange 
>> behaviour, for a problem on which I can not find the origin.
>>
>> I have a strange behaviour in an OOBasic program, and to make it 
>> simple I pruned down the question to the 12 lines of program which 
>> are displayed here :
>>
>> option explicit
>>
>> Type ZONEDIALOG
>>   hauteur   As Long
>>   largeur   As Long
>> End Type
>>
>> Dim ZDstack(0 To 2) As ZONEDIALOG
>>
>> Function Auto_Open()
>>     dim quoi as long
>>   quoi = 2  'const_xyz
>>   msgbox "OK"
>> End Function
>>
>>
>> The strange behaviour is as follows :
>>
>>   * when executing this program, the message "Ok" comes up as
>>     expected, everything is fine and there is no error.
>>
>>   * However now, consider the constant "2" at line 'quoi = 2' : if you
>>     replace this constant "2" by "const_xyz" (which is obviously
>>     undefined), observe what happens during thenext executions :
>>       o first execution brings up the message "Ok" : the error was not
>>         detected, although option explicit is active ... but that is
>>         not yet the biggest problem
>>       o executing a second time brings up "Basic execution error 9 :
>>         index out of the assigned range" at the line 'Dim ZDStack'
>>
>>   * Now if reverting back to the constant "2" by removing "const_xyz"
>>     and putting the constant "2" in place again, it is also abnormal :
>>       o first execution shows "Ok"
>>       o following executions bring up "Basic execution error 9 : index
>>         out of the assigned range" at the line 'Dim ZDStack'
>>
>>
>> There is however a background to this behaviour : this file is issued 
>> from a full program showing this problem by removing all the 
>> unnecessary functions and sheets out of the program.
>> If this small portion of code is copied to a fresh calc file, the 
>> strange behaviour does not show up.  Therefore, I suspect the 
>> behaviour to be caused by something else than just the code ; this is 
>> why I appended the file to this mail, for you to be able to debug.
>>
>> I compared the sections of the file with the xml sections of a fresh 
>> document, and I found differences only in content.xml, settings.xml 
>> and  styles.xml, but nothing that could explain me why this behaviour.
>>
>> If a charitable person could analyse this file, it would help me 
>> getting running the full program from which it is issued ... and it 
>> would probably expose a new bug in OO.  It won't be an easy job 
>> however I believe, therefore I am really thankful in advance !
>>
>> Lucien
>> PS: I tried the file on two versions of OO and one LibreOffice, it 
>> does not make any difference.
>>
>
> What versions of AOO and LO have you tested on and also what OS?
>
> Thanks,
> Carl
>

I got reply this off-list so I'll add it here:

OO on 4.1.6 and 4.1.12,  installed on Windows XP
  and
LibreOffice Version: 6.0.7.3 Build ID: 1:6.0.7-0ubuntu0.18.04.11

Best regards,
Carl

---------------------------------------------------------------------
To unsubscribe, e-mail: qa-unsubscribe@openoffice.apache.org
For additional commands, e-mail: qa-help@openoffice.apache.org


Re: bug report strange behaviour usertypes

Posted by Carl Marcum <ca...@gmail.com>.
Hi Lucien,

On 6/10/22 9:05 AM, Lucien Mathay wrote:
> Hi,
>
> I am sorry to seek help and at the same time report a strange 
> behaviour, for a problem on which I can not find the origin.
>
> I have a strange behaviour in an OOBasic program, and to make it 
> simple I pruned down the question to the 12 lines of program which are 
> displayed here :
>
> option explicit
>
> Type ZONEDIALOG
>   hauteur   As Long
>   largeur   As Long
> End Type
>
> Dim ZDstack(0 To 2) As ZONEDIALOG
>
> Function Auto_Open()
>     dim quoi as long
>   quoi = 2  'const_xyz
>   msgbox "OK"
> End Function
>
>
> The strange behaviour is as follows :
>
>   * when executing this program, the message "Ok" comes up as
>     expected, everything is fine and there is no error.
>
>   * However now, consider the constant "2" at line 'quoi = 2' : if you
>     replace this constant "2" by "const_xyz" (which is obviously
>     undefined), observe what happens during thenext executions :
>       o first execution brings up the message "Ok" : the error was not
>         detected, although option explicit is active ... but that is
>         not yet the biggest problem
>       o executing a second time brings up "Basic execution error 9 :
>         index out of the assigned range" at the line 'Dim ZDStack'
>
>   * Now if reverting back to the constant "2" by removing "const_xyz"
>     and putting the constant "2" in place again, it is also abnormal :
>       o first execution shows "Ok"
>       o following executions bring up "Basic execution error 9 : index
>         out of the assigned range" at the line 'Dim ZDStack'
>
>
> There is however a background to this behaviour : this file is issued 
> from a full program showing this problem by removing all the 
> unnecessary functions and sheets out of the program.
> If this small portion of code is copied to a fresh calc file, the 
> strange behaviour does not show up.  Therefore, I suspect the 
> behaviour to be caused by something else than just the code ; this is 
> why I appended the file to this mail, for you to be able to debug.
>
> I compared the sections of the file with the xml sections of a fresh 
> document, and I found differences only in content.xml, settings.xml 
> and  styles.xml, but nothing that could explain me why this behaviour.
>
> If a charitable person could analyse this file, it would help me 
> getting running the full program from which it is issued ... and it 
> would probably expose a new bug in OO.  It won't be an easy job 
> however I believe, therefore I am really thankful in advance !
>
> Lucien
> PS: I tried the file on two versions of OO and one LibreOffice, it 
> does not make any difference.
>

What versions of AOO and LO have you tested on and also what OS?

Thanks,
Carl


---------------------------------------------------------------------
To unsubscribe, e-mail: qa-unsubscribe@openoffice.apache.org
For additional commands, e-mail: qa-help@openoffice.apache.org