Re: [AOLSERVER] Crashes with aolserver 4.5

2006-11-05 Thread Agustin Lopez

Thanks for the answer, Zoran!

Reading your post I think of I must find / replace
all the occurrences of

Tcl_SetObjResult(interp, Tcl_NewXXXObj(...));

by

Tcl_ResetResult(interp);
Tcl_SetXXXObj(Tcl_GetObjResult(interp), ...)

in all the code and libraries of aolserver?
(nsd, ns*, xotcl, tdom, ...)
Is it right?

Thanks again,
Agustin

Zoran Vasiljevic wrote:

On 31.10.2006, at 12:28, Agustin Lopez wrote:



Tcl_SetBooleanObj called with shared object


The problem is the construct:

  Tcl_SetXXXObj(Tcl_GetObjResult(interp), ...)

as the Tcl_Obj stored in the interp result
may turn out to be shared under some circumstances.

You must rewrite all those occurrences into
something like:

  Tcl_SetObjResult(interp, Tcl_NewXXXObj(...));

The Tcl-core is being rewritten to remove such
idioms from the code.

Alternatively, you can do:

  Tcl_ResetResult(interp);
  Tcl_SetXXXObj(Tcl_GetObjResult(interp), ...)

Some people advocate for the latter, as being
slightly faster. I could not verify that fact.

This is of course the obvious part. More hidden can
be if there is some memory corruption underway...
But in that case, you must be using some memory
debugging tool to nail it down.

Hope this helps,
Zoran


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to 
<[EMAIL PROTECTED]> with the
body of "SIGNOFF AOLSERVER" in the email message. You can leave the 
Subject: field of your email blank.





--

I am not young enough to know everything
Oscar Wilde

==
|   Jose Agustin Lopez Bueno |
|  E-Mail: [EMAIL PROTECTED]   |
|Home Page: http://www.uv.es/~lopezj/|
|http://www.uv.es/postman/   |
|Tfnos: +34-96-3544310  +34-96-3543129   |
|   Fax: +34-96-3544200  |
| Servicio de Informatica, Univ. de Valencia, Spain  |
==


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to <[EMAIL PROTECTED]> 
with the
body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: 
field of your email blank.


Re: [AOLSERVER] Crashes with aolserver 4.5

2006-11-05 Thread Zoran Vasiljevic

On 05.11.2006, at 01:11, Agustin Lopez wrote:


Thanks for the answer, Zoran!

Reading your post I think of I must find / replace
all the occurrences of

Tcl_SetObjResult(interp, Tcl_NewXXXObj(...));

by

Tcl_ResetResult(interp);
Tcl_SetXXXObj(Tcl_GetObjResult(interp), ...)

in all the code and libraries of aolserver?
(nsd, ns*, xotcl, tdom, ...)
Is it right?



Unfortunately yes. I believe it is better
that you ask the maintainers of the packages
to do that for you, as this would benefit
everyone.

It is not *strictly* necessary to do this
at every occurence. Only at those where you
anticipate that interp result may contain
a shared object. As this is not always
transparent to the casual reader, it is
in the end simpler to do a wholesale change.

Cheers
Zoran


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to <[EMAIL PROTECTED]> 
with the
body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: 
field of your email blank.


Re: [AOLSERVER] Crashes with aolserver 4.5

2006-10-31 Thread Zoran Vasiljevic

On 31.10.2006, at 12:28, Agustin Lopez wrote:



Tcl_SetBooleanObj called with shared object


The problem is the construct:

  Tcl_SetXXXObj(Tcl_GetObjResult(interp), ...)

as the Tcl_Obj stored in the interp result
may turn out to be shared under some circumstances.

You must rewrite all those occurrences into
something like:

  Tcl_SetObjResult(interp, Tcl_NewXXXObj(...));

The Tcl-core is being rewritten to remove such
idioms from the code.

Alternatively, you can do:

  Tcl_ResetResult(interp);
  Tcl_SetXXXObj(Tcl_GetObjResult(interp), ...)

Some people advocate for the latter, as being
slightly faster. I could not verify that fact.

This is of course the obvious part. More hidden can
be if there is some memory corruption underway...
But in that case, you must be using some memory
debugging tool to nail it down.

Hope this helps,
Zoran


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to <[EMAIL PROTECTED]> 
with the
body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: 
field of your email blank.