LLDB 4.0.0 crashes on Windows 7

Hi,

I installed a 32-bit Windows build of LLVM 4.0.0 from this page:

  http://llvm.org/builds/

where it is identified as "based on SVN r284979 (24 October 2016)".
(I actually wanted only LLDB, but there doesn't seem to be a separate
installer for that.) The machine where I installed it runs the 64-bit
Windows 7 OS. The only setting I changed during the installation was
the installation directory: instead of the default under "C:\Program
Files (x86)" I've installed it under d:\usr.

The installation went fine. After installing, I found that I needed
Python 3.5.x, so I installed this:

  https://www.python.org/ftp/python/3.5.2/python-3.5.2.exe

The installed Python works correctly.

After all this, lldb crashes when it attempts to start a debuggee.
Specifically, whenever I say "process launch -s" inside the debugger,
it crashes. (The information about the crash available in the Windows
Event Viewer is at the end of this message.) The same happens if I
type "lldb PROGRAM" from the Windows cmd.exe prompt. Until I try to
launch the debuggee, lldb works: I can type the various commands,
including "help" and they produce expected results.

The crash is inside liblldb.dll, and the exception code seems to
indicate that some C runtime library function is called with incorrect
or invalid arguments.

Other programs that came with the installation -- clang, llvm-ar,
llvm-objdump -- seem to work fine and produce the expected results.
In particular, I compiled a small C program with clang.

So the installation seems to work fine, and only lldb crashes.

What am I doing wrong?

Thanks in advance for any help.

Here's the info from the Event Viewer:

Log Name: Application
Source: Application Error
Event ID: 1000
Task Category: (100)
Level: Error
Keywords: Classic
User: N/A
Computer: C1050100036.ness.com
Description:
Faulting application name: lldb.exe, version: 4.0.0.0, time stamp: 0x580fd053
Faulting module name: liblldb.dll, version: 4.0.0.0, time stamp: 0x580fd046
Exception code: 0xc0000417
Fault offset: 0x027295d2
Faulting process id: 0x1564
Faulting application start time: 0x01d23da09025cbd5
Faulting application path: D:\usr\LLVM\bin\lldb.exe
Faulting module path: D:\usr\LLVM\bin\liblldb.dll
Report Id: cef982bb-a993-11e6-a608-001b10002aec
Event Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
  <System>
    <Provider Name="Application Error" />
    <EventID Qualifiers="0">1000</EventID>
    <Level>2</Level>
    <Task>100</Task>
    <Keywords>0x80000000000000</Keywords>
    <TimeCreated SystemTime="2016-11-13T11:24:58.000000000Z" />
    <EventRecordID>121846</EventRecordID>
    <Channel>Application</Channel>
    <Computer>C1050100036.ness.com</Computer>
    <Security />
  </System>
  <EventData>
    <Data>lldb.exe</Data>
    <Data>4.0.0.0</Data>
    <Data>580fd053</Data>
    <Data>liblldb.dll</Data>
    <Data>4.0.0.0</Data>
    <Data>580fd046</Data>
    <Data>c0000417</Data>
    <Data>027295d2</Data>
    <Data>1564</Data>
    <Data>01d23da09025cbd5</Data>
    <Data>D:\usr\LLVM\bin\lldb.exe</Data>
    <Data>D:\usr\LLVM\bin\liblldb.dll</Data>
    <Data>cef982bb-a993-11e6-a608-001b10002aec</Data>
  </EventData>
</Event>

Hello,

I had a similar crash, and submitted a patch commited in rL285843

You could try to build afte this version from source, or wait for an updated build.

From: Rudy Pons <rudy.pons@ilod.org>
Date: Tue, 15 Nov 2016 01:08:52 +0100
Cc: lldb-dev@lists.llvm.org

I had a similar crash, and submitted a patch commited in rL285843
You could try to build afte this version from source, or wait for an updated build.

Thanks, I will have to wait, as I don't have MSVC installed (and don't
plan to).

Date: Tue, 15 Nov 2016 18:08:03 +0200
Cc: lldb-dev@lists.llvm.org
From: Eli Zaretskii via lldb-dev <lldb-dev@lists.llvm.org>

> From: Rudy Pons <rudy.pons@ilod.org>
> Date: Tue, 15 Nov 2016 01:08:52 +0100
> Cc: lldb-dev@lists.llvm.org
>
> I had a similar crash, and submitted a patch commited in rL285843
> You could try to build afte this version from source, or wait for an updated build.

Thanks, I will have to wait, as I don't have MSVC installed (and don't
plan to).

My wait is over, I installed the latest snapshot today. I'm glad to
report that now I can debug programs, although the simple invocation
of the debugger, as in

   lldb some.exe
or
   lldb -f some.exe

still crashes. I need to invoke lldb without any arguments, then load
the program with "file some.exe", and finally run it with "process
launch". Then it works. Is this expected?

There's also a strange problem with error messages: I don't see them
until I quit the debugger. For example, if I say "file foo.exe" where
foo.exe doesn't exist, I get the prompt back with no error message,
and without the usual announcement that foo.exe will be debugged.
Only after I type "quit" to exit the debugger, I see the error message
about foo.exe being non-existent. Am I doing something wrong?

Thanks.

I have never seen either of those problems, but I can test it out and see if I can reproduce.

From: Zachary Turner <zturner@google.com>
Date: Tue, 06 Dec 2016 16:22:51 +0000

I have never seen either of those problems, but I can test it out and see if I can reproduce.

Thanks.

If you are unable to reproduce, I wonder why it happens to me. The
system where I installed lldb is just a vanilla Windows 7 box.

I've also never seen either problem. I'm not debugging Windows apps, but Hexagon apps, running lldb and the Hexagon simulator on Win7.

I’m not able to repro at head (on Windows 7).