Linux lldb running a process produces WatchPoint assertion

Hi,

I've checked out the head of trunk of llvm/clang/lldb and managed to build lldb for:

3.12.8-300.fc20.i686 #1 SMP Thu Jan 16 01:28:49 UTC 2014 i686 i686 i386 GNU/Linux

using gcc-4.8.2. (I could only build a release version). When I attempt to debug a simple hello world program, the act of running the inferior results in a failed assertion in POSIXThread::WatchNotify(const ProcessMessage &message).

This is my output with some added printf:

> lldb hello
MG!!!!
Current executable set to 'hello' (i386).
(lldb) run
Process 4775 launching
MG!! LinuxThread::TraceNotify
lldb: /home/mg11/src/heracles/llvm/tools/lldb/source/Plugins/Process/POSIX/POSIXThread.cpp:506: void POSIXThread::WatchNotify(const ProcessMessage&): Assertion `wp_sp.get() && "No watchpoint found"' failed.
Aborted (core dumped)

I'm curious:
1. Does my crash happen because the path of execution should not flow through POSIXThread::WatchNotify at this time?
or
2. Does my crash happen because the assert statement itself is not correct (i.e. it should be an if(wp_sp.get()))

Thank you
Matthew Gardiner

Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom
More information can be found at www.csr.com. Keep up to date with CSR on our technical blog, www.csr.com/blog, CSR people blog, www.csr.com/people, YouTube, www.youtube.com/user/CSRplc, Facebook, www.facebook.com/pages/CSR/191038434253534, or follow us on Twitter at www.twitter.com/CSR_plc.
New for 2014, you can now access the wide range of products powered by aptX at www.aptx.com.

This seems related to http://llvm.org/bugs/show_bug.cgi?id=17802
in that lldb aborts at the same assertion.

Xavier

Xavier de Gaye wrote:

> Hi,
>
> I've checked out the head of trunk of llvm/clang/lldb and managed to build lldb for:
>
> 3.12.8-300.fc20.i686 #1 SMP Thu Jan 16 01:28:49 UTC 2014 i686 i686 i386 GNU/Linux
>
> using gcc-4.8.2. (I could only build a release version). When I attempt to debug a simple hello world program, the act of running the inferior results in a failed assertion in
> POSIXThread::WatchNotify(const ProcessMessage &message).

This seems related to http://llvm.org/bugs/show_bug.cgi?id=17802
in that lldb aborts at the same assertion.

Xavier

Thanks Xavier,

My next line of enquiry (I think) is to determine why my lldb thinks a watchpoint

void
LinuxThread::TraceNotify(const ProcessMessage &message)
{
     POSIXBreakpointProtocol* reg_ctx = GetPOSIXBreakpointProtocol();
     if (reg_ctx)
     {
         uint32_t num_hw_wps = reg_ctx->NumSupportedHardwareWatchpoints();
         uint32_t wp_idx;
         for (wp_idx = 0; wp_idx < num_hw_wps; wp_idx++)
         {
             if (reg_ctx->IsWatchpointHit(wp_idx))
             {
                 fprintf(stderr, "MG!! LinuxThread::TraceNotify\n");
                 WatchNotify(message);

has been hit.

What does LLDB's concept of a Watchpoint mean? Is it like Visual Studio's watched variable?

Thanks
Matthew

Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom
More information can be found at www.csr.com. Keep up to date with CSR on our technical blog, www.csr.com/blog, CSR people blog, www.csr.com/people, YouTube, www.youtube.com/user/CSRplc, Facebook, www.facebook.com/pages/CSR/191038434253534, or follow us on Twitter at www.twitter.com/CSR_plc.
New for 2014, you can now access the wide range of products powered by aptX at www.aptx.com.