PDA

View Full Version : Uncleare things with memore free()



Blitzor DDD
15th May 2017, 15:25
Hello, everyone!

I had an app working good on Win, then I translated it to Ubuntu. It also works okay, but when I close it, I got this message from Qt Creator below:


*** Error in `/home/ivan/build-visual_boltz-Desktop_Qt_5_8_0_GCC_64bit-Release/visual_boltz': free(): invalid pointer: 0x0000000002155490 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x777e5)[0x7fd210d027e5]
/lib/x86_64-linux-gnu/libc.so.6(+0x7fe0a)[0x7fd210d0ae0a]
/lib/x86_64-linux-gnu/libc.so.6(cfree+0x4c)[0x7fd210d0e98c]
/home/ivan/Qt/5.8/gcc_64/lib/libQt5Core.so.5(+0x93569)[0x7fd21167f569]
/home/ivan/Qt/5.8/gcc_64/lib/libQt5Core.so.5(+0x93629)[0x7fd21167f629]
/lib/x86_64-linux-gnu/libc.so.6(+0x39ff8)[0x7fd210cc4ff8]
/lib/x86_64-linux-gnu/libc.so.6(+0x3a045)[0x7fd210cc5045]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf7)[0x7fd210cab837]
/home/ivan/build-visual_boltz-Desktop_Qt_5_8_0_GCC_64bit-Release/visual_boltz[0x405db9]
======= Memory map: ========
00400000-0040f000 r-xp 00000000 fc:00 16517220 /home/ivan/build-visual_boltz-Desktop_Qt_5_8_0_GCC_64bit-Release/visual_boltz
0060f000-00610000 r--p 0000f000 fc:00 16517220 /home/ivan/build-visual_boltz-Desktop_Qt_5_8_0_GCC_64bit-Release/visual_boltz
00610000-00611000 rw-p 00010000 fc:00 16517220 /home/ivan/build-visual_boltz-Desktop_Qt_5_8_0_GCC_64bit-Release/visual_boltz

7fd21311d000-7fd213130000 rw-p 00000000 00:00 0
7fd213130000-7fd213131000 r--s 00000000 fc:00 9441977 /var/cache/fontconfig/b9d506c9ac06c20b433354fa67a72993-le64.cache-6
7fd213131000-7fd213132000 r--s 00000000 fc:00 9446948 /var/cache/fontconfig/551ecf3b0e8b0bca0f25c0944f561853-le64.cache-6
7fd213132000-7fd213133000 r--s 00000000 fc:00 9446947 /var/cache/fontconfig/30829fa25452a46451e813d634d7f916-le64.cache-6
7fd213133000-7fd21313e000 r--s 00000000 fc:00 9446945 /var/cache/fontconfig/83bf95040141907cd45bb53cf7c1c148-le64.cache-6
7fd21313e000-7fd213184000 r--p 00000000 fc:00 5505617 /usr/share/glib-2.0/schemas/gschemas.compiled
7fd213184000-7fd2131b3000 r--p 00000000 fc:00 5767550 /usr/share/locale-langpack/ru/LC_MESSAGES/libc.mo
7fd2131b3000-7fd213233000 r-xp 00000000 fc:00 17302022 /lib/x86_64-linux-gnu/libsystemd.so.0.14.0
7fd213233000-7fd213236000 r--p 0007f000 fc:00 17302022 /lib/x86_64-linux-gnu/libsystemd.so.0.14.0
7fd213236000-7fd213237000 rw-p 00082000 fc:00 17302022 /lib/x86_64-linux-gnu/libsystemd.so.0.14.0
7fd213237000-7fd21324a000 rw-p 00000000 00:00 0
7fd21324a000-7fd21324b000 r--s 00000000 fc:00 9441973 /var/cache/fontconfig/0c9eb80ebd1c36541ebe2852d3bb0c49-le64.cache-6
7fd21324b000-7fd21324e000 r--s 00000000 fc:00 9446946 /var/cache/fontconfig/75114ca45c98e8a441da0ff356701271-le64.cache-6
7fd21324e000-7fd213251000 r--s 00000000 fc:00 9438364 /var/cache/fontconfig/e13b20fdb08344e0e664864cc2ede53d-le64.cache-6
7fd213251000-7fd213255000 r--s 00000000 fc:00 9438328 /var/cache/fontconfig/7ef2298fde41cc6eeb7af42e48b7d293-le64.cache-6
7fd213255000-7fd213259000 r--p 00000000 fc:00 15754100 /home/ivan/.config/dconf/user
7fd213259000-7fd21325a000 r--s 00000000 00:2b 31 /run/user/1000/dconf/user
7fd21325a000-7fd213261000 r--s 00000000 fc:00 3935722 /usr/lib/x86_64-linux-gnu/gconv/gconv-modules.cache
7fd213261000-7fd213264000 rw-p 00000000 00:00 0
7fd213264000-7fd213265000 r--p 00025000 fc:00 17305957 /lib/x86_64-linux-gnu/ld-2.23.so
7fd213265000-7fd213266000 rw-p 00026000 fc:00 17305957 /lib/x86_64-linux-gnu/ld-2.23.so
7fd213266000-7fd213267000 rw-p 00000000 00:00 0
7ffc14b35000-7ffc14b56000 rw-p 00000000 00:00 0 [stack]
7ffc14bdf000-7ffc14be1000 r--p 00000000 00:00 0 [vvar]
7ffc14be1000-7ffc14be3000 r-xp 00000000 00:00 0 [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall]

What is the reason of that, how to handle it and can it cause new errors?

Thanks!

high_flyer
15th May 2017, 15:39
Run a debug version of the application in a debugger.
The debugger will stop on the offending line.

Blitzor DDD
15th May 2017, 15:52
Thank you for your reply.

But I cannot run a debugger because it works fine. no crush!
When I close myself Qt Creator gives these lines

high_flyer
15th May 2017, 16:49
This is a crash while shutting down your application.
Run it in a debugger, and close it the same way you do when you run it without a debugger.

d_stranz
15th May 2017, 19:42
This is a crash while shutting down your application.

This might be due to trying to delete an object instance that has already been deleted. If this is the same program with the QSplineSeries, setting the series on the chart causes the chart to take ownership of it. When the chart instance goes out of scope, it will delete the series. So if you are also deleting it, then that would probably cause the crash.