Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MQTTClient missing implementation to writecontinue #1286

Closed
cuttlfish opened this issue Nov 3, 2022 · 1 comment
Closed

MQTTClient missing implementation to writecontinue #1286

cuttlfish opened this issue Nov 3, 2022 · 1 comment
Milestone

Comments

@cuttlfish
Copy link

Describe the bug
Seeing a crash when sending large chunks of data > 1MB

To Reproduce
Send large chunk of data using MQTTClient.c instead of async mode. Get this backtrace

#0 0x0000000000000000 in ?? ()
#1 0x0000000000475eac in Socket_continueWrites (sock=0x7fc48969d4,
mutex=0x5ae5b0 <socket_mutex_store>)
at /local/users/dliu/basd3/out.example/_deps/paho-src/src/Socket.c:1412
#2 0x000000000047443c in Socket_getReadySocket (more_work=0, timeout=100,
mutex=0x5ae5b0 <socket_mutex_store>, rc=0x7fc4896a64)
at /local/users/dliu/basd3/out.example/_deps/paho-src/src/Socket.c:535
#3 0x0000000000468fc4 in MQTTClient_cycle (sock=0x7fc4896a60, timeout=100,
rc=0x7fc4896a64)
at /local/users/dliu/basd3/out.example/_deps/paho-src/src/MQTTClient.c:2558
#4 0x0000000000469dcc in MQTTClient_yield ()
at /local/users/dliu/basd3/out.example/_deps/paho-src/src/MQTTClient.c:2828
#5 0x00000000004689e0 in MQTTClient_publish5 (handle=0x2d2c9308,
topicName=0x7fc4896cd0 "bas-d-s/stb/6B8B4567327B23C6/transfer/response/download/CMH2BG9FTEK4NTFB", payloadlen=1051350, payload=0x7f7dcfd010, qos=1,
retained=0, properties=0x7fc4896cb8, deliveryToken=0x7fc4896c8c)
at /local/users/dliu/basd3/out.example/_deps/paho-src/src/MQTTClient.c:2429
#6 0x0000000000468d44 in MQTTClient_publishMessage5 (handle=0x2d2c9308,
topicName=0x7fc4896cd0 "bas-d-s/stb/6B8B4567327B23C6/transfer/response/download/CMH2BG9FTEK4NTFB", message=0x7fc4896c90, deliveryToken=0x7fc4896c8c)
--Type for more, q to quit, c to continue without paging--
at /local/users/dliu/basd3/out.example/_deps/paho-src/src/MQTTClient.c:2500

It seems MQTTAsync.c has a implementation for Socket_setWriteContinueCallback, but MQTTClient.c does not. So when sending large data over MQTTClient, this line crashes

int Socket_continueWrites(SOCKET* sock, mutex_type mutex)
{
...
if (rc == 0)
(*writecontinue)(socket);
...
}

Did not observe this crash in 1.3.10

Expected behavior
Not crash

Screenshots
If applicable, add screenshots to help explain your problem.

Log files
Please try to attach log files rather than pasting the log contents. It makes the issues easier to read.

** Environment (please complete the following information):**

  • OS: Linux
  • Version 1.3.11
@icraggs icraggs changed the title MQTTClient missing implementation to writecomplete MQTTClient missing implementation to writecontinue Nov 27, 2022
@icraggs icraggs added this to the 1.3.12 milestone Nov 27, 2022
@icraggs
Copy link
Contributor

icraggs commented Nov 27, 2022

Fix added to the develop branch.

@icraggs icraggs closed this as completed Dec 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants