[ 
https://issues.apache.org/jira/browse/ARROW-2601?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16479090#comment-16479090
 ] 

Antoine Pitrou commented on ARROW-2601:
---------------------------------------

Uh... Calling the {{MemoryPool}} constructor creates an invalid MemoryPool 
object. It's surprising that {{pa.array}} accepts it silently and doesn't crash.

I suppose {{MemoryPool.bytes_allocated()}} should check for the pointer being 
null and raise ValueError in that case. This is already done in other places 
(see e.g. {{Tensor._validate()}}).

> [Python] MemoryPool bytes_allocated causes seg
> ----------------------------------------------
>
>                 Key: ARROW-2601
>                 URL: https://issues.apache.org/jira/browse/ARROW-2601
>             Project: Apache Arrow
>          Issue Type: Bug
>    Affects Versions: 0.9.0
>            Reporter: Alex Hagerman
>            Priority: Minor
>             Fix For: 0.10.0
>
>
> Python 3.6.5 |Anaconda, Inc.| (default, Mar 29 2018, 18:21:58) 
> [GCC 7.2.0] on linux
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import pyarrow as pa
> >>> mp = pa.MemoryPool()
> >>> arr = pa.array([1,2,3], memory_pool=mp)
> >>> mp.bytes_allocated()
> Segmentation fault (core dumped)
> I'll dig into this further, but should bytes_alloacted be returning anything 
> when called like this? Or should it raise NotImplemented?



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to