eclipse-paho / eclipse-paho/paho.mqtt.cpp

The loss of IP address on the client side will cause the program to crash

Open
#565 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
1.3k
Forks
476
PR merge metrics
No merged PRs in 30d

Description

After establishing a connection between the MQTT client and the server, if the client's network becomes unstable and the IP is lost, it may cause the program to crash:
/**********************************************************************************/
gdb run sample/async_subscribe.cpp

Connection success

Subscribing to topic 'test/pqq'
for client paho_cpp_async_subscribe using QoS1

Press Q to quit

Subscription success for token: [1]
token topic: 'test/pqq', ...

Program received signal SIGPIPE, Broken pipe.
[Switching to LWP 2998]
0x0000007ff3e4f518 in writev () from /apex/com.android.runtime/lib64/bionic/libc.so
(gdb) bt
#0 0x0000007ff3e4f518 in writev () from /apex/com.android.runtime/lib64/bionic/libc.so
#1 0x000000555557c108 in ?? ()
#2 0x000000555557c604 in ?? ()
#3 0x000000555557f594 in ?? ()
#4 0x000000555557194c in ?? ()
#5 0x0000005555571e3c in ?? ()
#6 0x0000005555570388 in ?? ()
#7 0x00000055555702cc in ?? ()
#8 0x0000005555570154 in ?? ()
#9 0x000000555556e4cc in MQTTAsync_receiveThread ()
#10 0x0000007ff3e63814 in __pthread_start(void*) () from /apex/com.android.runtime/lib64/bionic/libc.so
#11 0x0000007ff3e032f4 in __start_thread () from /apex/com.android.runtime/lib64/bionic/libc.so
(gdb)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the failure with gdb and sample/async_subscribe.cpp using the connection and subscription steps shown in the report. Inspect the SIGPIPE backtrace from MQTTAsync_receiveThread and determine the relevant client-side failure path. Done means the same network-loss scenario no longer crashes the program.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.