[jira] [Commented] (CASSANDRA-8792) Improve Memory assertions

2015-02-17 Thread Jonathan Ellis (JIRA)

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

Jonathan Ellis commented on CASSANDRA-8792:
---

+1

> Improve Memory assertions
> -
>
> Key: CASSANDRA-8792
> URL: https://issues.apache.org/jira/browse/CASSANDRA-8792
> Project: Cassandra
>  Issue Type: Bug
>  Components: Core
>Reporter: Benedict
>Assignee: Benedict
>Priority: Trivial
> Fix For: 2.1.4
>
>
> Null pointers are valid returns if a size of zero is returned. We assume a 
> null pointer implies resource mismanagement in a few places. We also don't 
> properly check the bounds of all of our accesses; this patch attempts to tidy 
> up both of these things.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CASSANDRA-8792) Improve Memory assertions

2015-02-17 Thread Benedict (JIRA)

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

Benedict commented on CASSANDRA-8792:
-

pushed update


> Improve Memory assertions
> -
>
> Key: CASSANDRA-8792
> URL: https://issues.apache.org/jira/browse/CASSANDRA-8792
> Project: Cassandra
>  Issue Type: Bug
>  Components: Core
>Reporter: Benedict
>Assignee: Benedict
>Priority: Trivial
> Fix For: 2.1.4
>
>
> Null pointers are valid returns if a size of zero is returned. We assume a 
> null pointer implies resource mismanagement in a few places. We also don't 
> properly check the bounds of all of our accesses; this patch attempts to tidy 
> up both of these things.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CASSANDRA-8792) Improve Memory assertions

2015-02-17 Thread Benedict (JIRA)

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

Benedict commented on CASSANDRA-8792:
-

Well, I said "probably" - I honestly don't know if it is reasonable for us to 
ever (now or in future) allocate a zero length Memory object. But sure, let's 
go with that.

> Improve Memory assertions
> -
>
> Key: CASSANDRA-8792
> URL: https://issues.apache.org/jira/browse/CASSANDRA-8792
> Project: Cassandra
>  Issue Type: Bug
>  Components: Core
>Reporter: Benedict
>Assignee: Benedict
>Priority: Trivial
> Fix For: 2.1.4
>
>
> Null pointers are valid returns if a size of zero is returned. We assume a 
> null pointer implies resource mismanagement in a few places. We also don't 
> properly check the bounds of all of our accesses; this patch attempts to tidy 
> up both of these things.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CASSANDRA-8792) Improve Memory assertions

2015-02-17 Thread Jonathan Ellis (JIRA)

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

Jonathan Ellis commented on CASSANDRA-8792:
---

My preference would be to assert that callers are using Memory the way we 
expect, rather than make sure we can handle cases that "shouldn't happen."  
Let's go with that if it works for you.

> Improve Memory assertions
> -
>
> Key: CASSANDRA-8792
> URL: https://issues.apache.org/jira/browse/CASSANDRA-8792
> Project: Cassandra
>  Issue Type: Bug
>  Components: Core
>Reporter: Benedict
>Assignee: Benedict
>Priority: Trivial
> Fix For: 2.1.4
>
>
> Null pointers are valid returns if a size of zero is returned. We assume a 
> null pointer implies resource mismanagement in a few places. We also don't 
> properly check the bounds of all of our accesses; this patch attempts to tidy 
> up both of these things.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CASSANDRA-8792) Improve Memory assertions

2015-02-17 Thread Benedict (JIRA)

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

Benedict commented on CASSANDRA-8792:
-

Whichever way that decision goes, it would also be great to get the improved 
checkBounds() assertions in. Should I split that into a separate patch, or can 
we reach a quick decision about both of these small changes?

> Improve Memory assertions
> -
>
> Key: CASSANDRA-8792
> URL: https://issues.apache.org/jira/browse/CASSANDRA-8792
> Project: Cassandra
>  Issue Type: Bug
>  Components: Core
>Reporter: Benedict
>Assignee: Benedict
>Priority: Trivial
> Fix For: 2.1.4
>
>
> Null pointers are valid returns if a size of zero is returned. We assume a 
> null pointer implies resource mismanagement in a few places. We also don't 
> properly check the bounds of all of our accesses; this patch attempts to tidy 
> up both of these things.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CASSANDRA-8792) Improve Memory assertions

2015-02-12 Thread Benedict (JIRA)

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

Benedict commented on CASSANDRA-8792:
-

I would prefer the caller to enforce this where necessary, since there's no 
good reason to absolutely refuse an empty memory object, so we may 
unnecessarily break something. If we in future have to relax it, we also run 
the risk of doing so inconsistently and relying on the assumption elsewhere.

I don't feel too strongly one way or the other though.

> Improve Memory assertions
> -
>
> Key: CASSANDRA-8792
> URL: https://issues.apache.org/jira/browse/CASSANDRA-8792
> Project: Cassandra
>  Issue Type: Bug
>  Components: Core
>Reporter: Benedict
>Assignee: Benedict
>Priority: Trivial
> Fix For: 2.1.4
>
>
> Null pointers are valid returns if a size of zero is returned. We assume a 
> null pointer implies resource mismanagement in a few places. We also don't 
> properly check the bounds of all of our accesses; this patch attempts to tidy 
> up both of these things.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CASSANDRA-8792) Improve Memory assertions

2015-02-12 Thread Jonathan Ellis (JIRA)

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

Jonathan Ellis commented on CASSANDRA-8792:
---

wouldn't it be simpler to assert in the allocation then?

> Improve Memory assertions
> -
>
> Key: CASSANDRA-8792
> URL: https://issues.apache.org/jira/browse/CASSANDRA-8792
> Project: Cassandra
>  Issue Type: Bug
>  Components: Core
>Reporter: Benedict
>Assignee: Benedict
>Priority: Trivial
> Fix For: 2.1.4
>
>
> Null pointers are valid returns if a size of zero is returned. We assume a 
> null pointer implies resource mismanagement in a few places. We also don't 
> properly check the bounds of all of our accesses; this patch attempts to tidy 
> up both of these things.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CASSANDRA-8792) Improve Memory assertions

2015-02-12 Thread Benedict (JIRA)

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

Benedict commented on CASSANDRA-8792:
-

Probably only in error. But an incorrect error message wouldn't help diagnose 
this.

> Improve Memory assertions
> -
>
> Key: CASSANDRA-8792
> URL: https://issues.apache.org/jira/browse/CASSANDRA-8792
> Project: Cassandra
>  Issue Type: Bug
>  Components: Core
>Reporter: Benedict
>Assignee: Benedict
>Priority: Trivial
> Fix For: 2.1.4
>
>
> Null pointers are valid returns if a size of zero is returned. We assume a 
> null pointer implies resource mismanagement in a few places. We also don't 
> properly check the bounds of all of our accesses; this patch attempts to tidy 
> up both of these things.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CASSANDRA-8792) Improve Memory assertions

2015-02-12 Thread Jonathan Ellis (JIRA)

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

Jonathan Ellis commented on CASSANDRA-8792:
---

Why are we allocating zero-size objects?

> Improve Memory assertions
> -
>
> Key: CASSANDRA-8792
> URL: https://issues.apache.org/jira/browse/CASSANDRA-8792
> Project: Cassandra
>  Issue Type: Bug
>  Components: Core
>Reporter: Benedict
>Assignee: Benedict
>Priority: Trivial
> Fix For: 2.1.4
>
>
> Null pointers are valid returns if a size of zero is returned. We assume a 
> null pointer implies resource mismanagement in a few places. We also don't 
> properly check the bounds of all of our accesses; this patch attempts to tidy 
> up both of these things.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CASSANDRA-8792) Improve Memory assertions

2015-02-12 Thread Benedict (JIRA)

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

Benedict commented on CASSANDRA-8792:
-

Patch available [here|http://github.com/belliottsmith/cassandra/tree/8792]

> Improve Memory assertions
> -
>
> Key: CASSANDRA-8792
> URL: https://issues.apache.org/jira/browse/CASSANDRA-8792
> Project: Cassandra
>  Issue Type: Bug
>  Components: Core
>Reporter: Benedict
>Assignee: Benedict
>Priority: Trivial
> Fix For: 2.1.4
>
>
> Null pointers are valid returns if a size of zero is returned. We assume a 
> null pointer implies resource mismanagement in a few places. We also don't 
> properly check the bounds of all of our accesses; this patch attempts to tidy 
> up both of these things.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)