mosquitto
mosquitto copied to clipboard
Memory Leaks Detected During Mosquitto Startup Failure
Problem descripton
AddressSanitizer detected 760 bytes memory leaks in 4 allocations when Mosquitto fails to bind ports. Memory leaks when service fails to start. Resource waste and potential stability issues.
mosquitto vesion
root@e700dc462edd:~/mosquitto# git log --oneline
28f91478 (HEAD -> master, origin/master, origin/HEAD) Update dependency list for coverity-scan-develop
Build environment
Ubuntu 20.04.6 LTS
Build command
make CC=/root/pcguard-cov/afl-clang-fast CXX=/root/pcguard-cov/afl-clang-fast++ \
CFLAGS="-fsanitize=address -fsanitize=undefined -g -O1" \
CXXFLAGS="-fsanitize=address -fsanitize=undefined -g -O1" \
LDFLAGS="-fsanitize=address -fsanitize=undefined" \
WITH_CJSON=no
Logs
root@e700dc462edd:~/shared/pit/test# /root/Peach/bin/peach ./mqtt.xml
[[ Peach v3.0
[[ Copyright (c) Michael Eddington
[*] Test 'Default' starting with random seed 50958.
[R1,-,-] Performing iteration
pc_guard: [INIT] bitmap has been allocted from addr 8241452 to 8434156 [ 48176 bits - ratio: 100%]
Shared Memory: /dev/shm/cov_bitmap_mqtt
1764127762: Warning: Unable to drop privileges to 'mosquitto' because this user does not exist. Trying 'nobody' instead.
1764127762: mosquitto version 2.0.22 starting
1764127762: Using default config.
1764127762: Starting in local only mode. Connections will only be possible from clients running on this machine.
1764127762: Create a configuration file which defines a listener to allow remote access.
1764127762: For more details see https://mosquitto.org/documentation/authentication-methods/
1764127762: Opening ipv4 listen socket on port 1883.
1764127762: Error: Address already in use
1764127762: Opening ipv6 listen socket on port 1883.
1764127762: Error: Address already in use
LLVMSymbolizer: error reading file: Permission denied
=================================================================
==164==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 736 byte(s) in 1 object(s) allocated from:
#0 0x498829 (/root/mosquitto/src/mosquitto+0x498829)
#1 0x59ae8e (/root/mosquitto/src/mosquitto+0x59ae8e)
#2 0x7fde6071e082 in __libc_start_main /build/glibc-B3wQXB/glibc-2.31/csu/../csu/libc-start.c:308:16
Direct leak of 16 byte(s) in 2 object(s) allocated from:
#0 0x4848b4 (/root/mosquitto/src/mosquitto+0x4848b4)
#1 0x59af6b (/root/mosquitto/src/mosquitto+0x59af6b)
#2 0x4c91e8 (/root/mosquitto/src/mosquitto+0x4c91e8)
#3 0x7fde6071e082 in __libc_start_main /build/glibc-B3wQXB/glibc-2.31/csu/../csu/libc-start.c:308:16
Direct leak of 8 byte(s) in 1 object(s) allocated from:
#0 0x498682 (/root/mosquitto/src/mosquitto+0x498682)
#1 0x59ac3e (/root/mosquitto/src/mosquitto+0x59ac3e)
#2 0x7fde6071e082 in __libc_start_main /build/glibc-B3wQXB/glibc-2.31/csu/../csu/libc-start.c:308:16
SUMMARY: AddressSanitizer: 760 byte(s) leaked in 4 allocation(s).