TDengine memory leakage introduced by tmq_consumer_poll - memory-leaks

there seems existence of memory leakage introduced by tmq_consumer_poll
If anyone is willing to help, there're the steps to reproduce the behavior:
attached below is the test code to demonstrate, which is based on <TDengine>/docs/examples/c/tmq_example.c better compile with -g and use valgrind to test and get the leak report, otherwise leak might not be clearly discovered, because leak is so small(312 bytes for each call of tmq_consume_poll), you have to run long time to get OOM
Environment:
OS: [Linux xxh-VirtualBox 5.15.0-56-generic 62~20.04.1-Ubuntu SMP Tue Nov 22 21:24:20 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux]
TDengine Version [3.0.2.2]
I expect no memory leakage

Related

Issues trying to debug a kernel vmcore

One of our clients called us saying they had had a kernel crash and asked us to investigate. They are running SLES12 SP2.
I copied the vmcore file under /var/crash (11 Mb) out of production, onto another machine also running SLES12 SP2. I copied the image of the kernel /boot/vmlinux-4.4.120-92.70-default.gz too. I installed the kernel debuginfo package in this machine. However I'm unable to run the crash utility on it:
$ strings vmcore |grep "4\.4\."
4.4.120-92.70-default
OSRELEASE=4.4.120-92.70-default
BOOT_IMAGE=/boot/vmlinuz-4.4.120-92.70-default root=[…]
$ strings ~/vmlinux-4.4.120-92.70-default |grep "4\.4\."
Linux version 4.4.120-92.70-default (geeko#buildhost) (gcc version 4.8.5 (SUSE Linux) ) #1 SMP Wed Mar 14 15:59:43 UTC 2018 (52a83de)
$ crash /usr/lib/debug/boot/vmlinux-4.4.120-92.70-default.debug ~/vmlinux-4.4.120-92.70-default vmcore
crash 7.1.5
[…]
GNU gdb (GDB) 7.6
[…]
This GDB was configured as "x86_64-unknown-linux-gnu"...
WARNING: could not find MAGIC_START!
WARNING: cannot read linux_banner string
crash: /usr/lib/debug/boot/vmlinux-4.4.120-92.70-default.debug and vmcore do not match!
Usage: […]
I think the strings invocations above prove that the kernel and the core do match, however I'm still getting that error. What can I do next?

Self-compiled linux kernel can't boot on btrfs

I'm a newcomer for linux kernel development. This is second question about loading self-compiled kernel(current stable version 4.8.6). The error messages printed during booting are as below:
linux-05e3 mount[282]: mount: unknown filesystem type 'btrfs'
linux-05e3 systemd1: Dependency failed for Initrd Boot File System
linux-05e3 systemd1: Dependency failed for Reload Configuration
Actually the file system type of my root partition is 'btrfs', and it is no problem with kernel version 4.1.12.1-default.
My partition table is :
Result of uname -a is :
Linux linux-05e3 4.1.12-1-default #1 SMP PREEMPT Thu Oct 29 06:43:42
UTC 2015 (e24bad1) x86_64 x86_64 x86_64 GNU/Linux
The .config file is just copied from the one used for 4.1.12.1-default. And I've just ran make menuconfig with nothing modified after copying that file.
Can anyone give some useful tips to me. I really need a linux kernel development expert to give more instructions to me as a beginner. Thanks a million.

Getting "shared memory ID" error on Linux

Running this version of Linux:
Linux trhtmxslsp01b02 2.6.32-358.14.1.el6.x86_64 #1 SMP Mon Jun 17 15:54:20 EDT 2013 x86_64 x86_64 x86_64 GNU/Linux
I attempt to start a process but getting the following error
OpenShmMemory(): Cannot get shared memory ID, No such file or directory.
The app/process I'm running read the shared memory segment. I don't know how to troubleshoot this. This is a third party app. Can someone provide some guidance please?

Problems to start G-WAN

I try to install G-Wan on Ubuntu 12.04.1 LTS (x64).
I follow the fast instructions: http://gwan.com/download
When i execute $sudo ./gwan, shows me:
Floating point exception (core dumped)
Then i follow the slow instructions: http://www.as2.com/pdf/GWAN-Install-Manual-for-Ubuntu-12.04.pdf
but i have the same error.
I show you the errors of the logs:
apport.log
ERROR: apport (pid 13912) Mon Apr 29 13:42:56 2013: called for pid 13870, signal 8
ERROR: apport (pid 13912) Mon Apr 29 13:42:56 2013: executable: /opt/gwan_linux64-bit/gwan (command line "./gwan")
ERROR: apport (pid 13912) Mon Apr 29 13:42:56 2013: executable does not belong to a package, ignoring
syslog
Apr 29 13:43:48 ip-10-34-153-82 kernel: [1026847.541495] gwan[13914] trap divide error ip:427930 sp:7fff7208d7b8 error:0
Apr 29 13:43:53 ip-10-34-153-82 kernel: [1026852.993012] gwan[13958] trap divide error ip:427930 sp:7fffd2b82468 error:0
Please, Does anyone know what is the problem?
Install the program in my PC (Ubuntu 12.04.2 LTS) and works fine, i don't understand because in my PC works fine and in the server not.
Thanks for all and sorry, my english is bad.
The problem is that some newer versions of hypervisors insist to report ZERO CPU, and/or ZERO CPU Core, leading to a division by zero.
Since G-WAN is optimized for multicore architectures, it queries the CPUID instruction and the OS Kernel structures to check the platform architecture and the associated OS policies (number of online and allowed CPUs).
Other web servers are not affected because they expect users to manually configure and run as many instances as desired (hereby creating the duplicated resource allocations that G-WAN was designed to avoid).
Checking both the CPUID instruction and the Kernel structure was enough, until recently. Now, for any reason, the hypervisors use broken CPUID implementations and OS Kernel structure.
This issue is affecting hosting companies (VPS servers), and Amazon EC2 instances, among others.

libstdc++.so.6: cannot handle TLS data

I have an application compiled at:
gcc version 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)
Linux debian 2.6.18-5-686 #1 SMP Fri Jun 1 00:47:00 UTC 2007 i686 GNU/Linux
and it runs well.
Now I want to run it at:
Linux 2.4.20_mvlcge31-tomas #7 Thu May 7 11:33:21 CEST 2009 i686 unknown
I got following errors:
libstdc++.so.6: cannot handle TLS data
From the web I saw someone suggested to do this: export LD_ASSUME_KERNEL=2.2.5
I tried but get even more errors:
ls: error while loading shared libraries: librt.so.1: cannot open shared object file: No such file or directory
Who can help me with it? thanks
You had compiled the application against much newer libc and kernel version, You can't compile program on 2.6 with newest libc and expect it to run on old kernel.
Also where do you actually still use Linux 2.4?

Resources