[lldb-dev] Various strange errors while debugging PostgreSQL

Aleksander Alekseev via lldb-dev lldb-dev at lists.llvm.org
Thu Mar 24 05:18:58 PDT 2016


Hello

Here is what I do. In one terminal I connect to PostgreSQL using psql
command. In another terminal I determine pid of a new PostgreSQL
process (backend process that handles a new connection) and run:

```
lldb-3.7.1 -p (pid)
```

Then:

```
b heap_open
c
```

In first terminal:

```
create temporary table tt1(x int);
```

In second terminal:

```
   1290	{
   1291		Relation	r;
   1292	
-> 1293		r = relation_open(relationId, lockmode);
   1294	
   1295		if (r->rd_rel->relkind == RELKIND_INDEX)
   1296			ereport(ERROR,
(lldb) p r
(Relation) $0 = 0x00000002018a70c8
(lldb) p r->rd_rel
error: Couldn't apply expression side effects : Couldn't dematerialize
   a result variable: couldn't read its memory
```

This is a first issue. The second issue is:

```
(lldb) process save-core /tmp/1.core
error: Failed to save core file for process: no ObjectFile plugins were
able to save a core for this process
```

LLDB was compiled manually from RELEASE_371/final tag using clang 3.6:

```
cmake ../llvm -G Ninja -DLLDB_DISABLE_CURSES:BOOL=TRUE \
  -DCMAKE_C_COMPILER=/usr/bin/clang-3.6 \
  -DCMAKE_CXX_COMPILER=/usr/bin/clang++-3.6 \
  -DCMAKE_BUILD_TYPE=Release
ninja -j2
sudo ninja install
```

It's Ubuntu Linux 14.04 LTS:

```
$ uname -a

Linux pgsql-dev-ubuntu 3.13.0-83-generic #127-Ubuntu SMP Fri Mar 11
00:25:37 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
```

Same issues with lldb-3.6 installed using apt-get.

`process save-core` doesn't work in lldb-3.8 compiled using ports on
FreeBSD 10.2 as well. Unfortunately I can't tell if first bug reproduces
on FreeBSD because of another bug I reported previously:

https://llvm.org/bugs/show_bug.cgi?id=26924#c3 

Anyway are these some sort of well-know issues that could be bypassed
somehow or brand new bugs? I can also provide any other debug
information you might need.

-- 
Best regards,
Aleksander Alekseev
http://eax.me/


More information about the lldb-dev mailing list