[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    Re: [PyQt] crash: *** glibc detected *** python: double free or
From:       Tom Kuiper <kuiper () jpl ! nasa ! gov>
Date:       2009-11-30 17:13:58
Message-ID: 4B13FD56.7050409 () jpl ! nasa ! gov
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Thank you, Alex. This kind of "fix" will not do for me as I am writing a 
program that is intended to run continuously, monitoring data 
acquisition, and will generally not be watched by anyone.  Unpredictable 
crashes are not acceptable.

I did see a comment to a similar posting in this list about six weeks 
ago in which Jason H-3 wrote  "GUI operations can only be done in the 
main thread. "Whether this is relevant or not, I certainly am breaking 
this rule, so I will try to restructure my code accordingly.

Since you have the problem in C and I have seen it reported in many 
different contexts, not just pyqt or even Python, I guess it is a 
serious bug, perhaps in glibc.  Since it is unpredictable, it may be 
hard to fix.  However, Travis Oliphant in the numpy list wrote on April 
17, 2008, that it had been fixed in a recent release.  I guess I have to 
wait for Debian to catch up.

Thanks for your response.

Tom

Aleksandar Nedeljkovic wrote:
> Did you try:
>
> export MALLOC_CHECK_ = 0.
>
> This is only temporary solution, you must review your code, because 
> somewhere in it there is double free of memory.
>
> I have same problem, in C,  I solve it with removing unnecessary 
> freeing of memory.
>
> Solution in first row will only hide the problem, when you test your 
> code with more serious cases, you will probably receive segmentation 
> fault.
>
> Hope this help.
>
>
>
> On Fri, Nov 27, 2009 at 11:54 PM, Tom Kuiper <kuiper@jpl.nasa.gov 
> <mailto:kuiper@jpl.nasa.gov>> wrote:
>
>     Greetings!
>
>     A pyQt4 application using QThread (I suspect this is relevant)
>     crashed unpredictably with the above error message.  Searching the
>     web I found this type of error in many diverse applications, not
>     just Python or pyqt4.  I could not find a clue to resolving this
>     problem.  I'm somewhat reluctant to post here the 120 lines of
>     diagnostics so here are some parts that I suspect are relevant:
>
>     *** glibc detected *** python: double free or corruption
>     (fasttop): 0x0a802370 ***
>     ======= Backtrace: =========
>     /lib/i686/cmov/libc.so.6[0xb7dd9624]
>     /lib/i686/cmov/libc.so.6(cfree+0x96)[0xb7ddb826]
>     /usr/lib/libstdc++.so.6(_ZdlPv+0x21)[0xb77142e1]
>     /usr/lib/libQtGui.so.4(_ZN7QRegion7cleanUpEPNS_11QRegionDataE+0x48)[0xb68e9558]
>     /usr/lib/libQtGui.so.4(_ZN7QRegionaSERKS_+0x3e)[0xb68e95ce]
>     ...
>     python(PyRun_SimpleFileExFlags+0x19a)[0x80ee00a]
>     python(Py_Main+0xc07)[0x8059327]
>     python(main+0x22)[0x80586f2]
>     /lib/i686/cmov/libc.so.6(__libc_start_main+0xe5)[0xb7d81455]
>     python[0x8058631]
>     ======= Memory map: ========
>     08048000-08143000 r-xp 00000000 08:01 1213624    /usr/bin/python2.5
>     08143000-08168000 rw-p 000fa000 08:01 1213624    /usr/bin/python2.5
>     08168000-0816e000 rw-p 08168000 00:00 0
>     094ce000-0ad3f000 rw-p 094ce000 00:00 0          [heap]
>     ...
>     b2c33000-b2c35000 r--s 00000000 08:01 8522271  
>      /var/cache/fontconfig/646addb8444faa74ee138aa00ab0b6a0-x86.cache-2
>     b2c35000-b2c38000 r--s 00000000 08:01 8522270  
>      /var/cache/fontconfig/dfe01fa16583a85Aborted
>
>     I'm running an up-to-date Debian lenny with a 2.6.26-1-686 i686
>     GNU/Linux kernel.
>
>     For any insights, many thanks.
>
>     Tom
>     _______________________________________________
>     PyQt mailing list    PyQt@riverbankcomputing.com
>     <mailto:PyQt@riverbankcomputing.com>
>     http://www.riverbankcomputing.com/mailman/listinfo/pyqt
>
>


[Attachment #5 (text/html)]

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Thank you, Alex. This kind of "fix" will not do for me as I am writing
a program that is intended to run continuously, monitoring data
acquisition, and will generally not be watched by anyone.&nbsp;
Unpredictable crashes are not acceptable.<br>
<br>
I did see a comment to a similar posting in this list about six weeks
ago in which Jason H-3 wrote&nbsp; <span class="ul-threaded"
 style="margin: 1em 0pt 0pt -20px;"><span class="connect" row-id="1"><span
 id="li1" class="li-threaded"><span id="ul1" class="ul-threaded"
 row-id="1"><span class="connect" row-id="2"><span id="li2"
 class="li-threaded"><span class="threaded"><span
 style="position: static; border-left-width: 3px;"
 class="no-bg-color post-border post-middle"><span loaded="true"
 id="post25898397" row-id="2"
 jsurl="/forum/ThreadTree$ViewPostJs.jtp?post=25898397&amp;user=870735&amp;maybePending=false"
  style="display: block;"><span>"GUI operations can only be done in the
main thread.
"</span></span></span></span></span></span></span></span></span></span>Whether
this is relevant or not, I certainly am breaking this rule, so I will
try to restructure my code accordingly.<br>
<br>
Since you have the problem in C and I have seen it reported in many
different contexts, not just pyqt or even Python, I guess it is a
serious bug, perhaps in glibc.&nbsp; Since it is unpredictable, it may be
hard to fix.&nbsp; However, Travis Oliphant in the numpy list wrote on April
17, 2008, that it had been fixed in a recent release.&nbsp; I guess I have
to wait for Debian to catch up.<br>
<br>
Thanks for your response.<br>
<br>
Tom<br>
<br>
Aleksandar Nedeljkovic wrote:
<blockquote
 cite="mid:e32970ca0911300507qf11cda9hbdab4a3250fb3d11@mail.gmail.com"
 type="cite">Did you try:
  <div><br>
  </div>
  <div>export MALLOC_CHECK_ = 0.</div>
  <div><br>
  </div>
  <div>This is only temporary solution, you must review your code,
because somewhere in it there is double free of memory.</div>
  <div><br>
  </div>
  <div>I have same problem, in C, &nbsp;I solve it with removing&nbsp;unnecessary
freeing of memory.</div>
  <div><br>
  </div>
  <div>Solution in first row will only hide the problem, when you test
your code with more serious cases, you will probably receive
segmentation fault.</div>
  <div><br>
  </div>
  <div>Hope this help.</div>
  <div><br>
  </div>
  <div><br>
  <br>
  <div class="gmail_quote">On Fri, Nov 27, 2009 at 11:54 PM, Tom Kuiper
  <span dir="ltr">&lt;<a moz-do-not-send="true"
 href="mailto:kuiper@jpl.nasa.gov">kuiper@jpl.nasa.gov</a>&gt;</span>
wrote:<br>
  <blockquote class="gmail_quote"
 style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; \
padding-left: 1ex;">Greetings!<br>  <br>
A pyQt4 application using QThread (I suspect this is relevant) crashed
unpredictably with the above error message. &nbsp;Searching the web I found
this type of error in many diverse applications, not just Python or
pyqt4. &nbsp;I could not find a clue to resolving this problem. &nbsp;I'm
somewhat reluctant to post here the 120 lines of diagnostics so here
are some parts that I suspect are relevant:<br>
    <br>
*** glibc detected *** python: double free or corruption (fasttop):
0x0a802370 ***<br>
======= Backtrace: =========<br>
/lib/i686/cmov/libc.so.6[0xb7dd9624]<br>
/lib/i686/cmov/libc.so.6(cfree+0x96)[0xb7ddb826]<br>
/usr/lib/libstdc++.so.6(_ZdlPv+0x21)[0xb77142e1]<br>
/usr/lib/libQtGui.so.4(_ZN7QRegion7cleanUpEPNS_11QRegionDataE+0x48)[0xb68e9558]<br>
/usr/lib/libQtGui.so.4(_ZN7QRegionaSERKS_+0x3e)[0xb68e95ce]<br>
...<br>
python(PyRun_SimpleFileExFlags+0x19a)[0x80ee00a]<br>
python(Py_Main+0xc07)[0x8059327]<br>
python(main+0x22)[0x80586f2]<br>
/lib/i686/cmov/libc.so.6(__libc_start_main+0xe5)[0xb7d81455]<br>
python[0x8058631]<br>
======= Memory map: ========<br>
08048000-08143000 r-xp 00000000 08:01 1213624 &nbsp; &nbsp;/usr/bin/python2.5<br>
08143000-08168000 rw-p 000fa000 08:01 1213624 &nbsp; &nbsp;/usr/bin/python2.5<br>
08168000-0816e000 rw-p 08168000 00:00 0<br>
094ce000-0ad3f000 rw-p 094ce000 00:00 0 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[heap]<br>
...<br>
b2c33000-b2c35000 r--s 00000000 08:01 8522271 &nbsp;
&nbsp;/var/cache/fontconfig/646addb8444faa74ee138aa00ab0b6a0-x86.cache-2<br>
b2c35000-b2c38000 r--s 00000000 08:01 8522270 &nbsp;
&nbsp;/var/cache/fontconfig/dfe01fa16583a85Aborted<br>
    <br>
I'm running an up-to-date Debian lenny with a 2.6.26-1-686 i686
GNU/Linux kernel.<br>
    <br>
For any insights, many thanks.<br>
    <br>
Tom<br>
_______________________________________________<br>
PyQt mailing list &nbsp; &nbsp;<a moz-do-not-send="true"
 href="mailto:PyQt@riverbankcomputing.com" \
target="_blank">PyQt@riverbankcomputing.com</a><br>  <a moz-do-not-send="true"
 href="http://www.riverbankcomputing.com/mailman/listinfo/pyqt"
 target="_blank">http://www.riverbankcomputing.com/mailman/listinfo/pyqt</a><br>
  </blockquote>
  </div>
  <br>
  </div>
</blockquote>
<br>
</body>
</html>



_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic