Skip to content

Conversation

typhoonzero
Copy link
Contributor

Fix #2761

Copy link
Contributor

@dzhwinter dzhwinter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 resolve such a difficult bug! Awesome.

var cbuffer unsafe.Pointer
cbuffer = C.malloc(C.size_t(len(p.Content)))
C.memcpy(cbuffer, unsafe.Pointer(&p.Content[0]), C.size_t(len(p.Content)))
C.memcpy(cbuffer, unsafe.Pointer(&p.Content[0]), C.size_t(len(p.Content)/C.sizeof_float))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is so strange that we can pass the go test smoothly.
what's more, C.memcpy copy four times longer buffer than the real length, it never core dump(system call libc's memcpy in low level), and set all the data to 0 as normal.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wired, maybe the test case is not exposing this problem?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, no, we malloc four times memory.......
cbuffer = C.malloc(C.size_t(len(p.Content))), it absolutly will run smoothly because I waste the rest buffer.
weird, by the way. : )

@dzhwinter
Copy link
Contributor

LGTM!
seems that we can merge every module together and try the new feature!

@typhoonzero typhoonzero merged commit bcf9f42 into PaddlePaddle:develop Jul 11, 2017
@typhoonzero typhoonzero deleted the fix_newupdater branch August 11, 2017 06:53
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