|
|
|
![]() |
|
Strumenti |
![]() |
#1 |
Member
Iscritto dal: Aug 2003
Messaggi: 202
|
[PYTHON] *** glibc detected *** python: free(): invalid pointer: 0xb7d99910 ***
Salve a tutti ho un errore quando chiamo sys.exit() in un programma python che mi crea non pochi problemi
l'errore è il seguente *** glibc detected *** python: free(): invalid pointer: 0xb7d99910 *** Qualcuno sa a cosa è dovuto? |
![]() |
![]() |
![]() |
#2 |
Senior Member
Iscritto dal: Dec 2005
Città: Istanbul
Messaggi: 1817
|
potrebbe essere un bug in un qualche modulo scritto in C...
che librerie/moduli stai usando ?
__________________
One of the conclusions that we reached was that the "object" need not be a primitive notion in a programming language; one can build objects and their behaviour from little more than assignable value cells and good old lambda expressions. —Guy Steele |
![]() |
![]() |
![]() |
#3 | |
Member
Iscritto dal: Aug 2003
Messaggi: 202
|
Quote:
import v4l da precisare che questo è il modulo ottenuto compilando pyv4l cioè v4l.c ho scoperto anche il punto all'interno del codice v4l.c precisamente riga 820 Codice:
v4l_setupCapture(videoobject *self) { if (ioctl(self->fd, VIDIOCGMBUF, &self->mbuf) < 0) return -1; //fprintf(stderr," mbuf: size=%d frames=%d\n", self->mbuf.size,self->mbuf.frames); self->map = mmap(0, self->mbuf.size, PROT_READ|PROT_WRITE, MAP_SHARED, self->fd, 0); //self->map = mmap(0, self->mbuf.size, PROT_READ, MAP_PRIVATE, self->fd, 0); if ((self->map == NULL) | (self->map == MAP_FAILED)) { PyErr_SetString(VideoError, "Error Memory Mapping device."); return -1; } Codice:
//self->map = mmap(0, self->mbuf.size, PROT_READ, MAP_PRIVATE, self->fd, 0); Codice:
self->map = mmap(0, self->mbuf.size, PROT_READ|PROT_WRITE, MAP_SHARED, self->fd, 0); il fatto è che su ubuntu dapper questo errore non me lo da ma su feasty sì che pazienza che ci vuole .... |
|
![]() |
![]() |
![]() |
#4 | |
Senior Member
Iscritto dal: Apr 2000
Città: Roma
Messaggi: 15625
|
Quote:
Riguardo la modifica MAP_PRIVATE -> MAP_SHARED, è un bug genuino che hai corretto. Ora scova la free e cambiala con la munmap. Nota che l'elenco dei bug non finisce qui; eccone un'altro (innocuo): Codice:
if ((self->map == NULL) | (self->map == MAP_FAILED)) {
__________________
0: or %edi, %ecx; adc %eax, (%edx); popf; je 0b-22; pop %ebx; fadds 0x56(%ecx); lds 0x56(%ebx), %esp; mov %al, %al andeqs pc, r1, #147456; blpl 0xff8dd280; ldrgtb r4, [r6, #-472]; addgt r5, r8, r3, ror #12 |
|
![]() |
![]() |
![]() |
#5 |
Senior Member
Iscritto dal: Apr 2000
Città: Roma
Messaggi: 15625
|
Nota infine che quel codice usa le vecchie API V4L1; alcuni device ormai supportano solo le V4L2.
__________________
0: or %edi, %ecx; adc %eax, (%edx); popf; je 0b-22; pop %ebx; fadds 0x56(%ecx); lds 0x56(%ebx), %esp; mov %al, %al andeqs pc, r1, #147456; blpl 0xff8dd280; ldrgtb r4, [r6, #-472]; addgt r5, r8, r3, ror #12 |
![]() |
![]() |
![]() |
#6 |
Senior Member
Iscritto dal: Apr 2000
Città: Roma
Messaggi: 15625
|
Umm non sono sicuro che sia così; 0xb7d99910 non è un indirizzo ottenibile con mmap (non è allineato alla pagina). Probabilmente si tratta di un bug diverso, forse un doppio free o un puntatore selvaggio. Forse valgrind può dirti di più.
__________________
0: or %edi, %ecx; adc %eax, (%edx); popf; je 0b-22; pop %ebx; fadds 0x56(%ecx); lds 0x56(%ebx), %esp; mov %al, %al andeqs pc, r1, #147456; blpl 0xff8dd280; ldrgtb r4, [r6, #-472]; addgt r5, r8, r3, ror #12 |
![]() |
![]() |
![]() |
#7 | |
Member
Iscritto dal: Aug 2003
Messaggi: 202
|
Quote:
cmq grazie 1000 |
|
![]() |
![]() |
![]() |
#8 | ||
Senior Member
Iscritto dal: Apr 2000
Città: Roma
Messaggi: 15625
|
Quote:
Quote:
![]()
__________________
0: or %edi, %ecx; adc %eax, (%edx); popf; je 0b-22; pop %ebx; fadds 0x56(%ecx); lds 0x56(%ebx), %esp; mov %al, %al andeqs pc, r1, #147456; blpl 0xff8dd280; ldrgtb r4, [r6, #-472]; addgt r5, r8, r3, ror #12 |
||
![]() |
![]() |
![]() |
#9 | |
Member
Iscritto dal: Aug 2003
Messaggi: 202
|
Quote:
1 come hai fatto a capire che quell'indirizzo di memoria non è ottenibile da mmap e 2 se devo ancora cambiare free con munmap... rifare io il modulo v4l2 lol bellissima questa ![]() |
|
![]() |
![]() |
![]() |
#10 | |
Member
Iscritto dal: Aug 2003
Messaggi: 202
|
Quote:
v4l.c:1323: error: too few arguments to function ‘munmap’ quindi ho rimesso free non ho capito bene inoltre a che big ti riferisci in questa riga Codice:
if ((self->map == NULL) | (self->map == MAP_FAILED)) { |
|
![]() |
![]() |
![]() |
#11 | |||||
Senior Member
Iscritto dal: Apr 2000
Città: Roma
Messaggi: 15625
|
Quote:
Quote:
Quote:
Quote:
Prima che fai ulteriori danni, quale free() stai toccando? Qualche riga di codice? Quote:
2) e comunque "|" -> "||" In ogni caso è innoquo, non cambia la funzionalità.
__________________
0: or %edi, %ecx; adc %eax, (%edx); popf; je 0b-22; pop %ebx; fadds 0x56(%ecx); lds 0x56(%ebx), %esp; mov %al, %al andeqs pc, r1, #147456; blpl 0xff8dd280; ldrgtb r4, [r6, #-472]; addgt r5, r8, r3, ror #12 |
|||||
![]() |
![]() |
![]() |
#12 | ||
Member
Iscritto dal: Aug 2003
Messaggi: 202
|
Quote:
Quote:
Codice:
free( self->conversion_buffer.data ); Codice:
free(self->conversion_buffer.data); |
||
![]() |
![]() |
![]() |
#13 | ||
Senior Member
Iscritto dal: Apr 2000
Città: Roma
Messaggi: 15625
|
Quote:
Quote:
Nota che basterebbero i simboli di debug del modulo che contiene la free() incriminata, a sapere di quale si tratta. C'è un modo per saperlo, comunque.
__________________
0: or %edi, %ecx; adc %eax, (%edx); popf; je 0b-22; pop %ebx; fadds 0x56(%ecx); lds 0x56(%ebx), %esp; mov %al, %al andeqs pc, r1, #147456; blpl 0xff8dd280; ldrgtb r4, [r6, #-472]; addgt r5, r8, r3, ror #12 |
||
![]() |
![]() |
![]() |
#14 |
Member
Iscritto dal: Aug 2003
Messaggi: 202
|
sì le fornisce... ma non ho proprio idea di quale modulo mi serve per il debug e su quale file lo devo andare a fare io ho provato facendo dbg python Main.py e mi ha dato l'errore che ti ho postato prima
|
![]() |
![]() |
![]() |
#15 | |
Senior Member
Iscritto dal: Apr 2000
Città: Roma
Messaggi: 15625
|
Quote:
Devi fare così; innanzitutto devi ottenere il backtrace della free tramite gdb: Codice:
gdb python (gdb) set args Main.py (gdb) run ...esecuzione del programma... *** glibc detected *** /usr/bin/python: free(): invalid pointer: 0x<indirizzo> *** Program received signal SIGABRT, Aborted. 0x<indirizzo> in raise () from /lib/libc.so.6 (gdb) where ...backtrace... Codice:
(gdb) where #0 0x.... in raise () from /lib/libc.so.6 #1 0x.... in abort () from /lib/libc.so.6 #2 0x.... in __libc_message () from /lib/libc.so.6 #3 0x.... in _int_free () from /lib/libc.so.6 #4 0x.... in free () from /lib/libc.so.6 #5 0x<INDIRIZZO> in ??? () #6 ecc. Senza chiudere gdb, apri un'altra console ed esegui pidof python Ti verrà restituito un numero, il pid del processo. Esamina quindi la sua mappa di memoria: cat /proc/[pid restituito da pidof]/maps e sarai in grado di associare l'indirizzo mostrato da gdb alla libreria corrispondente.
__________________
0: or %edi, %ecx; adc %eax, (%edx); popf; je 0b-22; pop %ebx; fadds 0x56(%ecx); lds 0x56(%ebx), %esp; mov %al, %al andeqs pc, r1, #147456; blpl 0xff8dd280; ldrgtb r4, [r6, #-472]; addgt r5, r8, r3, ror #12 |
|
![]() |
![]() |
![]() |
#16 | |
Member
Iscritto dal: Aug 2003
Messaggi: 202
|
Quote:
Codice:
(gdb) set args Main3.py (gdb) run Starting program: /usr/bin/python Main3.py (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) [Thread debugging using libthread_db enabled] [New Thread -1210136896 (LWP 11557)] (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) ---Type <return> to continue, or q <return> to quit--- (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) 281.jpeg 93.2330827068 93.984962406 94.7368421053 - TSBD2: 94.7368421053 *** glibc detected *** /usr/bin/python: free(): invalid pointer: 0xb7dd3910 *** |
|
![]() |
![]() |
![]() |
#17 |
Member
Iscritto dal: Aug 2003
Messaggi: 202
|
|
![]() |
![]() |
![]() |
#18 | |
Member
Iscritto dal: Aug 2003
Messaggi: 202
|
Quote:
Codice:
Program received signal SIGINT, Interrupt. [Switching to Thread -1210136896 (LWP 11557)] 0xffffe410 in __kernel_vsyscall () Codice:
(gdb) where #0 0xffffe410 in __kernel_vsyscall () #1 0xb7eca05e in ?? () from /lib/tls/i686/cmov/libc.so.6 #2 0xb7e598fe in ?? () from /lib/tls/i686/cmov/libc.so.6 Backtrace stopped: previous frame identical to this frame (corrupt stack?) |
|
![]() |
![]() |
![]() |
#19 | |
Member
Iscritto dal: Aug 2003
Messaggi: 202
|
Quote:
![]() ![]() ![]() ![]() ![]() ![]() |
|
![]() |
![]() |
![]() |
#20 | |
Senior Member
Iscritto dal: Apr 2000
Città: Roma
Messaggi: 15625
|
Quote:
__________________
0: or %edi, %ecx; adc %eax, (%edx); popf; je 0b-22; pop %ebx; fadds 0x56(%ecx); lds 0x56(%ebx), %esp; mov %al, %al andeqs pc, r1, #147456; blpl 0xff8dd280; ldrgtb r4, [r6, #-472]; addgt r5, r8, r3, ror #12 |
|
![]() |
![]() |
![]() |
Strumenti | |
|
|
Tutti gli orari sono GMT +1. Ora sono le: 05:30.