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

Error in `mosquitto_pub': double free or corruption (!prev): 0x0000000001be03f0 #1280

Closed
lucky-saini opened this issue May 15, 2019 · 5 comments

Comments

Projects
None yet
2 participants
@lucky-saini
Copy link

commented May 15, 2019

I'm on Ubuntu 16.04. And I'm getting mosquitto_pub double free or corruption error. Below is the command which I'm executing in my application

mosquitto_pub -t gateway/00000000-3ed57f60/task/request -f msg/install.json

And below is the error which I'm getting.

*** Error in `mosquitto_pub': double free or corruption (!prev): 0x0000000001be03f0 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x777e5)[0x7ff0a9a197e5]
/lib/x86_64-linux-gnu/libc.so.6(+0x8037a)[0x7ff0a9a2237a]
/lib/x86_64-linux-gnu/libc.so.6(cfree+0x4c)[0x7ff0a9a2653c]
mosquitto_pub[0x403263]
mosquitto_pub[0x4020d6]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0)[0x7ff0a99c2830]
mosquitto_pub[0x402229]
======= Memory map: ========
00400000-0040b000 r-xp 00000000 08:01 5769677                            /usr/bin/mosquitto_pub
0060a000-0060b000 r--p 0000a000 08:01 5769677                            /usr/bin/mosquitto_pub
0060b000-0060c000 rw-p 0000b000 08:01 5769677                            /usr/bin/mosquitto_pub
01bc0000-01c02000 rw-p 00000000 00:00 0                                  [heap]
7ff0a4000000-7ff0a4021000 rw-p 00000000 00:00 0 
7ff0a4021000-7ff0a8000000 ---p 00000000 00:00 0 
7ff0a88a3000-7ff0a88b9000 r-xp 00000000 08:01 6034212                    /lib/x86_64-linux-gnu/libgcc_s.so.1
7ff0a88b9000-7ff0a8ab8000 ---p 00016000 08:01 6034212                    /lib/x86_64-linux-gnu/libgcc_s.so.1
7ff0a8ab8000-7ff0a8ab9000 rw-p 00015000 08:01 6034212                    /lib/x86_64-linux-gnu/libgcc_s.so.1
7ff0a8ab9000-7ff0a8ac4000 r-xp 00000000 08:01 6039365                    /lib/x86_64-linux-gnu/libnss_files-2.23.so
7ff0a8ac4000-7ff0a8cc3000 ---p 0000b000 08:01 6039365                    /lib/x86_64-linux-gnu/libnss_files-2.23.so
7ff0a8cc3000-7ff0a8cc4000 r--p 0000a000 08:01 6039365                    /lib/x86_64-linux-gnu/libnss_files-2.23.so
7ff0a8cc4000-7ff0a8cc5000 rw-p 0000b000 08:01 6039365                    /lib/x86_64-linux-gnu/libnss_files-2.23.so
7ff0a8cc5000-7ff0a8ccb000 rw-p 00000000 00:00 0 
7ff0a8ccb000-7ff0a8cce000 r-xp 00000000 08:01 6039353                    /lib/x86_64-linux-gnu/libdl-2.23.so
7ff0a8cce000-7ff0a8ecd000 ---p 00003000 08:01 6039353                    /lib/x86_64-linux-gnu/libdl-2.23.so
7ff0a8ecd000-7ff0a8ece000 r--p 00002000 08:01 6039353                    /lib/x86_64-linux-gnu/libdl-2.23.so
7ff0a8ece000-7ff0a8ecf000 rw-p 00003000 08:01 6039353                    /lib/x86_64-linux-gnu/libdl-2.23.so
7ff0a8ecf000-7ff0a8ee7000 r-xp 00000000 08:01 6039355                    /lib/x86_64-linux-gnu/libpthread-2.23.so
7ff0a8ee7000-7ff0a90e6000 ---p 00018000 08:01 6039355                    /lib/x86_64-linux-gnu/libpthread-2.23.so
7ff0a90e6000-7ff0a90e7000 r--p 00017000 08:01 6039355                    /lib/x86_64-linux-gnu/libpthread-2.23.so
7ff0a90e7000-7ff0a90e8000 rw-p 00018000 08:01 6039355                    /lib/x86_64-linux-gnu/libpthread-2.23.so
7ff0a90e8000-7ff0a90ec000 rw-p 00000000 00:00 0 
7ff0a90ec000-7ff0a9307000 r-xp 00000000 08:01 6029317                    /lib/x86_64-linux-gnu/libcrypto.so.1.0.0
7ff0a9307000-7ff0a9506000 ---p 0021b000 08:01 6029317                    /lib/x86_64-linux-gnu/libcrypto.so.1.0.0
7ff0a9506000-7ff0a9522000 r--p 0021a000 08:01 6029317                    /lib/x86_64-linux-gnu/libcrypto.so.1.0.0
7ff0a9522000-7ff0a952e000 rw-p 00236000 08:01 6029317                    /lib/x86_64-linux-gnu/libcrypto.so.1.0.0
7ff0a952e000-7ff0a9531000 rw-p 00000000 00:00 0 
7ff0a9531000-7ff0a958f000 r-xp 00000000 08:01 6029394                    /lib/x86_64-linux-gnu/libssl.so.1.0.0
7ff0a958f000-7ff0a978f000 ---p 0005e000 08:01 6029394                    /lib/x86_64-linux-gnu/libssl.so.1.0.0
7ff0a978f000-7ff0a9793000 r--p 0005e000 08:01 6029394                    /lib/x86_64-linux-gnu/libssl.so.1.0.0
7ff0a9793000-7ff0a979a000 rw-p 00062000 08:01 6029394                    /lib/x86_64-linux-gnu/libssl.so.1.0.0
7ff0a979a000-7ff0a97a1000 r-xp 00000000 08:01 6039351                    /lib/x86_64-linux-gnu/librt-2.23.so
7ff0a97a1000-7ff0a99a0000 ---p 00007000 08:01 6039351                    /lib/x86_64-linux-gnu/librt-2.23.so
7ff0a99a0000-7ff0a99a1000 r--p 00006000 08:01 6039351                    /lib/x86_64-linux-gnu/librt-2.23.so
7ff0a99a1000-7ff0a99a2000 rw-p 00007000 08:01 6039351                    /lib/x86_64-linux-gnu/librt-2.23.so
7ff0a99a2000-7ff0a9b62000 r-xp 00000000 08:01 6039368                    /lib/x86_64-linux-gnu/libc-2.23.so
7ff0a9b62000-7ff0a9d62000 ---p 001c0000 08:01 6039368                    /lib/x86_64-linux-gnu/libc-2.23.so
7ff0a9d62000-7ff0a9d66000 r--p 001c0000 08:01 6039368                    /lib/x86_64-linux-gnu/libc-2.23.so
7ff0a9d66000-7ff0a9d68000 rw-p 001c4000 08:01 6039368                    /lib/x86_64-linux-gnu/libc-2.23.so
7ff0a9d68000-7ff0a9d6c000 rw-p 00000000 00:00 0 
7ff0a9d6c000-7ff0a9d83000 r-xp 00000000 08:01 5767327                    /usr/lib/x86_64-linux-gnu/libmosquitto.so.1
7ff0a9d83000-7ff0a9f82000 ---p 00017000 08:01 5767327                    /usr/lib/x86_64-linux-gnu/libmosquitto.so.1
7ff0a9f82000-7ff0a9f83000 r--p 00016000 08:01 5767327                    /usr/lib/x86_64-linux-gnu/libmosquitto.so.1
7ff0a9f83000-7ff0a9f84000 rw-p 00017000 08:01 5767327                    /usr/lib/x86_64-linux-gnu/libmosquitto.so.1
7ff0a9f84000-7ff0a9faa000 r-xp 00000000 08:01 6039354                    /lib/x86_64-linux-gnu/ld-2.23.so
7ff0aa183000-7ff0aa189000 rw-p 00000000 00:00 0 
7ff0aa1a8000-7ff0aa1a9000 rw-p 00000000 00:00 0 
7ff0aa1a9000-7ff0aa1aa000 r--p 00025000 08:01 6039354                    /lib/x86_64-linux-gnu/ld-2.23.so
7ff0aa1aa000-7ff0aa1ab000 rw-p 00026000 08:01 6039354                    /lib/x86_64-linux-gnu/ld-2.23.so
7ff0aa1ab000-7ff0aa1ac000 rw-p 00000000 00:00 0 
7ffc3c9bf000-7ffc3c9e0000 rw-p 00000000 00:00 0                          [stack]
7ffc3c9e7000-7ffc3c9ea000 r--p 00000000 00:00 0                          [vvar]
7ffc3c9ea000-7ffc3c9ec000 r-xp 00000000 00:00 0                          [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0                  [vsyscall]
Aborted (core dumped)

I'm stuck on this and not able to find any solution for this. I uninstall and reinstall mosquitto. But it shows me same error.

Thanks in Advance.

@ralight

This comment has been minimized.

Copy link
Contributor

commented May 21, 2019

Do you know what version of mosquitto_pub you are using? Try mosquitto_pub --help, or apt-cache policy mosquitto-clients if you installed from a package repository.

@lucky-saini

This comment has been minimized.

Copy link
Author

commented May 24, 2019

@ralight when I'm executing first command mosquitto_pub --help then it is showing me version 1.6.2

mosquitto_pub is a simple mqtt client that will publish a message on a single topic and exit.
mosquitto_pub version 1.6.2 running on libmosquitto 1.6.2.

And when I'm executing apt-cache policy mosquitto-clients command then getting this

mosquitto-clients:
  Installed: 1.6.2-0mosquitto1~xenial1
  Candidate: 1.6.2-0mosquitto2~xenial1
  Version table:
     1.6.2-0mosquitto2~xenial1 500
        500 http://ppa.launchpad.net/mosquitto-dev/mosquitto-ppa/ubuntu xenial/main amd64 Packages
 *** 1.6.2-0mosquitto1~xenial1 100
        100 /var/lib/dpkg/status
     1.6.2-0mosquitto1~jessie1 500
        500 https://repo.mosquitto.org/debian jessie/main amd64 Packages
     1.6.1-0mosquitto1~jessie1 500
        500 https://repo.mosquitto.org/debian jessie/main amd64 Packages
     1.5.8-0mosquitto1~jessie1 500
        500 https://repo.mosquitto.org/debian jessie/main amd64 Packages
     1.5.6-0mosquitto1~jessie1 500
        500 https://repo.mosquitto.org/debian jessie/main amd64 Packages
     1.5.5-0mosquitto1~jessie1 500
        500 https://repo.mosquitto.org/debian jessie/main amd64 Packages
     1.5.4-0mosquitto2~jessie1 500
        500 https://repo.mosquitto.org/debian jessie/main amd64 Packages
     1.5.4-0mosquitto1 500
        500 https://repo.mosquitto.org/debian jessie/main amd64 Packages
     1.5.4-0mosquitto1~jessie1 500
        500 https://repo.mosquitto.org/debian jessie/main amd64 Packages
     1.5.3-0mosquitto1~jessie1 500
        500 https://repo.mosquitto.org/debian jessie/main amd64 Packages
     1.5-0mosquitto2~jessie1 500
        500 https://repo.mosquitto.org/debian jessie/main amd64 Packages
     1.4.15-0mosquitto4~jessie1 500
        500 https://repo.mosquitto.org/debian jessie/main amd64 Packages
     1.4.8-1ubuntu0.16.04.6 500
        500 http://in.archive.ubuntu.com/ubuntu xenial-updates/universe amd64 Packages
        500 http://security.ubuntu.com/ubuntu xenial-security/universe amd64 Packages
     1.4.8-1build1 500
        500 http://in.archive.ubuntu.com/ubuntu xenial/universe amd64 Packages

I think this is the latest version.

@ralight

This comment has been minimized.

Copy link
Contributor

commented May 29, 2019

Thanks, I've just pushed a commit which fixes this and will be part of 1.6.3.

@lucky-saini

This comment has been minimized.

Copy link
Author

commented Jun 3, 2019

@ralight Thanks for update. One silly question, how can I update this on my Linux system?
Do I need to reinstall mosquitto?

@ralight

This comment has been minimized.

Copy link
Contributor

commented Jun 3, 2019

You could wait for 1.6.3, which will be released next when I'm back from holiday at the end of the week, or compile yourself. If you'd like to compile, but aren't sure how please ask.

@ralight ralight closed this in 1bafe0e Jun 18, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.