opengauss/opengauss-dev
This repository provides a debug version of openGauss.
475
A debug version of openGauss for developers.
The source code and 3rd binaries will locate under /home/opengauss directory.
When configure and compiling the openGauss from source code, the-O0 -g
flag and the --enable-debug
option will be setted.
You can use this image to develop and then recompile it to verify quickly
Pull the docker images
docker pull opengauss/opengauss-dev:tagname
and run it with privileged rights
docker run --cap-add=SYS_PTRACE --security-opt seccomp=unconfined --security-opt apparmor=unconfined --privileged -it opengauss/opengauss-dev:tagname
Then, enable the ptrace feature in the container
sudo bash -c "echo 0 > /proc/sys/kernel/yama/ptrace_scope"
Now you can use gstack and gdb in the container as below shows.
[opengauss@ef85d2236b1b ~]$ ps -ef | grep gaussdb
opengau+ 201 1 4 15:51 ? 00:00:02 /home/opengauss/openGauss/install/bin/gaussdb -D /home/opengauss/openGauss/data
opengau+ 315 244 0 15:52 pts/0 00:00:00 grep --color=auto gaussdb
[opengauss@ef85d2236b1b ~]$
[opengauss@ef85d2236b1b ~]$ gstack 201
Thread 36 (Thread 0xffff31f5eee0 (LWP 240) "undorecycler"):
#0 0x0000ffff976ec4c8 in poll () from /usr/lib64/libc.so.6
#1 0x0000000000d53abc in WaitLatchOrSocket (latch=0xffff7bb52d30, wakeEvents=25, sock=-1, timeout=2250) at pg_latch.cpp:309
#2 0x0000000000d53734 in WaitLatch (latch=0xffff7bb52d30, wakeEvents=25, timeout=2250) at pg_latch.cpp:192
#3 0x0000000001fe54a0 in undo::WaitRecycleThread (nonRecycled=2250) at knl_uundorecycle.cpp:502
#4 0x0000000001fe675c in undo::UndoRecycleMain () at knl_uundorecycle.cpp:756
#5 0x0000000001852680 in GaussDbAuxiliaryThreadMain<(knl_thread_role)56> (arg=0xffff78c03ce8) at postmaster.cpp:12090
#6 0x000000000184a124 in GaussDbThreadMain<(knl_thread_role)56> (arg=0xffff78c03ce8) at postmaster.cpp:12354
#7 0x0000000001832000 in InternalThreadFunc (args=0xffff78c03ce8) at postmaster.cpp:12935
#8 0x00000000023a585c in ThreadStarterFunc (arg=0xffff78c03cd8) at gs_thread.cpp:382
#9 0x0000ffff976904bc in ?? () from /usr/lib64/libc.so.6
#10 0x0000ffff976f651c in ?? () from /usr/lib64/libc.so.6
Thread 35 (Thread 0xffff36e6eee0 (LWP 239) "WLMarbiter"):
#0 0x0000ffff976ef098 in select () from /usr/lib64/libc.so.6
#1 0x00000000023a25d0 in pg_usleep (microsec=10000000) at pgsleep.cpp:40
#2 0x000000000135f004 in WLMarbiter_MainLoop () at ioschdl.cpp:1420
#3 0x000000000135fae4 in WLMarbiterMain () at ioschdl.cpp:1643
#4 0x000000000183b32c in GaussDbThreadMain<(knl_thread_role)13> (arg=0xffff78c03cb0) at postmaster.cpp:12473
#5 0x0000000001832000 in InternalThreadFunc (args=0xffff78c03cb0) at postmaster.cpp:12935
#6 0x00000000023a585c in ThreadStarterFunc (arg=0xffff78c03ca0) at gs_thread.cpp:382
#7 0x0000ffff976904bc in ?? () from /usr/lib64/libc.so.6
#8 0x0000ffff976f651c in ?? () from /usr/lib64/libc.so.6
......
[opengauss@ef85d2236b1b ~]$ gdb a 201
GNU gdb (GDB) openEuler 11.1-1.oe2203
Copyright (C) 2021 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "aarch64-openEuler-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
a: No such file or directory.
Attaching to process 201
......
SIGUSR1
and SIGUSR2
signal in the very beginning.(gdb) handle SIGUSR1 noprint nostop pass
Signal Stop Print Pass to program Description
SIGUSR1 No No Yes User defined signal 1
(gdb) handle SIGUSR2 noprint nostop pass
Signal Stop Print Pass to program Description
SIGUSR2 No No Yes User defined signal 2
docker pull opengauss/opengauss-dev