[llvm-bugs] [Bug 42908] New: LLDB crash on a pascal procedural type use

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Aug 6 14:43:22 PDT 2019


https://bugs.llvm.org/show_bug.cgi?id=42908

            Bug ID: 42908
           Summary: LLDB crash on a pascal procedural type use
           Product: lldb
           Version: 9.0
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: All Bugs
          Assignee: lldb-dev at lists.llvm.org
          Reporter: argb32 at gmail.com
                CC: jdevlieghere at apple.com, llvm-bugs at lists.llvm.org

LLDB crashes if a variable of procedural type (methods as well) is examined -
stack trace included.
Reproduced with LLDB v9.0.0 (nightly build) on Windows10 64bit as well as LLDB
v6.0.0 on Linux 64 bit.
On OSX with v360.1.70 it doesn't crash but outputs error "unable to determine
byte size".

Used Free Pascal Compiler v3.0.2.
Compiler options: -gw2 -CroiO -O1
Probably it's not a directly supported compiler but it outputs DWARF2 debug
information and the procedural type is nothing but a pointer.

Sample program:
----------
{$MODE Delphi}
program Test33;

type
  TProcedure = procedure(); cdecl;

  TTest = class
    proc : TProcedure;
    constructor Create();

    function t(): Integer;
  end;

constructor TTest.Create();
var a: integer;
begin
  a := 9;
  proc := nil;
  WriteLn(a);
end;

function TTest.t(): Integer;
begin
  Result := 84;
end;

var
  Test : TTest;

begin
  Test := TTest.create();
end.
----------
LLDB crash trace (Windows x64 build):
Assertion failed: Ty->isSized() && "Cannot getTypeInfo() on a type that is
unsized!", file C:\src\llvm_package_363781\llvm\lib\IR\DataLayout.cpp, line 699
Stack dump:
0. Program arguments: C:\app\LLVM\bin\lldb-mi.exe Z:\src\g3ge\bin\Test33.exe 
0x00007FF74756CED6 (0x00007FF74756CED0 0x00007FFF57CA9241 0x0000009000000002
0x00007FFF57D78510)
0x00007FFF57CFD09B (0x0000000000000201 0x00007FFF00000000 0x00000000000002BB
0x00007FFF33863D9C), raise() + 0x1DB bytes(s)
0x00007FFF57CFE131 (0x00007FFF00000003 0x00007FFF00000003 0x00007FFF33863D9C
0x00007FFF34F4ED00), abort() + 0x31 bytes(s)
0x00007FFF57CFFE31 (0x00000000000002BB 0x00007FFF33863D9C 0x000048B16AD5E12B
0x0000021E04B92C60), _get_wpgmptr() + 0x1C31 bytes(s)
0x00007FFF57D0011F (0x0000000000008A7E 0x00007FFF3374FA3C 0x00007FFF3376D9FE
0x0000021E04BB6858), _wassert() + 0x3F bytes(s)
0x00007FFF33454892 (0x000000904498A9C8 0x0000000000000001 0x0000021E04BC4B40
0x000000904498A8C0), ??0SBBlock at lldb@@AEAA at PEAVBlock@lldb_private@@@Z() +
0x2DAF22 bytes(s)
0x00007FFF318A08C9 (0x0000021E04BB6AF8 0x0000021E01DA4D40 0x0000021E01DA0CC0
0x00007FFF00000000),
?SetSymbol at SBSymbol@lldb@@AEAAXPEAVSymbol at lldb_private@@@Z() + 0x8D5D39
bytes(s)
0x00007FFF3189E0BB (0x0000000000000210 0x0000021E01DA1C80 0x0000021E01DA1C80
0x0000021E04B5D9D0),
?SetSymbol at SBSymbol@lldb@@AEAAXPEAVSymbol at lldb_private@@@Z() + 0x8D352B
bytes(s)
0x00007FFF315EAE71 (0x000048B16AD5EBAB 0x0000000000000008 0x0000021E00000008
0x000000904498AEF0),
?SetSymbol at SBSymbol@lldb@@AEAAXPEAVSymbol at lldb_private@@@Z() + 0x6202E1
bytes(s)
0x00007FFF315E8F5A (0x0000000000000000 0x00007FFF57C99686 0x0000000000000080
0x0000000000000080),
?SetSymbol at SBSymbol@lldb@@AEAAXPEAVSymbol at lldb_private@@@Z() + 0x61E3CA
bytes(s)
0x00007FFF315E955F (0x000000904498AFB0 0x0000021E01DA1C80 0x000000904498AFC0
0x0000002000000002),
?SetSymbol at SBSymbol@lldb@@AEAAXPEAVSymbol at lldb_private@@@Z() + 0x61E9CF
bytes(s)
0x00007FFF317928C2 (0x0000021E04B002D0 0x0000000000000000 0x000000000000000B
0x00007FFF2FDD39B5),
?SetSymbol at SBSymbol@lldb@@AEAAXPEAVSymbol at lldb_private@@@Z() + 0x7C7D32
bytes(s)
0x00007FFF31792CED (0x0000021E04AFA570 0x0000021E04BB6FE0 0x0000021E04BBE3D0
0x0000021E04B4C860),
?SetSymbol at SBSymbol@lldb@@AEAAXPEAVSymbol at lldb_private@@@Z() + 0x7C815D
bytes(s)
0x00007FFF31792E55 (0x0000021E03B4D340 0x000000904498B3B8 0x000000904498BB00
0x00007FFF57C988DB),
?SetSymbol at SBSymbol@lldb@@AEAAXPEAVSymbol at lldb_private@@@Z() + 0x7C82C5
bytes(s)
0x00007FFF317930BD (0x0000021E01DA1C80 0x0000000000000000 0x894300203A010000
0x0000000001E30D00),
?SetSymbol at SBSymbol@lldb@@AEAAXPEAVSymbol at lldb_private@@@Z() + 0x7C852D
bytes(s)
0x00007FFF31579CCD (0x0000021E049B4A50 0x0000021E04BBE530 0x000000904498CBE8
0x00007FFF324F7000),
?SetSymbol at SBSymbol@lldb@@AEAAXPEAVSymbol at lldb_private@@@Z() + 0x5AF13D
bytes(s)
0x00007FFF3157240C (0x0000000000000004 0x000000904498CC78 0x0000000000000000
0x0001000001010001),
?SetSymbol at SBSymbol@lldb@@AEAAXPEAVSymbol at lldb_private@@@Z() + 0x5A787C
bytes(s)
0x00007FFF3157696A (0x00007FFF57D000E0 0x00007FFF3334F4F9 0x000048B16AD58B5B
0x0000021E04AFB360),
?SetSymbol at SBSymbol@lldb@@AEAAXPEAVSymbol at lldb_private@@@Z() + 0x5ABDDA
bytes(s)
0x00007FFF3157D6D1 (0x000000900000030C 0x0000000000000000 0x5F62646C6C5F5F24
0x0000000072707865),
?SetSymbol at SBSymbol@lldb@@AEAAXPEAVSymbol at lldb_private@@@Z() + 0x5B2B41
bytes(s)
0x00007FFF315608FF (0x0000000000000000 0x0000021E04AFB6D0 0x0000000000000000
0x0000000000000000),
?SetSymbol at SBSymbol@lldb@@AEAAXPEAVSymbol at lldb_private@@@Z() + 0x595D6F
bytes(s)
0x00007FFF2FB7C55A (0x0000021E049B7440 0x0000021E049B7420 0x0000021E049AAAF0
0x00007FFF33747A0F),
?SetSP at SBTrace@lldb@@IEAAXAEBV?$shared_ptr at VProcess@lldb_private@@@std@@@Z() +
0x5992A bytes(s)
0x00007FFF31E64325 (0x000000904498EF68 0x00007FFF46255501 0x0000021E03958300
0x000000904498E790),
?SetSymbol at SBSymbol@lldb@@AEAAXPEAVSymbol at lldb_private@@@Z() + 0xE99795
bytes(s)
0x00007FFF2FB74A1B (0x0000000000000001 0x0000021E0397E060 0x0000021E04B695D0
0x000000904498EE20),
?SetSP at SBTrace@lldb@@IEAAXAEBV?$shared_ptr at VProcess@lldb_private@@@std@@@Z() +
0x51DEB bytes(s)
0x00007FFF2FB74C77 (0x0000021E03958860 0x0000021E0395A220 0x0000021E00000000
0x0000021E01DA0000),
?SetSP at SBTrace@lldb@@IEAAXAEBV?$shared_ptr at VProcess@lldb_private@@@std@@@Z() +
0x52047 bytes(s)
0x00007FFF2FB40C6C (0x000000904498F130 0x00007FFF57C988DB 0x0000009000000000
0x0000021E01DA0000),
?SetSP at SBTrace@lldb@@IEAAXAEBV?$shared_ptr at VProcess@lldb_private@@@std@@@Z() +
0x1E03C bytes(s)
0x00007FFF2F959F13 (0x0000000000000002 0x0000021E03B11748 0x000000904498EFD0
0x0000021E04AE81E8), ??1SBCommandPluginInterface at lldb@@UEAA at XZ() + 0xA5B83
bytes(s)
0x00007FFF2FA45E60 (0x0000000000000002 0x00007FFF00000000 0x000000000000000F
0x00007FFF462555E3),
?get at SBBroadcaster@lldb@@IEBAPEAVBroadcaster at lldb_private@@XZ() + 0x37F20
bytes(s)
0x00007FFF2F667BB3 (0x000000000000000F 0x0000000000000000 0x00007FFF33776388
0x0000000000000035),
?EvaluateExpression at SBFrame@lldb@@QEAA?AVSBValue at 2@PEBDAEBVSBExpressionOptions at 2@@Z()
+ 0x3A3 bytes(s)
0x00007FFF2F6676A2 (0x0000000000000000 0x0000000000000000 0x000090E39A0CB500
0x000000904498F3B8),
?EvaluateExpression at SBFrame@lldb@@QEAA?AVSBValue at 2@PEBD at Z() + 0x312 bytes(s)
0x00007FF74753454F (0x000000000000000F 0x00007FF7475982D0 0x616572632D726100
0x20646E616D006574)
0x00007FF74753D0DA (0x000000904498F757 0x00007FF7475B5148 0x000000904498FB38
0x000000904498FA08)
0x00007FF74753F221 (0x0000021E01E30304 0x0000000000000022 0x0000021E038B69D0
0x000000904498F9C0)
0x00007FF74755DAA5 (0x0000021E038B6C00 0x0000021E038A09E0 0x0000000000000000
0x00007FFF33759D42)
0x00007FF74755CF60 (0x00007FFF57D784B8 0x000000904498FD6F 0x0000000000000000
0x007325203A6E6F69)
0x00007FF74756195E (0x0000021E01E3B638 0x0000021E01E3B620 0x0000000000000002
0x0000000000000000)
0x00007FF747560ED9 (0x0000000000000000 0x0000000000000000 0x0000000000000000
0x0000000000000000)
0x00007FF74759599C (0x0000000000000000 0x0000000000000000 0x0000000000000000
0x0000000000000000)
0x00007FFF57EB4034 (0x0000000000000000 0x0000000000000000 0x0000000000000000
0x0000000000000000), BaseThreadInitThunk() + 0x14 bytes(s)
0x00007FFF5AA83691 (0x0000000000000000 0x0000000000000000 0x0000000000000000
0x0000000000000000), RtlUserThreadStart() + 0x21 bytes(s)

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20190806/ba28eed2/attachment.html>


More information about the llvm-bugs mailing list