memory leak in supersonic code

92 views
Skip to first unread message

mahesh kumar behera

unread,
Oct 10, 2014, 5:56:23 AM10/10/14
to supersonic-...@googlegroups.com
Hi,
 
 I have come acrosss some code in sueprsonic which can lead to memory leak in case of exception. is it intetional or is handles in some other way ?
Like in some flow, one function calls another function with some allocated memory assuming the called fucntion will take the ownership of the allocated memory. But in the called function, before assigning the input memmory  to a scoped pointer a "new" is done . If memory is not sufficient, then "new" may throw an exception and the memory passed to the function will leak.
 
Regards
Mahesh

Onufry Wojtaszczyk

unread,
Oct 13, 2014, 2:17:32 AM10/13/14
to mahesh kumar behera, supersonic-...@googlegroups.com
Supersonic in general does not aspire to be exception safe, Piotr - correct me if I'm wrong, but we don't expect to handle exceptions correctly, do we? Obviously, it could probably be fixed, but I don't think doing this is on anybody's priority list right now.

In the case you mentioned, we should switch to passing the memory into the child function by moving a scoped pointer (instead of passing a raw pointer and assigning it to a scoped pointer afterwards), which is a better idiom to use in general; I'd be happy to review such a change proposal. I don't expect anybody on the Supersonic team would have the time to do a major overhaul of the whole codebase to follow such an idiom, though.

Onufry

--
You received this message because you are subscribed to the Google Groups "Supersonic Query Engine Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to supersonic-query-...@googlegroups.com.
To post to this group, send email to supersonic-...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages