[lldb-dev] 32-bit linux IsWatchpointHit assertion failure due to WriteRegister

Andrew MacPherson andrew.macp at gmail.com
Sat Mar 1 03:52:22 PST 2014


Just to add another data point here I pulled the latest and built on a
32-bit Ubuntu 12.04 machine using gcc 4.8.1 and configure/make (not cmake)
I get the same error as Matthew.

andrew at linodebox:~/src/llvm/Release+Asserts/bin$ uname -a
Linux linodebox 3.12.6-x86-linode55 #2 SMP Tue Jan 14 08:41:36 EST 2014
i686 i686 i386 GNU/Linux
andrew at linodebox:~/src/llvm/Release+Asserts/bin$ ./lldb --version
lldb version 3.5 (http://llvm.org/git/lldb revision
18f105d6a0ec19261891cae0a70e1d12b0dd77db clang revision
30577e6c4f5ba66b8dc832ed9955b1a7475f788a llvm revision
abad3545bdf7d89ea9b8c8e0ba30edc45c0118bb)
andrew at linodebox:~/src/llvm/Release+Asserts/bin$ cd ../../tools/lldb/
andrew at linodebox:~/src/llvm/tools/lldb$ git log | head
commit 18f105d6a0ec19261891cae0a70e1d12b0dd77db
Author: Jim Ingham <jingham at apple.com>
Date:   Sat Mar 1 00:17:06 2014 +0000

    Make sure the exe_ctx passed to ClangUserExpression::Execute has a
valid thread.

    <rdar://problem/15949113>


    git-svn-id:
https://llvm.org/svn/llvm-project/lldb/trunk@20256191177308-0d34-0410-b5e6-96231b3b80d8
andrew at linodebox:~/src/llvm/tools/lldb$ cd -
/home/andrew/src/llvm/Release+Asserts/bin
andrew at linodebox:~/src/llvm/Release+Asserts/bin$ file /usr/bin/python2.7
/usr/bin/python2.7: ELF 32-bit LSB executable, Intel 80386, version 1
(SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.24,
BuildID[sha1]=0xf96ecbe97bf2a78f1d3de7be85b849dfdcbb6083, stripped
andrew at linodebox:~/src/llvm/Release+Asserts/bin$ file lldb
lldb: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically
linked (uses shared libs), for GNU/Linux 2.6.24,
BuildID[sha1]=0x670a204eb95a63dc2d59f7e16436de19be894446, not stripped
andrew at linodebox:~/src/llvm/Release+Asserts/bin$ ./lldb /usr/bin/python
Current executable set to '/usr/bin/python' (i386).
(lldb) r
Process 12316 launching
lldb: RegisterContextPOSIXProcessMonitor_x86.cpp:511: virtual bool
RegisterContextPOSIXProcessMonitor_x86_64::IsWatchpointHit(uint32_t):
Assertion `false && "Could not initialize watchpoint registers"' failed.
Aborted

Hope that helps,
Andrew


On Fri, Feb 28, 2014 at 5:13 PM, Todd Fiala <tfiala at google.com> wrote:

> Hey Matthew,
>
> I just did a double check on my Ubuntu 13.10 x86 VM.  Here were the
> results I got, which seem to be different than yours (I've got an x86
> 32-bit exe debugging fine with an x86 32-bit lldb):
>
> tfiala at ub-x86-13:~/lldb/work/build$ uname -a
> Linux ub-x86-13.10-01 3.11.0-17-generic #31-Ubuntu SMP Mon Feb 3 21:53:31
> UTC 2014 i686 i686 i686 GNU/Linux
> tfiala at ub-x86-13:~/lldb/work/build$ pushd ../llvm/tools/lldb
> ~/lldb/work/llvm/tools/lldb ~/lldb/work/build
> tfiala at ub-x86-13:~/lldb/work/llvm/tools/lldb$ git log | head
> commit aa7f071df1e47c4d63b4cab81c5b3a375e4b4a50
> Author: Ed Maste <emaste at freebsd.org>
> Date:   Fri Feb 28 13:46:51 2014 +0000
>
>     Fix types to eliminate compiler warnings in FreeBSD host class
>
>
>     git-svn-id: https://llvm.org/svn/llvm-project/lldb/*trunk@202498*91177308-0d34-0410-b5e6-96231b3b80d8
>
> commit 3ca8916b078d298cc42ed61ffa2739c67daf7987
> tfiala at ub-x86-13:~/lldb/work/llvm/tools/lldb$ # svn trunk at 202498
> tfiala at ub-x86-13:~/lldb/work/llvm/tools/lldb$ popd
> ~/lldb/work/build
> tfiala at ub-x86-13:~/lldb/work/build$ file ~/play/size_data/main
> /home/tfiala/play/size_data/main: ELF 32-bit LSB executable, Intel 80386,
> version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux
> 2.6.24, BuildID[sha1]=0x1749b467dda063db39d8bf61a26aec8e2f7a062e, not
> stripped
> tfiala at ub-x86-13:~/lldb/work/build$ lldb -v
> lldb: command not found
> tfiala at ub-x86-13:~/lldb/work/build$ bin/lldb -v
> lldb version 3.5 (http://llvm.org/git/lldb.git revision
> aa7f071df1e47c4d63b4cab81c5b3a375e4b4a50)
> tfiala at ub-x86-13:~/lldb/work/build$ bin/lldb ~/play/size_data/main
> Current executable set to '/home/tfiala/play/size_data/main' (i386).
> (lldb) b main.cpp:5
> Breakpoint 1: where = main`main + 9 at main.cpp:5, address = 0x08048426
> (lldb) run
> Process 24270 launching
> Process 24270 stopped
> * thread #1: tid = 24270, 0xb775f190, name = 'main', stop reason = trace
>     frame #0: 0xb775f190
> -> 0xb775f190:  movl   %esp, %eax
>    0xb775f192:  calll  0xb7762b70
>    0xb775f197:  movl   %eax, %edi
>    0xb775f199:  calll  0xb775f180
> (lldb) Process 24270 launched: '/home/tfiala/play/size_data/main' (i386)
> Process 24270 stopped
> * thread #1: tid = 24270, 0x08048426 main`main + 9 at main.cpp:5, name =
> 'main', stop reason = breakpoint 1.1
>     frame #0: 0x08048426 main`main + 9 at main.cpp:5
>    2
>    3   int main()
>    4   {
> -> 5       printf("sizeof(long int): %u\n", sizeof(long int));
>    6       return 0;
>    7   }
> (lldb) step
> Process 24270 stopped
> * thread #1: tid = 24270, 0xb75e27df libc.so.6`__printf(format=0x080484e0)
> + 15 at printf.c:33, name = 'main', stop reason = step in
>     frame #0: 0xb75e27df libc.so.6`__printf(format=0x080484e0) + 15 at
> printf.c:33
> (lldb) bt
> * thread #1: tid = 24270, 0xb75e27df libc.so.6`__printf(format=0x080484e0)
> + 15 at printf.c:33, name = 'main', stop reason = step in
>   * frame #0: 0xb75e27df libc.so.6`__printf(format=0x080484e0) + 15 at
> printf.c:33
>     frame #1: 0x0804843a main`main + 29 at main.cpp:5
> (lldb) exit
> Quitting LLDB will kill one or more processes. Do you really want to
> proceed: [Y/n] y
> tfiala at ub-x86-13:~/lldb/work/build$
>
> I'm building with gcc 4.8.1 (stock on that machine), with packages:
> swig
> libedit-dev
> python-dev
> ncurses-dev
>
> I happen to be using cmake/ninja to build this.  If you're using
> configure/make, I can try that too to make sure there isn't any difference.
>
>
> On Fri, Feb 28, 2014 at 6:58 AM, Todd Fiala <tfiala at google.com> wrote:
>
>> Hey Matthew,
>>
>> > Initial investigations suggest that the offset of dr6 is being
>> calculated incorrectly. The trace says 0x2A8, it should be 0x114.
>>
>> That sounds like you are once again seeing an x86_64 register infos
>> section (using the x86_64 fpu register set) vs. the i386 set IIRC.
>>
>> Your host is a 32-bit x86 architecture, right?  (The one where you are
>> running lldb?)
>>
>> If you do a svn status or git status, can you double check that you don't
>> have any local changes?  I'll try on a 32-bit host with a clean repo to
>> make sure I didn't have any cruft on my end confusing the results.
>>
>>
>> On Fri, Feb 28, 2014 at 6:02 AM, Matthew Gardiner <mg11 at csr.com> wrote:
>>
>>> Initial investigations suggest that the offset of dr6 is being
>>> calculated incorrectly. The trace says 0x2A8, it should be 0x114.
>>>
>>>
>>> (lldb) log enable linux ptrace
>>> (lldb) run
>>> operation ptrace(PTRACE_SETOPTIONS, 3665, (nil), 0x58, 0)=0 called from
>>> file /home/mg11/src/heracles2/llvm/tools/lldb/source/Plugins/
>>> Process/Linux/ProcessMonitor.cpp line 1456
>>> Process 3665 launching
>>>
>>> operation ptrace(PTRACE_TRACEME, 0, (nil), (nil), 0)=0 called from file
>>> /home/mg11/src/heracles2/llvm/tools/lldb/source/Plugins/
>>> Process/Linux/ProcessMonitor.cpp line 1196
>>> operation ptrace(PTRACE_PEEKDATA, 3665, 0x8048340, (nil), 0)=895EED31
>>> called from file /home/mg11/src/heracles2/llvm/
>>> tools/lldb/source/Plugins/Process/Linux/ProcessMonitor.cpp line 245
>>> operation ptrace(PTRACE_PEEKDATA, 3665, 0x8048340, (nil), 0)=895EED31
>>> called from file /home/mg11/src/heracles2/llvm/
>>> tools/lldb/source/Plugins/Process/Linux/ProcessMonitor.cpp line 245
>>> operation ptrace(PTRACE_POKEDATA, 3665, 0x8048340, 0x895eedcc, 0)=0
>>> called from file /home/mg11/src/heracles2/llvm/
>>> tools/lldb/source/Plugins/Process/Linux/ProcessMonitor.cpp line 319
>>> operation ptrace(PTRACE_PEEKDATA, 3665, 0x8048340, (nil), 0)=895EEDCC
>>> called from file /home/mg11/src/heracles2/llvm/
>>> tools/lldb/source/Plugins/Process/Linux/ProcessMonitor.cpp line 245
>>> MATTG IWH begin
>>> WriteRegisterValue dr6 tid=3665 offset=2A8 val=FFFFFFFF
>>> operation ptrace(PTRACE_POKEUSER, 3665, 0x2a8, 0xffffffff, 0)=FFFFFFFF
>>> called from file /home/mg11/src/heracles2/llvm/
>>> tools/lldb/source/Plugins/Process/Linux/ProcessMonitor.cpp line 543
>>>
>>>
>>>
>>> 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.
>>> _______________________________________________
>>> lldb-dev mailing list
>>> lldb-dev at cs.uiuc.edu
>>> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev
>>>
>>
>>
>>
>> --
>>  Todd Fiala | Software Engineer |  tfiala at google.com |  650-943-3180
>>
>
>
>
> --
> Todd Fiala | Software Engineer |  tfiala at google.com |  650-943-3180
>
> _______________________________________________
> lldb-dev mailing list
> lldb-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20140301/1476b810/attachment.html>


More information about the lldb-dev mailing list