Accel-ppp debug

I will give an example of accel-ppp build with debugging information support, for example, in order to find out the cause of the crash.

I recommend to see my article:
Accel-ppp installation

To see debug information, you need to install accel-ppp by adding:

-DCMAKE_BUILD_TYPE=Debug

If you need to identify the cause of the leakage of RAM, then add another:

-DMEMDEBUG=TRUE

Suppose we collect so:

cd /opt/
git clone git://git.code.sf.net/p/accel-ppp/code accel-ppp-code
mkdir /opt/accel-ppp-code/build
cd /opt/accel-ppp-code/build
cmake -DCMAKE_INSTALL_PREFIX=/usr -DKDIR=/usr/src/linux-headers-`uname -r` -DRADIUS=TRUE -DSHAPER=TRUE -DLOG_PGSQL=FALSE -DNETSNMP=FALSE -DLUA=TRUE -DBUILD_IPOE_DRIVER=TRUE -DBUILD_VLAN_MON_DRIVER=TRUE -DCPACK_TYPE=Ubuntu16 -DCMAKE_BUILD_TYPE=Debug /opt/accel-ppp-code
make
make install

Add the parameters to /etc/sysctl.conf, which let us specify where to store the core files and that the name of the program and the pid number should be specified in the name:

kernel.core_uses_pid = 1
kernel.core_pattern = /root/core-%e-%p

Apply the changes:

sysctl -p

Disable the limit on the size of core files:

ulimit -c unlimited

In order not to be reset after a system restart, add to /etc/security/limits.conf:

* soft core unlimited

Now for the test, you can create a file with the code in which there is an error:

int main() {
  *(char *)0 = 0;
  return 0;
}

Compile:

gcc file.c

Execute:

./a.out

Make sure there is a segfault error in dmesg:

dmesg

Also make sure that the core -… file is created in the /root/ directory.
Now, similarly, when accel-ppp is crash, a core file will be created.

Did my article help you? How about buying me a cup of coffee as an encouragement? Buy me a coffe.

Leave a comment

Leave a Reply