PDA

View Full Version : Problem with malloc



Momergil
15th August 2011, 15:14
Hello!

Since recent times I don't stop receiving messages of malloc problems in my software. Here is one example:


*** glibc detected *** /home/martin/Documentos/Programas Qt/Servidor 3.5.v3/Servidor: malloc(): smallbin double linked list corrupted: 0x08bc9e60 ***

This "double linked list corrupted" is one of the most common ones. What is strange is that some times the software runs without problems and in others, without changing the code, it works.

Does somebody knows what this malloc messages means?

What is even more interesting is that the errors occur in different parts of the program,making it hard to see exactly where the problem is. Sometimes it runs till a considerable portion, but in others it doesn't make to much. In my last try, another error appeared:

*** glibc detected *** /home/martin/Documentos/Programas Qt/Servidor 3.5.v3/Servidor: malloc(): smallbin double linked list corrupted: 0x0a0020f8 ***


Thanks!

P.s.: the complete error message:

*** glibc detected *** /home/martin/Documentos/Programas Qt/Servidor 3.5.v3/Servidor: malloc(): smallbin double linked list corrupted: 0x08bc9e60 ***
======= Backtrace: =========
/lib/tls/i686/cmov/libc.so.6(+0x6b591)[0x9eb591]
/lib/tls/i686/cmov/libc.so.6(+0x6e710)[0x9ee710]
/lib/tls/i686/cmov/libc.so.6(__libc_malloc+0x5c)[0x9eff9c]
/home/martin/QtSDK/Desktop/Qt/473/gcc/lib/libQtCore.so.4(_Z7qMallocj+0x1d)[0x17b96d]
/home/martin/QtSDK/Desktop/Qt/473/gcc/lib/libQtCore.so.4(_ZN10QByteArrayC1EiN2Qt14Initializa tionE+0x2b)[0x184f2b]
/home/martin/QtSDK/Desktop/Qt/473/gcc/lib/libQtCore.so.4(+0x1c0ce8)[0x2d0ce8]
/home/martin/QtSDK/Desktop/Qt/473/gcc/lib/libQtCore.so.4(_ZNK10QTextCodec11fromUnicodeERK7QS tring+0x39)[0x2c9ab9]
/home/martin/QtSDK/Desktop/Qt/473/gcc/lib/libQtCore.so.4(_ZNK7QString11toLocal8BitEv+0x3b)[0x1d92eb]
/home/martin/QtSDK/Desktop/Qt/473/gcc/lib/libQtCore.so.4(+0x107d19)[0x217d19]
/home/martin/QtSDK/Desktop/Qt/473/gcc/lib/libQtCore.so.4(_ZN5QFile10encodeNameERK7QString+0x 2c)[0x217b7c]
/home/martin/QtSDK/Desktop/Qt/473/gcc/lib/libQtCore.so.4(+0x155b42)[0x265b42]
/home/martin/QtSDK/Desktop/Qt/473/gcc/lib/libQtCore.so.4(_ZN13QFSFileEngineC1ERK7QString+0x9 4)[0x25fc64]
/home/martin/QtSDK/Desktop/Qt/473/gcc/lib/libQtCore.so.4(_ZN19QAbstractFileEngine6createERK7 QString+0xbf)[0x20864f]
/home/martin/QtSDK/Desktop/Qt/473/gcc/lib/libQtCore.so.4(_ZN9QFileInfoC1ERK7QString+0x34)[0x21ec34]
/home/martin/QtSDK/Desktop/Qt/473/gcc/lib/libQtCore.so.4(_ZN5QFile6existsERK7QString+0x2c)[0x217e3c]
/home/martin/QtSDK/Desktop/Qt/473/gcc/lib/libQtCore.so.4(_ZNK4QDir6existsERK7QString+0x61)[0x20d551]
/home/martin/Documentos/Programas Qt/Servidor 3.5.v3/Servidor[0x8054113]
/home/martin/Documentos/Programas Qt/Servidor 3.5.v3/Servidor[0x80538a8]
/home/martin/Documentos/Programas Qt/Servidor 3.5.v3/Servidor[0x80526db]
/home/martin/QtSDK/Desktop/Qt/473/gcc/lib/libQtNetwork.so.4(+0xcde60)[0x6e5e60]
/home/martin/QtSDK/Desktop/Qt/473/gcc/lib/libQtNetwork.so.4(+0xb3a3b)[0x6cba3b]
/home/martin/QtSDK/Desktop/Qt/473/gcc/lib/libQtNetwork.so.4(+0xb4caf)[0x6cccaf]
/home/martin/QtSDK/Desktop/Qt/473/gcc/lib/libQtGui.so.4(_ZN19QApplicationPrivate13notify_hel perEP7QObjectP6QEvent+0xbc)[0xeddd7c]


etc.

Added after 1 53 minutes:

Another constant problem:


Servidor: malloc.c:4630: _int_malloc: Assertion `(unsigned long)(size) >= (unsigned long)(nb)' failed.

ChrisW67
16th August 2011, 00:05
It means that the internal data that malloc uses to track memory allocations is being corrupted. This is most likely the result of your program performing out-of-bounds accesses on raw memory blocks allocated by malloc. The triggering event is related to line 19 in the back trace. You should run a debug version in the debugger to find out what that region of you code is doing.

Momergil
21st August 2011, 17:12
It means that the internal data that malloc uses to track memory allocations is being corrupted. This is most likely the result of your program performing out-of-bounds accesses on raw memory blocks allocated by malloc. The triggering event is related to line 19 in the back trace. You should run a debug version in the debugger to find out what that region of you code is doing.

Thanks, Chris. I was able to solve the problem.

God bless.