You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mesos.apache.org by Niklas Nielsen <ni...@qni.dk> on 2013/11/08 22:41:42 UTC

Review Request 15368: Fix string leaks in os.hpp

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/15368/
-----------------------------------------------------------

Review request for mesos, Benjamin Hindman, Ben Mahler, and Vinod Kone.


Repository: mesos-git


Description
-------

Took valgrind for a spin and located a couple of leaks in os.hpp.
delete[] should be used instead of delete when new[] is used.

I1108 21:00:24.704984 11918 slave.cpp:560] Checkpointing SlaveInfo to '/tmp/mesos/0/meta/slaves/201311082100-2517376940-5050-11890-0/slave.info'
==11890== Thread 5:
==11890== Mismatched free() / delete / delete []
==11890==    at 0x4C2BADC: operator delete(void*) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==11890==    by 0x524D54B: os::dirname(std::string const&) (os.hpp:359)
==11890==    by 0x52417F3: mesos::internal::slave::state::checkpoint(std::string const&, google::protobuf::Message const&) (state.cpp:620)
==11890==    by 0x5260589: mesos::internal::slave::Slave::registered(process::UPID const&, mesos::SlaveID const&) (slave.cpp:561)
...
==11890==  Address 0xc47b5b0 is 0 bytes inside a block of size 73 alloc'd
==11890==    at 0x4C2AFE7: operator new[](unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==11890==    by 0x524D50F: os::dirname(std::string const&) (os.hpp:351)
==11890==    by 0x52417F3: mesos::internal::slave::state::checkpoint(std::string const&, google::protobuf::Message const&) (state.cpp:620)
==11890==    by 0x5260589: mesos::internal::slave::Slave::registered(process::UPID const&, mesos::SlaveID const&) (slave.cpp:561)
...


Diffs
-----

  3rdparty/libprocess/3rdparty/stout/include/stout/os.hpp 18d8b7f 

Diff: https://reviews.apache.org/r/15368/diff/


Testing
-------

Running mesos-local with valgrind before and after fix.

make check


Thanks,

Niklas Nielsen


Re: Review Request 15368: Fix string leaks in os.hpp

Posted by Vinod Kone <vi...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/15368/#review28579
-----------------------------------------------------------

Ship it!


Ship It!

- Vinod Kone


On Nov. 8, 2013, 9:41 p.m., Niklas Nielsen wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/15368/
> -----------------------------------------------------------
> 
> (Updated Nov. 8, 2013, 9:41 p.m.)
> 
> 
> Review request for mesos, Benjamin Hindman, Ben Mahler, and Vinod Kone.
> 
> 
> Repository: mesos-git
> 
> 
> Description
> -------
> 
> Took valgrind for a spin and located a couple of leaks in os.hpp.
> delete[] should be used instead of delete when new[] is used.
> 
> I1108 21:00:24.704984 11918 slave.cpp:560] Checkpointing SlaveInfo to '/tmp/mesos/0/meta/slaves/201311082100-2517376940-5050-11890-0/slave.info'
> ==11890== Thread 5:
> ==11890== Mismatched free() / delete / delete []
> ==11890==    at 0x4C2BADC: operator delete(void*) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
> ==11890==    by 0x524D54B: os::dirname(std::string const&) (os.hpp:359)
> ==11890==    by 0x52417F3: mesos::internal::slave::state::checkpoint(std::string const&, google::protobuf::Message const&) (state.cpp:620)
> ==11890==    by 0x5260589: mesos::internal::slave::Slave::registered(process::UPID const&, mesos::SlaveID const&) (slave.cpp:561)
> ...
> ==11890==  Address 0xc47b5b0 is 0 bytes inside a block of size 73 alloc'd
> ==11890==    at 0x4C2AFE7: operator new[](unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
> ==11890==    by 0x524D50F: os::dirname(std::string const&) (os.hpp:351)
> ==11890==    by 0x52417F3: mesos::internal::slave::state::checkpoint(std::string const&, google::protobuf::Message const&) (state.cpp:620)
> ==11890==    by 0x5260589: mesos::internal::slave::Slave::registered(process::UPID const&, mesos::SlaveID const&) (slave.cpp:561)
> ...
> 
> 
> Diffs
> -----
> 
>   3rdparty/libprocess/3rdparty/stout/include/stout/os.hpp 18d8b7f 
> 
> Diff: https://reviews.apache.org/r/15368/diff/
> 
> 
> Testing
> -------
> 
> Running mesos-local with valgrind before and after fix.
> 
> make check
> 
> 
> Thanks,
> 
> Niklas Nielsen
> 
>


Re: Review Request 15368: Fix string leaks in os.hpp

Posted by Vinod Kone <vi...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/15368/#review28881
-----------------------------------------------------------


committed. please mark it as submitted.

- Vinod Kone


On Nov. 8, 2013, 9:41 p.m., Niklas Nielsen wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/15368/
> -----------------------------------------------------------
> 
> (Updated Nov. 8, 2013, 9:41 p.m.)
> 
> 
> Review request for mesos, Benjamin Hindman, Ben Mahler, and Vinod Kone.
> 
> 
> Repository: mesos-git
> 
> 
> Description
> -------
> 
> Took valgrind for a spin and located a couple of leaks in os.hpp.
> delete[] should be used instead of delete when new[] is used.
> 
> I1108 21:00:24.704984 11918 slave.cpp:560] Checkpointing SlaveInfo to '/tmp/mesos/0/meta/slaves/201311082100-2517376940-5050-11890-0/slave.info'
> ==11890== Thread 5:
> ==11890== Mismatched free() / delete / delete []
> ==11890==    at 0x4C2BADC: operator delete(void*) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
> ==11890==    by 0x524D54B: os::dirname(std::string const&) (os.hpp:359)
> ==11890==    by 0x52417F3: mesos::internal::slave::state::checkpoint(std::string const&, google::protobuf::Message const&) (state.cpp:620)
> ==11890==    by 0x5260589: mesos::internal::slave::Slave::registered(process::UPID const&, mesos::SlaveID const&) (slave.cpp:561)
> ...
> ==11890==  Address 0xc47b5b0 is 0 bytes inside a block of size 73 alloc'd
> ==11890==    at 0x4C2AFE7: operator new[](unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
> ==11890==    by 0x524D50F: os::dirname(std::string const&) (os.hpp:351)
> ==11890==    by 0x52417F3: mesos::internal::slave::state::checkpoint(std::string const&, google::protobuf::Message const&) (state.cpp:620)
> ==11890==    by 0x5260589: mesos::internal::slave::Slave::registered(process::UPID const&, mesos::SlaveID const&) (slave.cpp:561)
> ...
> 
> 
> Diffs
> -----
> 
>   3rdparty/libprocess/3rdparty/stout/include/stout/os.hpp 18d8b7f 
> 
> Diff: https://reviews.apache.org/r/15368/diff/
> 
> 
> Testing
> -------
> 
> Running mesos-local with valgrind before and after fix.
> 
> make check
> 
> 
> Thanks,
> 
> Niklas Nielsen
> 
>


Re: Review Request 15368: Fix string leaks in os.hpp

Posted by Niklas Nielsen <ni...@qni.dk>.

> On Nov. 8, 2013, 9:44 p.m., Ben Mahler wrote:
> > Sign up on scan.coverity.com and request to join the mesos project for more interesting static analysis results!

Awesome! done


- Niklas


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/15368/#review28580
-----------------------------------------------------------


On Nov. 8, 2013, 9:41 p.m., Niklas Nielsen wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/15368/
> -----------------------------------------------------------
> 
> (Updated Nov. 8, 2013, 9:41 p.m.)
> 
> 
> Review request for mesos, Benjamin Hindman, Ben Mahler, and Vinod Kone.
> 
> 
> Repository: mesos-git
> 
> 
> Description
> -------
> 
> Took valgrind for a spin and located a couple of leaks in os.hpp.
> delete[] should be used instead of delete when new[] is used.
> 
> I1108 21:00:24.704984 11918 slave.cpp:560] Checkpointing SlaveInfo to '/tmp/mesos/0/meta/slaves/201311082100-2517376940-5050-11890-0/slave.info'
> ==11890== Thread 5:
> ==11890== Mismatched free() / delete / delete []
> ==11890==    at 0x4C2BADC: operator delete(void*) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
> ==11890==    by 0x524D54B: os::dirname(std::string const&) (os.hpp:359)
> ==11890==    by 0x52417F3: mesos::internal::slave::state::checkpoint(std::string const&, google::protobuf::Message const&) (state.cpp:620)
> ==11890==    by 0x5260589: mesos::internal::slave::Slave::registered(process::UPID const&, mesos::SlaveID const&) (slave.cpp:561)
> ...
> ==11890==  Address 0xc47b5b0 is 0 bytes inside a block of size 73 alloc'd
> ==11890==    at 0x4C2AFE7: operator new[](unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
> ==11890==    by 0x524D50F: os::dirname(std::string const&) (os.hpp:351)
> ==11890==    by 0x52417F3: mesos::internal::slave::state::checkpoint(std::string const&, google::protobuf::Message const&) (state.cpp:620)
> ==11890==    by 0x5260589: mesos::internal::slave::Slave::registered(process::UPID const&, mesos::SlaveID const&) (slave.cpp:561)
> ...
> 
> 
> Diffs
> -----
> 
>   3rdparty/libprocess/3rdparty/stout/include/stout/os.hpp 18d8b7f 
> 
> Diff: https://reviews.apache.org/r/15368/diff/
> 
> 
> Testing
> -------
> 
> Running mesos-local with valgrind before and after fix.
> 
> make check
> 
> 
> Thanks,
> 
> Niklas Nielsen
> 
>


Re: Review Request 15368: Fix string leaks in os.hpp

Posted by Ben Mahler <be...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/15368/#review28580
-----------------------------------------------------------

Ship it!


Sign up on scan.coverity.com and request to join the mesos project for more interesting static analysis results!

- Ben Mahler


On Nov. 8, 2013, 9:41 p.m., Niklas Nielsen wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/15368/
> -----------------------------------------------------------
> 
> (Updated Nov. 8, 2013, 9:41 p.m.)
> 
> 
> Review request for mesos, Benjamin Hindman, Ben Mahler, and Vinod Kone.
> 
> 
> Repository: mesos-git
> 
> 
> Description
> -------
> 
> Took valgrind for a spin and located a couple of leaks in os.hpp.
> delete[] should be used instead of delete when new[] is used.
> 
> I1108 21:00:24.704984 11918 slave.cpp:560] Checkpointing SlaveInfo to '/tmp/mesos/0/meta/slaves/201311082100-2517376940-5050-11890-0/slave.info'
> ==11890== Thread 5:
> ==11890== Mismatched free() / delete / delete []
> ==11890==    at 0x4C2BADC: operator delete(void*) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
> ==11890==    by 0x524D54B: os::dirname(std::string const&) (os.hpp:359)
> ==11890==    by 0x52417F3: mesos::internal::slave::state::checkpoint(std::string const&, google::protobuf::Message const&) (state.cpp:620)
> ==11890==    by 0x5260589: mesos::internal::slave::Slave::registered(process::UPID const&, mesos::SlaveID const&) (slave.cpp:561)
> ...
> ==11890==  Address 0xc47b5b0 is 0 bytes inside a block of size 73 alloc'd
> ==11890==    at 0x4C2AFE7: operator new[](unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
> ==11890==    by 0x524D50F: os::dirname(std::string const&) (os.hpp:351)
> ==11890==    by 0x52417F3: mesos::internal::slave::state::checkpoint(std::string const&, google::protobuf::Message const&) (state.cpp:620)
> ==11890==    by 0x5260589: mesos::internal::slave::Slave::registered(process::UPID const&, mesos::SlaveID const&) (slave.cpp:561)
> ...
> 
> 
> Diffs
> -----
> 
>   3rdparty/libprocess/3rdparty/stout/include/stout/os.hpp 18d8b7f 
> 
> Diff: https://reviews.apache.org/r/15368/diff/
> 
> 
> Testing
> -------
> 
> Running mesos-local with valgrind before and after fix.
> 
> make check
> 
> 
> Thanks,
> 
> Niklas Nielsen
> 
>