You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mesos.apache.org by Vinit Mahedia <vi...@gmail.com> on 2016/06/02 16:30:46 UTC

Documentation about debugging mesos-master : newbie

I have been trying to debug mesos-master using gdb-mesos-master.sh although
it does not load symbols or sources. I tried to set those paths as well but
since it thinks mesos-master, libtool script, is the main binary.

I just want to set the dev environment and try to fix a very stupid bug to
learn the work flow of test/debug/commit.

If I can get it working, I can help to write if such documentation does not
exist. I also tried to set it up on eclipse CDT but it can't handle libtool
scripts.

Thank you.

Re: Documentation about debugging mesos-master : newbie

Posted by Vinit Mahedia <vi...@gmail.com>.
I tried that I am getting a linking error; I guess it just does not like me
or it's not my day.
There's a psychic across the road, I think he may earn some money today.

libtool: link: `slave/libmesos_no_3rdparty_la-validation.lo' is not a valid
libtool object


Anyway, just to give you a bit more context. I was trying kafka framework
on mesos, which
was unable to register itself with mesos, so I tried tcpdump and saw the
request was getting to master
properly but master's log did not show "attempt" to register or anything. I
did try with curl HTTP API and that
works from command line but I think that API is different from what I see
in called by kafka framework.


POST /master/mesos.scheduler.Call HTTP/1.1\r\n
User-Agent: libprocess/
scheduler-8c5bd8cc-1d7b-4c2c-9de3-6daa8c173e9e@10.10.17.41:46484\r\n
Libprocess-From:
scheduler-8c5bd8cc-1d7b-4c2c-9de3-6daa8c173e9e@10.10.17.41:46484\r\n
Connection: Keep-Alive\r\nHost: \r\n
Transfer-Encoding: chunked\r\n
\r\n2d\r\n\20\1\32)\n'\n\4root\22\5kafka!\0\0\0\0\200\306CA(\0012\1*:\ndevmesos101\r\n0\r\n\r\n


I have been putting off setting up this environment to get involved in
mesos community, this issue
just gave me a little push that I needed. Anyway, don't worry if this kafka
related stuff does not make
much sense. Since I am already deep into the problem, I might have missed
all the details to provide
complete context.

On Thu, Jun 2, 2016 at 3:55 PM, Gilbert Song <gi...@mesosphere.io> wrote:

> For dev, I would strongly recommend using linux os (e.g., ubuntu14.04,
> 15.10, centos7.1, etc.). Because features are very limited in os x, most
> of features like using containers, cgroup isolation etc. you will need a
> linux environment.
>
> PS: using a vagrant box may be convenient to setup env on your os x.
>
> Gilbert
>
> On Thu, Jun 2, 2016 at 12:24 PM, Vinit Mahedia <vi...@gmail.com>
> wrote:
>
> > I tried that, it did not help either, same error. What do you use for dev
> > OS, IDE etc.
> > Do you think switching on ubuntu should help? I will try that anyway. I
> am
> > out of
> > ideas at this point if switching OS does not work either.
> >
> > gdb) b master.cpp:2481
> > Cannot access memory at address 0x714d40
> >
> >
> > On Thu, Jun 2, 2016 at 1:56 PM, Gilbert Song <gi...@mesosphere.io>
> > wrote:
> >
> > > Vinit,
> > >
> > > Seems like your question is similar to this one:
> > >
> > >
> >
> https://mail-archives.apache.org/mod_mbox/mesos-dev/201507.mbox/%3CCAOs_uxyyeJNF+CtceOd7zZabSMJTneC=YyQcpWbZ-GJyESp9Qg@mail.gmail.com%3E
> > >
> > > Could you verify if James' reply would help for your case?
> > >
> > >
> >
> https://mail-archives.apache.org/mod_mbox/mesos-dev/201507.mbox/%3C7155F7CF-DB57-4202-BC97-62E6DCFE14AB@gmail.com%3E
> > >
> > > Gilbert
> > >
> > > On Thu, Jun 2, 2016 at 11:24 AM, Vinit Mahedia <vinitmahedia@gmail.com
> >
> > > wrote:
> > >
> > > > Hi Gilbert,
> > > >
> > > > Thank you for replying.
> > > >
> > > > Yes, I did that.
> > > >
> > > >
> > > >    1.  ./configure --enable-debug --disable-java --disable-python
> > > >    2.  make
> > > >    3. ./bin/gdb-mesos-master.sh --ip=127.0.0.1 --work_dir=.
> > > >
> > > > Although even after setting source directory, I can not set
> breakpoint
> > I
> > > > get warning like this
> > > >
> > > > (gdb) break master.cpp:2481
> > > > Cannot access memory at address 0x714d40
> > > >
> > > >
> > > > I also tried few things, passing "static" flag to libtool, passing
> > > >  "--enable-static"
> > > >
> > > > Although I got linker error, where I saw libtool was not using
> --static
> > > > flag and I do
> > > > not know if doing that will fix it. I forgot to mention that am
> > building
> > > > this on Mac OS.
> > > >
> > > > Thank you.
> > > >
> > > >
> > > >
> > > > On Thu, Jun 2, 2016 at 12:33 PM, Gilbert Song <gilbert@mesosphere.io
> >
> > > > wrote:
> > > >
> > > > > Hi Vinit,
> > > > >
> > > > > Did you configure with debug mode (e.g., ../confugure
> > --enable-debug)?
> > > > >
> > > > > Assuming you have the gdb installed, you should be able to debug
> > mesos
> > > > > master
> > > > > in gbd:
> > > > >
> > > > > ./bin/gdb-mesos-master.sh --ip=127.0.0.1 --work_dir=/var/lib/mesos
> > > > >
> > > > >
> > > > > Gilbert
> > > > >
> > > > > On Thu, Jun 2, 2016 at 9:30 AM, Vinit Mahedia <
> > vinitmahedia@gmail.com>
> > > > > wrote:
> > > > >
> > > > > > I have been trying to debug mesos-master using
> gdb-mesos-master.sh
> > > > > although
> > > > > > it does not load symbols or sources. I tried to set those paths
> as
> > > well
> > > > > but
> > > > > > since it thinks mesos-master, libtool script, is the main binary.
> > > > > >
> > > > > > I just want to set the dev environment and try to fix a very
> stupid
> > > bug
> > > > > to
> > > > > > learn the work flow of test/debug/commit.
> > > > > >
> > > > > > If I can get it working, I can help to write if such
> documentation
> > > does
> > > > > not
> > > > > > exist. I also tried to set it up on eclipse CDT but it can't
> handle
> > > > > libtool
> > > > > > scripts.
> > > > > >
> > > > > > Thank you.
> > > > > >
> > > > >
> > > >
> > >
> >
>

Re: Documentation about debugging mesos-master : newbie

Posted by Gilbert Song <gi...@mesosphere.io>.
For dev, I would strongly recommend using linux os (e.g., ubuntu14.04,
15.10, centos7.1, etc.). Because features are very limited in os x, most
of features like using containers, cgroup isolation etc. you will need a
linux environment.

PS: using a vagrant box may be convenient to setup env on your os x.

Gilbert

On Thu, Jun 2, 2016 at 12:24 PM, Vinit Mahedia <vi...@gmail.com>
wrote:

> I tried that, it did not help either, same error. What do you use for dev
> OS, IDE etc.
> Do you think switching on ubuntu should help? I will try that anyway. I am
> out of
> ideas at this point if switching OS does not work either.
>
> gdb) b master.cpp:2481
> Cannot access memory at address 0x714d40
>
>
> On Thu, Jun 2, 2016 at 1:56 PM, Gilbert Song <gi...@mesosphere.io>
> wrote:
>
> > Vinit,
> >
> > Seems like your question is similar to this one:
> >
> >
> https://mail-archives.apache.org/mod_mbox/mesos-dev/201507.mbox/%3CCAOs_uxyyeJNF+CtceOd7zZabSMJTneC=YyQcpWbZ-GJyESp9Qg@mail.gmail.com%3E
> >
> > Could you verify if James' reply would help for your case?
> >
> >
> https://mail-archives.apache.org/mod_mbox/mesos-dev/201507.mbox/%3C7155F7CF-DB57-4202-BC97-62E6DCFE14AB@gmail.com%3E
> >
> > Gilbert
> >
> > On Thu, Jun 2, 2016 at 11:24 AM, Vinit Mahedia <vi...@gmail.com>
> > wrote:
> >
> > > Hi Gilbert,
> > >
> > > Thank you for replying.
> > >
> > > Yes, I did that.
> > >
> > >
> > >    1.  ./configure --enable-debug --disable-java --disable-python
> > >    2.  make
> > >    3. ./bin/gdb-mesos-master.sh --ip=127.0.0.1 --work_dir=.
> > >
> > > Although even after setting source directory, I can not set breakpoint
> I
> > > get warning like this
> > >
> > > (gdb) break master.cpp:2481
> > > Cannot access memory at address 0x714d40
> > >
> > >
> > > I also tried few things, passing "static" flag to libtool, passing
> > >  "--enable-static"
> > >
> > > Although I got linker error, where I saw libtool was not using --static
> > > flag and I do
> > > not know if doing that will fix it. I forgot to mention that am
> building
> > > this on Mac OS.
> > >
> > > Thank you.
> > >
> > >
> > >
> > > On Thu, Jun 2, 2016 at 12:33 PM, Gilbert Song <gi...@mesosphere.io>
> > > wrote:
> > >
> > > > Hi Vinit,
> > > >
> > > > Did you configure with debug mode (e.g., ../confugure
> --enable-debug)?
> > > >
> > > > Assuming you have the gdb installed, you should be able to debug
> mesos
> > > > master
> > > > in gbd:
> > > >
> > > > ./bin/gdb-mesos-master.sh --ip=127.0.0.1 --work_dir=/var/lib/mesos
> > > >
> > > >
> > > > Gilbert
> > > >
> > > > On Thu, Jun 2, 2016 at 9:30 AM, Vinit Mahedia <
> vinitmahedia@gmail.com>
> > > > wrote:
> > > >
> > > > > I have been trying to debug mesos-master using gdb-mesos-master.sh
> > > > although
> > > > > it does not load symbols or sources. I tried to set those paths as
> > well
> > > > but
> > > > > since it thinks mesos-master, libtool script, is the main binary.
> > > > >
> > > > > I just want to set the dev environment and try to fix a very stupid
> > bug
> > > > to
> > > > > learn the work flow of test/debug/commit.
> > > > >
> > > > > If I can get it working, I can help to write if such documentation
> > does
> > > > not
> > > > > exist. I also tried to set it up on eclipse CDT but it can't handle
> > > > libtool
> > > > > scripts.
> > > > >
> > > > > Thank you.
> > > > >
> > > >
> > >
> >
>

Re: Documentation about debugging mesos-master : newbie

Posted by Vinit Mahedia <vi...@gmail.com>.
I tried that, it did not help either, same error. What do you use for dev
OS, IDE etc.
Do you think switching on ubuntu should help? I will try that anyway. I am
out of
ideas at this point if switching OS does not work either.

gdb) b master.cpp:2481
Cannot access memory at address 0x714d40


On Thu, Jun 2, 2016 at 1:56 PM, Gilbert Song <gi...@mesosphere.io> wrote:

> Vinit,
>
> Seems like your question is similar to this one:
>
> https://mail-archives.apache.org/mod_mbox/mesos-dev/201507.mbox/%3CCAOs_uxyyeJNF+CtceOd7zZabSMJTneC=YyQcpWbZ-GJyESp9Qg@mail.gmail.com%3E
>
> Could you verify if James' reply would help for your case?
>
> https://mail-archives.apache.org/mod_mbox/mesos-dev/201507.mbox/%3C7155F7CF-DB57-4202-BC97-62E6DCFE14AB@gmail.com%3E
>
> Gilbert
>
> On Thu, Jun 2, 2016 at 11:24 AM, Vinit Mahedia <vi...@gmail.com>
> wrote:
>
> > Hi Gilbert,
> >
> > Thank you for replying.
> >
> > Yes, I did that.
> >
> >
> >    1.  ./configure --enable-debug --disable-java --disable-python
> >    2.  make
> >    3. ./bin/gdb-mesos-master.sh --ip=127.0.0.1 --work_dir=.
> >
> > Although even after setting source directory, I can not set breakpoint I
> > get warning like this
> >
> > (gdb) break master.cpp:2481
> > Cannot access memory at address 0x714d40
> >
> >
> > I also tried few things, passing "static" flag to libtool, passing
> >  "--enable-static"
> >
> > Although I got linker error, where I saw libtool was not using --static
> > flag and I do
> > not know if doing that will fix it. I forgot to mention that am building
> > this on Mac OS.
> >
> > Thank you.
> >
> >
> >
> > On Thu, Jun 2, 2016 at 12:33 PM, Gilbert Song <gi...@mesosphere.io>
> > wrote:
> >
> > > Hi Vinit,
> > >
> > > Did you configure with debug mode (e.g., ../confugure --enable-debug)?
> > >
> > > Assuming you have the gdb installed, you should be able to debug mesos
> > > master
> > > in gbd:
> > >
> > > ./bin/gdb-mesos-master.sh --ip=127.0.0.1 --work_dir=/var/lib/mesos
> > >
> > >
> > > Gilbert
> > >
> > > On Thu, Jun 2, 2016 at 9:30 AM, Vinit Mahedia <vi...@gmail.com>
> > > wrote:
> > >
> > > > I have been trying to debug mesos-master using gdb-mesos-master.sh
> > > although
> > > > it does not load symbols or sources. I tried to set those paths as
> well
> > > but
> > > > since it thinks mesos-master, libtool script, is the main binary.
> > > >
> > > > I just want to set the dev environment and try to fix a very stupid
> bug
> > > to
> > > > learn the work flow of test/debug/commit.
> > > >
> > > > If I can get it working, I can help to write if such documentation
> does
> > > not
> > > > exist. I also tried to set it up on eclipse CDT but it can't handle
> > > libtool
> > > > scripts.
> > > >
> > > > Thank you.
> > > >
> > >
> >
>

Re: Documentation about debugging mesos-master : newbie

Posted by Gilbert Song <gi...@mesosphere.io>.
Vinit,

Seems like your question is similar to this one:
https://mail-archives.apache.org/mod_mbox/mesos-dev/201507.mbox/%3CCAOs_uxyyeJNF+CtceOd7zZabSMJTneC=YyQcpWbZ-GJyESp9Qg@mail.gmail.com%3E

Could you verify if James' reply would help for your case?
https://mail-archives.apache.org/mod_mbox/mesos-dev/201507.mbox/%3C7155F7CF-DB57-4202-BC97-62E6DCFE14AB@gmail.com%3E

Gilbert

On Thu, Jun 2, 2016 at 11:24 AM, Vinit Mahedia <vi...@gmail.com>
wrote:

> Hi Gilbert,
>
> Thank you for replying.
>
> Yes, I did that.
>
>
>    1.  ./configure --enable-debug --disable-java --disable-python
>    2.  make
>    3. ./bin/gdb-mesos-master.sh --ip=127.0.0.1 --work_dir=.
>
> Although even after setting source directory, I can not set breakpoint I
> get warning like this
>
> (gdb) break master.cpp:2481
> Cannot access memory at address 0x714d40
>
>
> I also tried few things, passing "static" flag to libtool, passing
>  "--enable-static"
>
> Although I got linker error, where I saw libtool was not using --static
> flag and I do
> not know if doing that will fix it. I forgot to mention that am building
> this on Mac OS.
>
> Thank you.
>
>
>
> On Thu, Jun 2, 2016 at 12:33 PM, Gilbert Song <gi...@mesosphere.io>
> wrote:
>
> > Hi Vinit,
> >
> > Did you configure with debug mode (e.g., ../confugure --enable-debug)?
> >
> > Assuming you have the gdb installed, you should be able to debug mesos
> > master
> > in gbd:
> >
> > ./bin/gdb-mesos-master.sh --ip=127.0.0.1 --work_dir=/var/lib/mesos
> >
> >
> > Gilbert
> >
> > On Thu, Jun 2, 2016 at 9:30 AM, Vinit Mahedia <vi...@gmail.com>
> > wrote:
> >
> > > I have been trying to debug mesos-master using gdb-mesos-master.sh
> > although
> > > it does not load symbols or sources. I tried to set those paths as well
> > but
> > > since it thinks mesos-master, libtool script, is the main binary.
> > >
> > > I just want to set the dev environment and try to fix a very stupid bug
> > to
> > > learn the work flow of test/debug/commit.
> > >
> > > If I can get it working, I can help to write if such documentation does
> > not
> > > exist. I also tried to set it up on eclipse CDT but it can't handle
> > libtool
> > > scripts.
> > >
> > > Thank you.
> > >
> >
>

Re: Documentation about debugging mesos-master : newbie

Posted by Vinit Mahedia <vi...@gmail.com>.
To close the loop on this - I got it working with a fresh vagrant vm.
Earlier
I was trying on a vm which I was using for other things.

Thank you *Gilbert* and others for your time and help :-)

Revived an old thread for kafka issue, refer to that if you are interested.

On Fri, Jun 3, 2016 at 2:21 PM, Vinit Mahedia <vi...@gmail.com>
wrote:

> Guangya -
>
> I just checked that. I am using v7.10 which has the fix for that issue. I
> also tried to
> build it on ubuntu(vagrant machine) 14.04, how Gilbert and others are
> doing it, but
> there I got this linking error so I think here I might have to work out
> some issues as
> there are already others who have it functioning unlike Mac OS:
>
>
> Error on ubuntu :"make"(during link phase)
>
> libtool: link: `slave/libmesos_no_3rdparty_la-validation.lo' is not a
> valid libtool object
>
>
> Brenno -
>
> That is the reason I tried to build the whole thing as static by passing
> --enable-static
> flag, altough that did not work either. With default setting, shared
> library, it gives that
> infamous error of "memory address not accessible". The only place where I
> could set
> break point was "main" which I believe was due to GTEST macro. Now, I am
> ditching the
> setup on mac os and trying to get it working on ubuntu like others here.
>
> About the issue I am facing with Kafka, I found this thread where someone
> else is running into
> same issue as me, registering the framework. So I will be replying to
> that.Here it is -
> mesos/kafka framework registration issue
> <https://mail-archives.apache.org/mod_mbox/mesos-user/201604.mbox/%3C89398C43-D45C-4653-8C0A-5AC987395924@ziprealty.com%3E>,
> for curious folks.
>
>
> Thank you for your time, guys.
>
>
>
>
>
>
>
>
> On Fri, Jun 3, 2016 at 6:45 AM, Shuai Lin <li...@gmail.com> wrote:
>
> +1 for setting CFLAGS and CXXFLAGS, I used to call configure like this:
>>
>> ```
>> CFLAGS=-ggdb3 CXXFLAGS=-ggdb3 ../configure ...
>> ```
>>
>> On Fri, Jun 3, 2016 at 6:13 PM, Evers Benno <be...@yandex-team.ru>
>> wrote:
>>
>> > A random guess, but gdb tends to load shared libraries only after you do
>> > "run" for the first time, maybe that's what's missing?
>> >
>> > Apart from this, after installation mesos is just a normal c++ binary,
>> > so you could bypass libtool by installing in some custom prefix (not
>> > sure how to do this on mac) and then using gdb manually with `gdb --args
>> > /usr/local/bin/mesos-master --work_dir= ...`
>> >
>> > Also, I vaguely remember some build issues with flags not being passed
>> > correctly to all third-party dependencies, so you probably want
>> > "CFLAGS=-g3 CXXFLAGS=-g3" in your environment in addition to
>> > --enable-debug.
>> >
>> > Best regards,
>> > Benno
>> >
>> >
>> > On 03.06.2016 02:23, Guangya Liu wrote:
>> > > Hi Vinit,
>> > >
>> > > Please check if you are encountering this issue:
>> > > https://github.com/Homebrew/homebrew-dupes/issues/221
>> > >
>> > > Thanks,
>> > >
>> > > Guangya
>> > >
>> > > On Fri, Jun 3, 2016 at 2:24 AM, Vinit Mahedia <vinitmahedia@gmail.com
>> >
>> > > wrote:
>> > >
>> > >> Hi Gilbert,
>> > >>
>> > >> Thank you for replying.
>> > >>
>> > >> Yes, I did that.
>> > >>
>> > >>
>> > >>    1.  ./configure --enable-debug --disable-java --disable-python
>> > >>    2.  make
>> > >>    3. ./bin/gdb-mesos-master.sh --ip=127.0.0.1 --work_dir=.
>> > >>
>> > >> Although even after setting source directory, I can not set
>> breakpoint I
>> > >> get warning like this
>> > >>
>> > >> (gdb) break master.cpp:2481
>> > >> Cannot access memory at address 0x714d40
>> > >>
>> > >>
>> > >> I also tried few things, passing "static" flag to libtool, passing
>> > >>  "--enable-static"
>> > >>
>> > >> Although I got linker error, where I saw libtool was not using
>> --static
>> > >> flag and I do
>> > >> not know if doing that will fix it. I forgot to mention that am
>> building
>> > >> this on Mac OS.
>> > >>
>> > >> Thank you.
>> > >>
>> > >>
>> > >>
>> > >> On Thu, Jun 2, 2016 at 12:33 PM, Gilbert Song <gilbert@mesosphere.io
>> >
>> > >> wrote:
>> > >>
>> > >>> Hi Vinit,
>> > >>>
>> > >>> Did you configure with debug mode (e.g., ../confugure
>> --enable-debug)?
>> > >>>
>> > >>> Assuming you have the gdb installed, you should be able to debug
>> mesos
>> > >>> master
>> > >>> in gbd:
>> > >>>
>> > >>> ./bin/gdb-mesos-master.sh --ip=127.0.0.1 --work_dir=/var/lib/mesos
>> > >>>
>> > >>>
>> > >>> Gilbert
>> > >>>
>> > >>> On Thu, Jun 2, 2016 at 9:30 AM, Vinit Mahedia <
>> vinitmahedia@gmail.com>
>> > >>> wrote:
>> > >>>
>> > >>>> I have been trying to debug mesos-master using gdb-mesos-master.sh
>> > >>> although
>> > >>>> it does not load symbols or sources. I tried to set those paths as
>> > well
>> > >>> but
>> > >>>> since it thinks mesos-master, libtool script, is the main binary.
>> > >>>>
>> > >>>> I just want to set the dev environment and try to fix a very stupid
>> > bug
>> > >>> to
>> > >>>> learn the work flow of test/debug/commit.
>> > >>>>
>> > >>>> If I can get it working, I can help to write if such documentation
>> > does
>> > >>> not
>> > >>>> exist. I also tried to set it up on eclipse CDT but it can't handle
>> > >>> libtool
>> > >>>> scripts.
>> > >>>>
>> > >>>> Thank you.
>> > >>>>
>> > >>>
>> > >>
>> > >
>> >
>>
>
>


-- 
~Vinit

Re: Documentation about debugging mesos-master : newbie

Posted by Vinit Mahedia <vi...@gmail.com>.
Guangya -

I just checked that. I am using v7.10 which has the fix for that issue. I
also tried to
build it on ubuntu(vagrant machine) 14.04, how Gilbert and others are doing
it, but
there I got this linking error so I think here I might have to work out
some issues as
there are already others who have it functioning unlike Mac OS:


Error on ubuntu :"make"(during link phase)

libtool: link: `slave/libmesos_no_3rdparty_la-validation.lo' is not a valid
libtool object


Brenno -

That is the reason I tried to build the whole thing as static by passing
--enable-static
flag, altough that did not work either. With default setting, shared
library, it gives that
infamous error of "memory address not accessible". The only place where I
could set
break point was "main" which I believe was due to GTEST macro. Now, I am
ditching the
setup on mac os and trying to get it working on ubuntu like others here.

About the issue I am facing with Kafka, I found this thread where someone
else is running into
same issue as me, registering the framework. So I will be replying to
that.Here it is -
mesos/kafka framework registration issue
<https://mail-archives.apache.org/mod_mbox/mesos-user/201604.mbox/%3C89398C43-D45C-4653-8C0A-5AC987395924@ziprealty.com%3E>,
for curious folks.


Thank you for your time, guys.








On Fri, Jun 3, 2016 at 6:45 AM, Shuai Lin <li...@gmail.com> wrote:

+1 for setting CFLAGS and CXXFLAGS, I used to call configure like this:
>
> ```
> CFLAGS=-ggdb3 CXXFLAGS=-ggdb3 ../configure ...
> ```
>
> On Fri, Jun 3, 2016 at 6:13 PM, Evers Benno <be...@yandex-team.ru> wrote:
>
> > A random guess, but gdb tends to load shared libraries only after you do
> > "run" for the first time, maybe that's what's missing?
> >
> > Apart from this, after installation mesos is just a normal c++ binary,
> > so you could bypass libtool by installing in some custom prefix (not
> > sure how to do this on mac) and then using gdb manually with `gdb --args
> > /usr/local/bin/mesos-master --work_dir= ...`
> >
> > Also, I vaguely remember some build issues with flags not being passed
> > correctly to all third-party dependencies, so you probably want
> > "CFLAGS=-g3 CXXFLAGS=-g3" in your environment in addition to
> > --enable-debug.
> >
> > Best regards,
> > Benno
> >
> >
> > On 03.06.2016 02:23, Guangya Liu wrote:
> > > Hi Vinit,
> > >
> > > Please check if you are encountering this issue:
> > > https://github.com/Homebrew/homebrew-dupes/issues/221
> > >
> > > Thanks,
> > >
> > > Guangya
> > >
> > > On Fri, Jun 3, 2016 at 2:24 AM, Vinit Mahedia <vi...@gmail.com>
> > > wrote:
> > >
> > >> Hi Gilbert,
> > >>
> > >> Thank you for replying.
> > >>
> > >> Yes, I did that.
> > >>
> > >>
> > >>    1.  ./configure --enable-debug --disable-java --disable-python
> > >>    2.  make
> > >>    3. ./bin/gdb-mesos-master.sh --ip=127.0.0.1 --work_dir=.
> > >>
> > >> Although even after setting source directory, I can not set
> breakpoint I
> > >> get warning like this
> > >>
> > >> (gdb) break master.cpp:2481
> > >> Cannot access memory at address 0x714d40
> > >>
> > >>
> > >> I also tried few things, passing "static" flag to libtool, passing
> > >>  "--enable-static"
> > >>
> > >> Although I got linker error, where I saw libtool was not using
> --static
> > >> flag and I do
> > >> not know if doing that will fix it. I forgot to mention that am
> building
> > >> this on Mac OS.
> > >>
> > >> Thank you.
> > >>
> > >>
> > >>
> > >> On Thu, Jun 2, 2016 at 12:33 PM, Gilbert Song <gi...@mesosphere.io>
> > >> wrote:
> > >>
> > >>> Hi Vinit,
> > >>>
> > >>> Did you configure with debug mode (e.g., ../confugure
> --enable-debug)?
> > >>>
> > >>> Assuming you have the gdb installed, you should be able to debug
> mesos
> > >>> master
> > >>> in gbd:
> > >>>
> > >>> ./bin/gdb-mesos-master.sh --ip=127.0.0.1 --work_dir=/var/lib/mesos
> > >>>
> > >>>
> > >>> Gilbert
> > >>>
> > >>> On Thu, Jun 2, 2016 at 9:30 AM, Vinit Mahedia <
> vinitmahedia@gmail.com>
> > >>> wrote:
> > >>>
> > >>>> I have been trying to debug mesos-master using gdb-mesos-master.sh
> > >>> although
> > >>>> it does not load symbols or sources. I tried to set those paths as
> > well
> > >>> but
> > >>>> since it thinks mesos-master, libtool script, is the main binary.
> > >>>>
> > >>>> I just want to set the dev environment and try to fix a very stupid
> > bug
> > >>> to
> > >>>> learn the work flow of test/debug/commit.
> > >>>>
> > >>>> If I can get it working, I can help to write if such documentation
> > does
> > >>> not
> > >>>> exist. I also tried to set it up on eclipse CDT but it can't handle
> > >>> libtool
> > >>>> scripts.
> > >>>>
> > >>>> Thank you.
> > >>>>
> > >>>
> > >>
> > >
> >
>

Re: Documentation about debugging mesos-master : newbie

Posted by Shuai Lin <li...@gmail.com>.
+1 for setting CFLAGS and CXXFLAGS, I used to call configure like this:

```
CFLAGS=-ggdb3 CXXFLAGS=-ggdb3 ../configure ...
```

On Fri, Jun 3, 2016 at 6:13 PM, Evers Benno <be...@yandex-team.ru> wrote:

> A random guess, but gdb tends to load shared libraries only after you do
> "run" for the first time, maybe that's what's missing?
>
> Apart from this, after installation mesos is just a normal c++ binary,
> so you could bypass libtool by installing in some custom prefix (not
> sure how to do this on mac) and then using gdb manually with `gdb --args
> /usr/local/bin/mesos-master --work_dir= ...`
>
> Also, I vaguely remember some build issues with flags not being passed
> correctly to all third-party dependencies, so you probably want
> "CFLAGS=-g3 CXXFLAGS=-g3" in your environment in addition to
> --enable-debug.
>
> Best regards,
> Benno
>
>
> On 03.06.2016 02:23, Guangya Liu wrote:
> > Hi Vinit,
> >
> > Please check if you are encountering this issue:
> > https://github.com/Homebrew/homebrew-dupes/issues/221
> >
> > Thanks,
> >
> > Guangya
> >
> > On Fri, Jun 3, 2016 at 2:24 AM, Vinit Mahedia <vi...@gmail.com>
> > wrote:
> >
> >> Hi Gilbert,
> >>
> >> Thank you for replying.
> >>
> >> Yes, I did that.
> >>
> >>
> >>    1.  ./configure --enable-debug --disable-java --disable-python
> >>    2.  make
> >>    3. ./bin/gdb-mesos-master.sh --ip=127.0.0.1 --work_dir=.
> >>
> >> Although even after setting source directory, I can not set breakpoint I
> >> get warning like this
> >>
> >> (gdb) break master.cpp:2481
> >> Cannot access memory at address 0x714d40
> >>
> >>
> >> I also tried few things, passing "static" flag to libtool, passing
> >>  "--enable-static"
> >>
> >> Although I got linker error, where I saw libtool was not using --static
> >> flag and I do
> >> not know if doing that will fix it. I forgot to mention that am building
> >> this on Mac OS.
> >>
> >> Thank you.
> >>
> >>
> >>
> >> On Thu, Jun 2, 2016 at 12:33 PM, Gilbert Song <gi...@mesosphere.io>
> >> wrote:
> >>
> >>> Hi Vinit,
> >>>
> >>> Did you configure with debug mode (e.g., ../confugure --enable-debug)?
> >>>
> >>> Assuming you have the gdb installed, you should be able to debug mesos
> >>> master
> >>> in gbd:
> >>>
> >>> ./bin/gdb-mesos-master.sh --ip=127.0.0.1 --work_dir=/var/lib/mesos
> >>>
> >>>
> >>> Gilbert
> >>>
> >>> On Thu, Jun 2, 2016 at 9:30 AM, Vinit Mahedia <vi...@gmail.com>
> >>> wrote:
> >>>
> >>>> I have been trying to debug mesos-master using gdb-mesos-master.sh
> >>> although
> >>>> it does not load symbols or sources. I tried to set those paths as
> well
> >>> but
> >>>> since it thinks mesos-master, libtool script, is the main binary.
> >>>>
> >>>> I just want to set the dev environment and try to fix a very stupid
> bug
> >>> to
> >>>> learn the work flow of test/debug/commit.
> >>>>
> >>>> If I can get it working, I can help to write if such documentation
> does
> >>> not
> >>>> exist. I also tried to set it up on eclipse CDT but it can't handle
> >>> libtool
> >>>> scripts.
> >>>>
> >>>> Thank you.
> >>>>
> >>>
> >>
> >
>

Re: Documentation about debugging mesos-master : newbie

Posted by Evers Benno <be...@yandex-team.ru>.
A random guess, but gdb tends to load shared libraries only after you do
"run" for the first time, maybe that's what's missing?

Apart from this, after installation mesos is just a normal c++ binary,
so you could bypass libtool by installing in some custom prefix (not
sure how to do this on mac) and then using gdb manually with `gdb --args
/usr/local/bin/mesos-master --work_dir= ...`

Also, I vaguely remember some build issues with flags not being passed
correctly to all third-party dependencies, so you probably want
"CFLAGS=-g3 CXXFLAGS=-g3" in your environment in addition to --enable-debug.

Best regards,
Benno


On 03.06.2016 02:23, Guangya Liu wrote:
> Hi Vinit,
> 
> Please check if you are encountering this issue:
> https://github.com/Homebrew/homebrew-dupes/issues/221
> 
> Thanks,
> 
> Guangya
> 
> On Fri, Jun 3, 2016 at 2:24 AM, Vinit Mahedia <vi...@gmail.com>
> wrote:
> 
>> Hi Gilbert,
>>
>> Thank you for replying.
>>
>> Yes, I did that.
>>
>>
>>    1.  ./configure --enable-debug --disable-java --disable-python
>>    2.  make
>>    3. ./bin/gdb-mesos-master.sh --ip=127.0.0.1 --work_dir=.
>>
>> Although even after setting source directory, I can not set breakpoint I
>> get warning like this
>>
>> (gdb) break master.cpp:2481
>> Cannot access memory at address 0x714d40
>>
>>
>> I also tried few things, passing "static" flag to libtool, passing
>>  "--enable-static"
>>
>> Although I got linker error, where I saw libtool was not using --static
>> flag and I do
>> not know if doing that will fix it. I forgot to mention that am building
>> this on Mac OS.
>>
>> Thank you.
>>
>>
>>
>> On Thu, Jun 2, 2016 at 12:33 PM, Gilbert Song <gi...@mesosphere.io>
>> wrote:
>>
>>> Hi Vinit,
>>>
>>> Did you configure with debug mode (e.g., ../confugure --enable-debug)?
>>>
>>> Assuming you have the gdb installed, you should be able to debug mesos
>>> master
>>> in gbd:
>>>
>>> ./bin/gdb-mesos-master.sh --ip=127.0.0.1 --work_dir=/var/lib/mesos
>>>
>>>
>>> Gilbert
>>>
>>> On Thu, Jun 2, 2016 at 9:30 AM, Vinit Mahedia <vi...@gmail.com>
>>> wrote:
>>>
>>>> I have been trying to debug mesos-master using gdb-mesos-master.sh
>>> although
>>>> it does not load symbols or sources. I tried to set those paths as well
>>> but
>>>> since it thinks mesos-master, libtool script, is the main binary.
>>>>
>>>> I just want to set the dev environment and try to fix a very stupid bug
>>> to
>>>> learn the work flow of test/debug/commit.
>>>>
>>>> If I can get it working, I can help to write if such documentation does
>>> not
>>>> exist. I also tried to set it up on eclipse CDT but it can't handle
>>> libtool
>>>> scripts.
>>>>
>>>> Thank you.
>>>>
>>>
>>
> 

Re: Documentation about debugging mesos-master : newbie

Posted by Guangya Liu <gy...@gmail.com>.
Hi Vinit,

Please check if you are encountering this issue:
https://github.com/Homebrew/homebrew-dupes/issues/221

Thanks,

Guangya

On Fri, Jun 3, 2016 at 2:24 AM, Vinit Mahedia <vi...@gmail.com>
wrote:

> Hi Gilbert,
>
> Thank you for replying.
>
> Yes, I did that.
>
>
>    1.  ./configure --enable-debug --disable-java --disable-python
>    2.  make
>    3. ./bin/gdb-mesos-master.sh --ip=127.0.0.1 --work_dir=.
>
> Although even after setting source directory, I can not set breakpoint I
> get warning like this
>
> (gdb) break master.cpp:2481
> Cannot access memory at address 0x714d40
>
>
> I also tried few things, passing "static" flag to libtool, passing
>  "--enable-static"
>
> Although I got linker error, where I saw libtool was not using --static
> flag and I do
> not know if doing that will fix it. I forgot to mention that am building
> this on Mac OS.
>
> Thank you.
>
>
>
> On Thu, Jun 2, 2016 at 12:33 PM, Gilbert Song <gi...@mesosphere.io>
> wrote:
>
> > Hi Vinit,
> >
> > Did you configure with debug mode (e.g., ../confugure --enable-debug)?
> >
> > Assuming you have the gdb installed, you should be able to debug mesos
> > master
> > in gbd:
> >
> > ./bin/gdb-mesos-master.sh --ip=127.0.0.1 --work_dir=/var/lib/mesos
> >
> >
> > Gilbert
> >
> > On Thu, Jun 2, 2016 at 9:30 AM, Vinit Mahedia <vi...@gmail.com>
> > wrote:
> >
> > > I have been trying to debug mesos-master using gdb-mesos-master.sh
> > although
> > > it does not load symbols or sources. I tried to set those paths as well
> > but
> > > since it thinks mesos-master, libtool script, is the main binary.
> > >
> > > I just want to set the dev environment and try to fix a very stupid bug
> > to
> > > learn the work flow of test/debug/commit.
> > >
> > > If I can get it working, I can help to write if such documentation does
> > not
> > > exist. I also tried to set it up on eclipse CDT but it can't handle
> > libtool
> > > scripts.
> > >
> > > Thank you.
> > >
> >
>

Re: Documentation about debugging mesos-master : newbie

Posted by Vinit Mahedia <vi...@gmail.com>.
Hi Gilbert,

Thank you for replying.

Yes, I did that.


   1.  ./configure --enable-debug --disable-java --disable-python
   2.  make
   3. ./bin/gdb-mesos-master.sh --ip=127.0.0.1 --work_dir=.

Although even after setting source directory, I can not set breakpoint I
get warning like this

(gdb) break master.cpp:2481
Cannot access memory at address 0x714d40


I also tried few things, passing "static" flag to libtool, passing
 "--enable-static"

Although I got linker error, where I saw libtool was not using --static
flag and I do
not know if doing that will fix it. I forgot to mention that am building
this on Mac OS.

Thank you.



On Thu, Jun 2, 2016 at 12:33 PM, Gilbert Song <gi...@mesosphere.io> wrote:

> Hi Vinit,
>
> Did you configure with debug mode (e.g., ../confugure --enable-debug)?
>
> Assuming you have the gdb installed, you should be able to debug mesos
> master
> in gbd:
>
> ./bin/gdb-mesos-master.sh --ip=127.0.0.1 --work_dir=/var/lib/mesos
>
>
> Gilbert
>
> On Thu, Jun 2, 2016 at 9:30 AM, Vinit Mahedia <vi...@gmail.com>
> wrote:
>
> > I have been trying to debug mesos-master using gdb-mesos-master.sh
> although
> > it does not load symbols or sources. I tried to set those paths as well
> but
> > since it thinks mesos-master, libtool script, is the main binary.
> >
> > I just want to set the dev environment and try to fix a very stupid bug
> to
> > learn the work flow of test/debug/commit.
> >
> > If I can get it working, I can help to write if such documentation does
> not
> > exist. I also tried to set it up on eclipse CDT but it can't handle
> libtool
> > scripts.
> >
> > Thank you.
> >
>

Re: Documentation about debugging mesos-master : newbie

Posted by Gilbert Song <gi...@mesosphere.io>.
Hi Vinit,

Did you configure with debug mode (e.g., ../confugure --enable-debug)?

Assuming you have the gdb installed, you should be able to debug mesos
master
in gbd:

./bin/gdb-mesos-master.sh --ip=127.0.0.1 --work_dir=/var/lib/mesos


Gilbert

On Thu, Jun 2, 2016 at 9:30 AM, Vinit Mahedia <vi...@gmail.com>
wrote:

> I have been trying to debug mesos-master using gdb-mesos-master.sh although
> it does not load symbols or sources. I tried to set those paths as well but
> since it thinks mesos-master, libtool script, is the main binary.
>
> I just want to set the dev environment and try to fix a very stupid bug to
> learn the work flow of test/debug/commit.
>
> If I can get it working, I can help to write if such documentation does not
> exist. I also tried to set it up on eclipse CDT but it can't handle libtool
> scripts.
>
> Thank you.
>