Skip to content

Comments

Bug in MemoryData that does not allow using arrays with n_ * size_ > 2^31#1838

Merged
longjon merged 1 commit intoBVLC:devfrom
DmitryUlyanov:dev
Feb 9, 2015
Merged

Bug in MemoryData that does not allow using arrays with n_ * size_ > 2^31#1838
longjon merged 1 commit intoBVLC:devfrom
DmitryUlyanov:dev

Conversation

@DmitryUlyanov
Copy link
Contributor

So the problem is in here:

top[0]->set_cpu_data(data_ + pos_ * size_);

pos_ and size_ are int, so I had segmentation fault due to overflow in there, I think, when using huge array. To overcome this we need to change some variables types, so please comment how you think to do it better since I did the first thing that came to my mind that would fix the crashes I had.

@longjon
Copy link
Contributor

longjon commented Feb 6, 2015

Thanks for the fix; only issue is this should probably be size_t, and please squash your commits into one (git rebase -i and git push -f to this branch). Using int for size_ is still a limitation, but it's a known issue, see discussion at #1584.

@DmitryUlyanov
Copy link
Contributor Author

Done

@longjon
Copy link
Contributor

longjon commented Feb 9, 2015

Thanks!

longjon added a commit that referenced this pull request Feb 9, 2015
Bug in MemoryData that does not allow using arrays with n_ * size_ > 2^31
@longjon longjon merged commit 7efcfe8 into BVLC:dev Feb 9, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants