Andrew Borley wrote:
On 12/1/06, Jean-Sebastien Delfino <[EMAIL PROTECTED]> wrote:
Andy,

I think that the Python service wrapper sometimes returns data on the
stack, the data allocated by PyValue appears to be valid inside the
wrapper itself but gets out of scope after the wrapper has returned,
causing memory violations or garbage to be returned.

Could you please take a look at my change under revision r481279? I
copied a char* into a new string to workaround the particular case I ran
into, but there's probably a better way to fix this and make sure that
strings returned by the wrapper in general are allocated on the heap
instead of the stack.

Thanks...

--
Jean-Sebastien


Hi Sebastien,

This change looks good, thanks.

It strikes me that we may need some kind of "extension-builder's
library" that can be used to manage data and the conversion of data
and other chunks of code that we are seeing repeated in various places
in the extensions. With something like this, issues such as the one
you found above should be found & fixed earlier. What do people think?

Cheers
Andy

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Andy,

Yes, I completely agree.

The following would help a lot:

1. A utility to navigate an SDO and get the parameters out, whatever form of SDO it is (open, not open, with lists, no lists, with a schema, with no schema at all)

2. A utility to put parameters of an invocation into an SDO, covering all these cases as well

3. Additions to our Operation object and/or additional utility classes to facilitate data handling: -in particular data type conversions, using pieces (1) and (2) above + any other data conversions we've identified,
 - memory allocations and any copies,
 - pass by reference vs pass by value semantics,
- log and debugging code to help track what data flows from where to where, ... and make it clear to the extension developer who allocates / frees the data and when.

I have started to tackle (1) with my "Digging data out of an SDO" earlier thread and should be able to contribute this in a day or two, part (2) may or may not build on (1) later I'm not sure... but you're right that we really need to sort out the bigger part (3), and it sounds like you're volunteering for it? :)

--
Jean-Sebastien


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to