#2401 Le 01/11/2012, à 23:25
- tshirtman
Re : /* Topic des codeurs [7] */
Je suis assez d'accord, mais si c'est dans le style du code python alors
oui, ça compile, je teste le déploiement sur android à l'instant même… crash, on va voir ce qui va pas…
17485 dalvikvm W threadid=11: thread exiting with uncaught exception (group=0x40a601f8)
17485 AndroidRuntime E FATAL EXCEPTION: Thread-4284
17485 AndroidRuntime E java.lang.UnsatisfiedLinkError: Cannot load library: reloc_library[1285]: 76 ca
nnot locate 'X509_NAME_entry_count'...
17485 AndroidRuntime E
17485 AndroidRuntime E at java.lang.Runtime.loadLibrary(Runtime.java:370)
17485 AndroidRuntime E at java.lang.System.loadLibrary(System.java:535)
17485 AndroidRuntime E at org.renpy.android.PythonActivity.run(PythonActivity.java:220)
17485 AndroidRuntime E at java.lang.Thread.run(Thread.java:856)
hum, c'est nouveau ça…
edit: oui j'ai openssl dans la distribution aussi…
Dernière modification par tshirtman (Le 01/11/2012, à 23:28)
Hors ligne
#2402 Le 01/11/2012, à 23:41
- grim7reaper
Re : /* Topic des codeurs [7] */
(N’empêche que mettre directement un return économiserait deux lignes et me paraît plus clair.
)
Ouais, mais en C je deteste sortir d’une fonction en plein milieu.
Et j’évite autant que possible de multiplier les points de sortie, c’est casse-couille quand tu débugues (en plus d’être moins lisible). Là j’en ai deux, et tout les deux en fin : sortie normale, sortie erreur. Nickel.
Là c’est vrai que les return c’est jouable, mais bon je reste cohérent avec moi-même.
@tshirtman : ça vient d’où ça ? C’est un autre module Python blacklisté que tu as activé ou ça vient d’ailleurs ?
En tout cas, ça vient pas de multiprocessing on va dire que c’est rassurant.
Hors ligne
#2403 Le 01/11/2012, à 23:46
- tshirtman
Re : /* Topic des codeurs [7] */
Oui, je pense avoir trouvé d'ou ça vient, heureusement que git status/git diff est là pour me dire les conneries que j'ai fait depuis 2 jours (dont une nuit blanche ^^)
edit: oui j'avais touché à des trucs en rapport avec ssl par ce que la lib que j'utilise l'importe, mais j'utilise pas cette option, donc zou, on commente l'import pour l'instant…
Dernière modification par tshirtman (Le 02/11/2012, à 00:13)
Hors ligne
#2404 Le 02/11/2012, à 00:39
- tshirtman
Re : /* Topic des codeurs [7] */
Bon, ça démarre, ça importe, mais ça crash très vite, huhu:
OSError: [Errno 75] Value too large for defined data type
dans "multiprocessing/queues.py" ligne 118, qui est… wait for it… un self._sem.release()
je vais essayer de comprendre, mais comme d'hab, idées bienvenues
Hors ligne
#2405 Le 02/11/2012, à 00:56
- Steap
Re : /* Topic des codeurs [7] */
Bon, ça démarre, ça importe, mais ça crash très vite, huhu:
OSError: [Errno 75] Value too large for defined data typedans "multiprocessing/queues.py" ligne 118, qui est… wait for it… un self._sem.release()
je vais essayer de comprendre, mais comme d'hab, idées bienvenues
Dans les sources de Python, dans Modules/_multiprocessing/semaphore.c, dans la fonction semlock_release(), on peut lire :
if (sem_post(self->handle) < 0) {
PyErr_SetFromErrno(PyExc_OSError);
return NULL;
}
Et sem_post peut mettre errno à EOVERFLOW:
The maximum allowable value for a semaphore would be exceeded.
Ca me semble être une piste intéressante.
GNU Guix, un gestionnaire de paquets fonctionnel.
Hors ligne
#2406 Le 02/11/2012, à 01:05
- tshirtman
Re : /* Topic des codeurs [7] */
En fait, il y a plusieurs OSError possibles dans cette fonction, j'étais en train d'essayer de déterminer laquelle se produit, mais mon puts ne va pas dans les logs apparement, ou alors c'est pas là…
Hors ligne
#2407 Le 02/11/2012, à 01:09
- Steap
Re : /* Topic des codeurs [7] */
En fait, il y a plusieurs OSError possibles dans cette fonction, j'étais en train d'essayer de déterminer laquelle se produit, mais mon puts ne va pas dans les logs apparement, ou alors c'est pas là…
Oui, mais il me semble que la seule fonction qui puisse mettre errno à EOVERFLOW est sem_post().
Sinon, rien à voir, mais j'essaye de lancer la suite de tests de python-psutil (http://code.google.com/p/psutil/) et ça donne :
$ python setup.py test
running test
$
Je dois rater une subtilité de setuptools. Une idée ?
GNU Guix, un gestionnaire de paquets fonctionnel.
Hors ligne
#2408 Le 02/11/2012, à 01:15
- tshirtman
Re : /* Topic des codeurs [7] */
Hum, j'aime pas setuptools, c'est pleins de bizarreries, et j'ai pas envie d'apprendre, ils sont en train de tout refaire avec distutils 2, y'aura setup.cfg à la place, et ce sera plus simple, donc je dirais, lance directement
python tests/test_psutil.py
(qui appellera le bon fichier _*.py en fonction de ton os)
Dernière modification par tshirtman (Le 02/11/2012, à 01:15)
Hors ligne
#2409 Le 02/11/2012, à 01:47
- Steap
Re : /* Topic des codeurs [7] */
Ouais, spa très joli
Belle floppée d'erreurs, je vais aller me refaire du café.
GNU Guix, un gestionnaire de paquets fonctionnel.
Hors ligne
#2410 Le 02/11/2012, à 02:08
- tshirtman
Re : /* Topic des codeurs [7] */
@grim
+SEM_CREATE(name, val, max)
J'avais pas tiqué en appliquand ton patch, mais ça m'étonne un peu de toi… pas de types aux arguments? mon vim me prévient que ça supposera int, mais est-ce vraiment une bonne idée?
Hors ligne
#2411 Le 02/11/2012, à 02:21
- Steap
Re : /* Topic des codeurs [7] */
@grim
+SEM_CREATE(name, val, max)
J'avais pas tiqué en appliquand ton patch, mais ça m'étonne un peu de toi… pas de types aux arguments? mon vim me prévient que ça supposera int, mais est-ce vraiment une bonne idée?
Il me semble que grim a bien précisé "+static sem_t*"
GNU Guix, un gestionnaire de paquets fonctionnel.
Hors ligne
#2412 Le 02/11/2012, à 02:27
- tshirtman
Re : /* Topic des codeurs [7] */
ça c'est le type de retour, non, pas le type des arguments?
en tout cas, bonne nuit… je creuse plus demain…
Hors ligne
#2413 Le 02/11/2012, à 02:36
- Steap
Re : /* Topic des codeurs [7] */
Oui. Il serait peut-être temps que j'aille dormir aussi, en fait
GNU Guix, un gestionnaire de paquets fonctionnel.
Hors ligne
#2414 Le 02/11/2012, à 04:40
- grim7reaper
Re : /* Topic des codeurs [7] */
Ha ouais, je devais être crevé aussi hier.
J’ai modifié les macros en fonctions comme j’ai dit, mais j’ai manqué un bout on dirait.
Autant j’ai tout bien fait pour SEM_CLOSE, autant j’ai fait le boulot à 50% pour SEM_CREATE.
Bon bah la déclaration c’est :
static sem_t*
SEM_CREATE(const char *name, int val, int max)
Sinon au sujet de l’erreur, on est toujours en « broken sem_getvalue » ?
Ça dans l’idéal, faudrait plus qu’on y soit je pense.
Dernière modification par grim7reaper (Le 02/11/2012, à 04:42)
Hors ligne
#2415 Le 02/11/2012, à 12:37
- tshirtman
Re : /* Topic des codeurs [7] */
Ok, je change ça
Pour HAVE_BROKEN_SEM_GETVALUE, je viens de regarder config.log, elle semble toujours définie à 1… mais pour voir, j'ai recompilé en inversant le test dans semlock_release (ifdef → ifndef) et ça ne change rien au crash qu'on obtiens.
Hors ligne
#2416 Le 05/11/2012, à 17:28
- Dr Le Rouge
Re : /* Topic des codeurs [7] */
ergoemacs-keybindings, ça a l'air de poutrer
C'est deux suites de Cauchy qui veulent aller à la soirée 'no limit'. Hélas, à l'entrée le videur leur dit : "désolé, c'est complet !".
mon site perso (π²/6.fr) et mon blog
Hors ligne
#2417 Le 06/11/2012, à 02:18
- tshirtman
Re : /* Topic des codeurs [7] */
(gdb) target remote ct07:5050
Remote debugging using ct07:5050
warning: Unable to find dynamic linker breakpoint function.
GDB will be unable to debug shared library initializers
and track explicitly loaded dynamic code.
0x40056f48 in ?? ()
(gdb) list
Cannot access memory at address 0x1
15 * exceptions by default. Here we disable them.
16 */
17 #ifdef __FreeBSD__
18 fp_except_t m;
19
20 m = fpgetmask();
21 fpsetmask(m & ~FP_X_OFL);
22 #endif
23 return Py_Main(argc, argv);
24 }
(gdb) n
Cannot find bounds of current function
(gdb) b
Breakpoint 1 at 0x40056f48
(gdb) c
Continuing.
Breakpoint 1, 0x40056f48 in ?? ()
(gdb) list
Line number 25 out of range; ./Modules/python.c has 24 lines.
(gdb) list
Line number 25 out of range; ./Modules/python.c has 24 lines.
(gdb) list 24
19
20 m = fpgetmask();
21 fpsetmask(m & ~FP_X_OFL);
22 #endif
23 return Py_Main(argc, argv);
24 }
(gdb) list 0
1 /* Minimal main program -- everything is loaded from the library */
2
3 #include "Python.h"
4
5 #ifdef __FreeBSD__
6 #include <floatingpoint.h>
7 #endif
8
9 int
10 main(int argc, char **argv)
(gdb) up
Cannot access memory at address 0x0
#1 0x5b96138c in ?? ()
(gdb) list
11 {
12 /* 754 requires that FP exceptions run in "no stop" mode by default,
13 * and until C vendors implement C99's ways to control FP exceptions,
14 * Python requires non-stop mode. Alas, some platforms enable FP
15 * exceptions by default. Here we disable them.
16 */
17 #ifdef __FreeBSD__
18 fp_except_t m;
19
20 m = fpgetmask();
(gdb) up
Cannot access memory at address 0x0
#2 0x5b96138c in ?? ()
(gdb) list
21 fpsetmask(m & ~FP_X_OFL);
22 #endif
23 return Py_Main(argc, argv);
24 }
(gdb) list
Line number 25 out of range; ./Modules/python.c has 24 lines.
(gdb) up
Cannot access memory at address 0x0
Initial frame selected; you cannot go up.
(gdb) down
#1 0x5b96138c in ?? ()
(gdb) down
#0 0x40056f48 in ?? ()
(gdb)
Bottom (innermost) frame selected; you cannot go down.
(gdb)
Bottom (innermost) frame selected; you cannot go down.
(gdb)
Bottom (innermost) frame selected; you cannot go down.
(gdb) list
Line number 25 out of range; ./Modules/python.c has 24 lines.
(gdb) list 0
1 /* Minimal main program -- everything is loaded from the library */
2
3 #include "Python.h"
4
5 #ifdef __FreeBSD__
6 #include <floatingpoint.h>
7 #endif
8
9 int
10 main(int argc, char **argv)
(gdb) list 10
5 #ifdef __FreeBSD__
6 #include <floatingpoint.h>
7 #endif
8
9 int
10 main(int argc, char **argv)
11 {
12 /* 754 requires that FP exceptions run in "no stop" mode by default,
13 * and until C vendors implement C99's ways to control FP exceptions,
14 * Python requires non-stop mode. Alas, some platforms enable FP
(gdb) list 20
15 * exceptions by default. Here we disable them.
16 */
17 #ifdef __FreeBSD__
18 fp_except_t m;
19
20 m = fpgetmask();
21 fpsetmask(m & ~FP_X_OFL);
22 #endif
23 return Py_Main(argc, argv);
24 }
(gdb) s
Cannot find bounds of current function
(gdb) c
Continuing.
Program received signal SIGTERM, Terminated.
0x40056f48 in ?? ()
(gdb) bt
#0 0x40056f48 in ?? ()
Cannot access memory at address 0x0
#1 0x5b96138c in ?? ()
Cannot access memory at address 0x0
#2 0x5b96138c in ?? ()
Cannot access memory at address 0x0
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
(gdb) list
Line number 25 out of range; ./Modules/python.c has 24 lines.
(gdb) list 23
18 fp_except_t m;
19
20 m = fpgetmask();
21 fpsetmask(m & ~FP_X_OFL);
22 #endif
23 return Py_Main(argc, argv);
24 }
(gdb) k
Kill the program being debugged? (y or n) y
gabriel@tochange:~/android-ndk-r8b/toolchains/arm-linux-androideabi-4.4.3$ ./prebuilt/linux-x86/bin/arm-linux-androideabi-gdb ~/python-for-android/build/python/Python-2.7.2/python
GNU gdb (GDB) 7.3.1-gg2
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=x86_64-linux-gnu --target=arm-linux-android".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/gabriel/python-for-android/build/python/Python-2.7.2/python...done.
(gdb) target remote ct07:5050
Remote debugging using ct07:5050
warning: Unable to find dynamic linker breakpoint function.
GDB will be unable to debug shared library initializers
and track explicitly loaded dynamic code.
0x40056f48 in ?? ()
(gdb) list
Cannot access memory at address 0x1
15 * exceptions by default. Here we disable them.
16 */
17 #ifdef __FreeBSD__
18 fp_except_t m;
19
20 m = fpgetmask();
21 fpsetmask(m & ~FP_X_OFL);
22 #endif
23 return Py_Main(argc, argv);
24 }
(gdb) info threads
[New Thread 3290]
Id Target Id Frame
2 Thread 3290 0x40057d44 in ?? ()
* 1 Thread 3289 0x40056f48 in ?? ()
Cannot access memory at address 0x1
(gdb) thread 2
[Switching to thread 2 (Thread 3290)]
#0 0x40057d44 in ?? ()
(gdb) list
Line number 25 out of range; ./Modules/python.c has 24 lines.
(gdb) continue
Continuing.
Cannot access memory at address 0x0
Program received signal SIGTERM, Terminated.
[Switching to Thread 3289]
0x40056f48 in ?? ()
(gdb)
Continuing.
Cannot access memory at address 0x1
Program terminated with signal SIGTERM, Terminated.
The program no longer exists.
(gdb) info line
Line 24 of "./Modules/python.c" starts at address 0x8530 <main> and ends at 0x8534.
(gdb) list
Line number 25 out of range; ./Modules/python.c has 24 lines.
(gdb)
pfff… je comprends rien… soit le gdb est encore pété (j'ai lu que c'était le cas dans le ndkr7 et r8, là j'ai le r8b, et ils prétendent avoir fixé des trucs pour gdb (d'après le changelog)), soit je loupe complètement quelque chose >_>
Pourquoi mon programme continue à tourner quel que soit le thread sur lequel je suis, même quand je fait pas "continue"? pourquoi je peut pas aller à l'endroid ou ça crash? est-ce qu'il me manque des symboles?
Promis, quand je comprends comment marche tout ça, je fais un article, par ce que c'est vraiment le bordel gdb en distant avec android je trouve…
Ah, sinon, la découverte du jour, on peut ajouter ".js" à la fin d'un gist, et insérer ça dans une page(<script src=…></script>), ça fait un joli gist embed…
edit: ok, ça va un peu mieux en prenant le bon fichier de symboles, en s'arrangeant pour qu'il soit pas strippé…
re-edit: suite de mes pérégrinations…
gabriel@tochange:~/android-ndk-r8b/toolchains/arm-linux-androideabi-4.4.3$ ./prebuilt/linux-x86/bin/arm-linux-androideabi-gdb ~/python-for-android/dist/goulbi/private/libpymodules.so
GNU gdb (GDB) 7.3.1-gg2
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=x86_64-linux-gnu --target=arm-linux-android".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/gabriel/python-for-android/dist/goulbi/private/libpymodules.so...done.
(gdb) set solib-absolute-prefix /home/gabriel/python-for-android/dist/goulbi/private/lib/python2.7/lib-dynload/
(gdb) set solib-search-path /home/gabriel/python-for-android/dist/goulbi/private/lib/python2.7/lib-dynload/
(gdb) target remote ct07:5050
Remote debugging using ct07:5050
warning: Could not load shared library symbols for 80 libraries, e.g. /system/bin/linker.
Use the "info sharedlibrary" command to see the complete listing.
Do you need "set solib-search-path" or "set sysroot"?
warning: Unable to find dynamic linker breakpoint function.
GDB will be unable to debug shared library initializers
and track explicitly loaded dynamic code.
0x40057b3c in ?? ()
(gdb) b /home/gabriel/python-for-android/build/python-install/Quit
(gdb)
(gdb) c
Continuing.
^C
Program received signal SIGINT, Interrupt.
0x40057b3c in ?? ()
(gdb) i t
Ambiguous info command "t": target, tasks, terminal, threads, tp, tracepoints, tvariables, types.
(gdb) i th
[New Thread 6995]
[New Thread 6998]
[New Thread 6999]
[New Thread 7000]
[New Thread 7001]
[New Thread 7002]
[New Thread 7003]
[New Thread 7004]
[New Thread 7005]
[New Thread 7007]
[New Thread 7008]
Id Target Id Frame
12 Thread 7008 0x40056f48 in ?? ()
11 Thread 7007 0x40056e28 in ?? ()
10 Thread 7005 0x40056e24 in ?? ()
9 Thread 7004 0x40056e24 in ?? ()
8 Thread 7003 0x40057d48 in ?? ()
7 Thread 7002 0x40057d44 in ?? ()
6 Thread 7001 0x40057d44 in ?? ()
5 Thread 7000 0x40057d44 in ?? ()
4 Thread 6999 0x40057864 in ?? ()
3 Thread 6998 0x40057660 in ?? ()
2 Thread 6995 0x40057d44 in ?? ()
* 1 Thread 6993 0x40057b3c in ?? ()
(gdb) i l
Ambiguous info command "l": line, locals.
(gdb) i li
No line number information available.
(gdb) list
1 /*
2 * A type which wraps a semaphore
3 *
4 * semaphore.c
5 *
6 * Copyright (c) 2006-2008, R Oudkerk --- see COPYING.txt
7 */
8
9 #include "multiprocessing.h"
10
(gdb)
11 enum { RECURSIVE_MUTEX, SEMAPHORE };
12
13 typedef struct {
14 PyObject_HEAD
15 SEM_HANDLE handle;
16 long last_tid;
17 int count;
18 int maxvalue;
19 int kind;
20 } SemLockObject;
(gdb)
21
22 #define ISMINE(o) (o->count > 0 && PyThread_get_thread_ident() == o->last_tid)
23
24
25 #ifdef MS_WINDOWS
26
27 /*
28 * Windows definitions
29 */
30
(gdb)
31 #define SEM_FAILED NULL
32
33 #define SEM_CLEAR_ERROR() SetLastError(0)
34 #define SEM_GET_LAST_ERROR() GetLastError()
35 #define SEM_CREATE(name, val, max) CreateSemaphore(NULL, val, max, NULL)
36 #define SEM_CLOSE(sem) (CloseHandle(sem) ? 0 : -1)
37 #define SEM_GETVALUE(sem, pval) _GetSemaphoreValue(sem, pval)
38
39 static int
40 _GetSemaphoreValue(HANDLE handle, long *value)
(gdb)
41 {
42 long previous;
43
44 switch (WaitForSingleObject(handle, 0)) {
45 case WAIT_OBJECT_0:
46 if (!ReleaseSemaphore(handle, 1, &previous))
47 return MP_STANDARD_ERROR;
48 *value = previous + 1;
49 return 0;
50 case WAIT_TIMEOUT:
(gdb)
51 *value = 0;
52 return 0;
53 default:
54 return MP_STANDARD_ERROR;
55 }
56 }
57
58 static PyObject *
59 semlock_acquire(SemLockObject *self, PyObject *args, PyObject *kwds)
60 {
(gdb)
61 int blocking = 1;
62 double timeout;
63 PyObject *timeout_obj = Py_None;
64 DWORD res, full_msecs, msecs, start, ticks;
65
66 static char *kwlist[] = {"block", "timeout", NULL};
67
68 if (!PyArg_ParseTupleAndKeywords(args, kwds, "|iO", kwlist,
69 &blocking, &timeout_obj))
70 return NULL;
(gdb)
71
72 /* calculate timeout */
73 if (!blocking) {
74 full_msecs = 0;
75 } else if (timeout_obj == Py_None) {
76 full_msecs = INFINITE;
77 } else {
78 timeout = PyFloat_AsDouble(timeout_obj);
79 if (PyErr_Occurred())
80 return NULL;
(gdb)
81 timeout *= 1000.0; /* convert to millisecs */
82 if (timeout < 0.0) {
83 timeout = 0.0;
84 } else if (timeout >= 0.5 * INFINITE) { /* 25 days */
85 PyErr_SetString(PyExc_OverflowError,
86 "timeout is too large");
87 return NULL;
88 }
89 full_msecs = (DWORD)(timeout + 0.5);
90 }
(gdb)
91
92 /* check whether we already own the lock */
93 if (self->kind == RECURSIVE_MUTEX && ISMINE(self)) {
94 ++self->count;
95 Py_RETURN_TRUE;
96 }
97
98 /* check whether we can acquire without blocking */
99 if (WaitForSingleObject(self->handle, 0) == WAIT_OBJECT_0) {
100 self->last_tid = GetCurrentThreadId();
(gdb)
101 ++self->count;
102 Py_RETURN_TRUE;
103 }
104
105 msecs = full_msecs;
106 start = GetTickCount();
107
108 for ( ; ; ) {
109 HANDLE handles[2] = {self->handle, sigint_event};
110
(gdb)
111 /* do the wait */
112 Py_BEGIN_ALLOW_THREADS
113 ResetEvent(sigint_event);
114 res = WaitForMultipleObjects(2, handles, FALSE, msecs);
115 Py_END_ALLOW_THREADS
116
117 /* handle result */
118 if (res != WAIT_OBJECT_0 + 1)
119 break;
120
(gdb)
121 /* got SIGINT so give signal handler a chance to run */
122 Sleep(1);
123
124 /* if this is main thread let KeyboardInterrupt be raised */
125 if (PyErr_CheckSignals())
126 return NULL;
127
128 /* recalculate timeout */
129 if (msecs != INFINITE) {
130 ticks = GetTickCount();
(gdb)
131 if ((DWORD)(ticks - start) >= full_msecs)
132 Py_RETURN_FALSE;
133 msecs = full_msecs - (ticks - start);
134 }
135 }
136
137 /* handle result */
138 switch (res) {
139 case WAIT_TIMEOUT:
140 Py_RETURN_FALSE;
(gdb)
141 case WAIT_OBJECT_0:
142 self->last_tid = GetCurrentThreadId();
143 ++self->count;
144 Py_RETURN_TRUE;
145 case WAIT_FAILED:
146 return PyErr_SetFromWindowsErr(0);
147 default:
148 PyErr_Format(PyExc_RuntimeError, "WaitForSingleObject() or "
149 "WaitForMultipleObjects() gave unrecognized "
150 "value %d", res);
(gdb)
151 return NULL;
152 }
153 }
154
155 static PyObject *
156 semlock_release(SemLockObject *self, PyObject *args)
157 {
158 if (self->kind == RECURSIVE_MUTEX) {
159 if (!ISMINE(self)) {
160 PyErr_SetString(PyExc_AssertionError, "attempt to "
(gdb)
161 "release recursive lock not owned "
162 "by thread");
163 return NULL;
164 }
165 if (self->count > 1) {
166 --self->count;
167 Py_RETURN_NONE;
168 }
169 assert(self->count == 1);
170 }
(gdb) b 156
Breakpoint 1 at 0x5b77aa34: file /home/gabriel/python-for-android/build/python/Python-2.7.2/Modules/_multiprocessing/semaphore.c, line 156.
(gdb) c
Continuing.
^C
Program received signal SIGINT, Interrupt.
0x40057b3c in ?? ()
(gdb) s
Cannot find bounds of current function
(gdb) c
Continuing.
^C
Program received signal SIGINT, Interrupt.
0x40057b3c in ?? ()
(gdb) i li
Line 170 of "/home/gabriel/python-for-android/build/python/Python-2.7.2/Modules/_multiprocessing/semaphore.c"
is at address 0x5b77aa34 <semlock_new+140> but contains no code.
(gdb) list
171
172 if (!ReleaseSemaphore(self->handle, 1, NULL)) {
173 if (GetLastError() == ERROR_TOO_MANY_POSTS) {
174 PyErr_SetString(PyExc_ValueError, "semaphore or lock "
175 "released too many times");
176 return NULL;
177 } else {
178 return PyErr_SetFromWindowsErr(0);
179 }
180 }
(gdb)
181
182 --self->count;
183 Py_RETURN_NONE;
184 }
185
186 #else /* !MS_WINDOWS */
187
188 /*
189 * Unix definitions
190 */
(gdb) c
Continuing.
Ce coup ci, j'ai un programme freezé au lieu d'un programme planté… je n'arrive même pas à killer les processus du dit programme, c'est dire… ce qu'il y a de bizarre, c'est que mon breakpoint n'était même pas au bon endroid, j'ai du trop vite, et l'ai mis sur la version windows de la fonction, pas de raison qu'il ait été atteinds donc…
re-edit: et non, je ne sais pas d'ou viennent tous ces threads, j'ai peux processus python, un avec tous ces threads, et un deuxieme avec seulement deux threads, il ne match pas plus de symboles de l'autre coté bien sur…
si quelqu'un a des idées, je suis preneur…
edit: ah, ça c'est un peu intéressant !
gabriel@tochange:~/android-ndk-r8b/toolchains/arm-linux-androideabi-4.4.3$ ./prebuilt/linux-x86/bin/arm-linux-androideabi-gdb ~/python-for-android/dist/goulbi/private/libpymodules.so
GNU gdb (GDB) 7.3.1-gg2
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=x86_64-linux-gnu --target=arm-linux-android".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/gabriel/python-for-android/dist/goulbi/private/libpymodules.so...done.
(gdb) set solib-absolute-prefix /home/gabriel/python-for-android/dist/goulbi/private/lib/python2.7/lib-dynload/
(gdb) set solib-search-path /home/gabriel/python-for-android/dist/goulbi/private/lib/python2.7/lib-dynload/(gdb) i sharedlibrary
No shared libraries loaded at this time.
(gdb) tar remote ct07:5050
Remote debugging using ct07:5050
warning: Could not load shared library symbols for 80 libraries, e.g. /system/bin/linker.
Use the "info sharedlibrary" command to see the complete listing.
Do you need "set solib-search-path" or "set sysroot"?
warning: Unable to find dynamic linker breakpoint function.
GDB will be unable to debug shared library initializers
and track explicitly loaded dynamic code.
0x40057b3c in ?? ()
(gdb) i sharedlibrary
From To Syms Read Shared Object Library
No /system/bin/linker
No libc.so
No libstdc++.so
No libm.so
No liblog.so
No libcutils.so
No libz.so
No libutils.so
No libbinder.so
No libexpat.so
No libcrypto.so
No libgabi++.so
No libicuuc.so
No libicui18n.so
No libssl.so
No libstlport.so
No libnativehelper.so
No libnetutils.so
No libGLESv2_dbg.so
No libEGL.so
No libwpa_client.so
No libhardware_legacy.so
No libpixelflinger.so
No libhardware.so
No libemoji.so
No libjpeg.so
No libvpu.so
No libjpeghwdec.so
No libskia.so
No libui.so
No libGLESv2.so
No libgui.so
No libcamera_client.so
No libsqlite.so
No libdvm.so
No libGLESv1_CM.so
No libETC1.so
No libsonivox.so
No libstagefright_foundation.so
No libmedia.so
No libnfc_ndef.so
No libusbhost.so
No libharfbuzz.so
No libhwui.so
No libbluedroid.so
No libdbus.so
No libandroid_runtime.so
---Type <return> to continue, or q <return> to quit---
No libvorbisidec.so
No libstagefright_yuv.so
No libdrmframework.so
No libyuvtorgb.so
No libchromium_net.so
No libstagefright_amrnb_common.so
No libstagefright_enc_common.so
No libstagefright_avc_common.so
No libstagefright.so
No libmtp.so
No libexif.so
No libmedia_jni.so
No libbcc.so
No libbcinfo.so
No libRS.so
No librs_jni.so
No libandroid.so
No libwebcore.so
No libsdl.so
No libsdl_image.so
No libsdl_ttf.so
No libGAL.so
No libEGL_VIVANTE.so
No libsdl_mixer.so
No libGLESv1_CM_VIVANTE.so
No libpython2.7.so
No libGLESv2_VIVANTE.so
No libapplication.so
No libsdl_main.so
0x5f842488 0x5f8557f4 Yes /home/gabriel/python-for-android/dist/goulbi/private/lib/python2.7/lib-dynload/_io.so
0x5fb6a264 0x5fb6cfd4 Yes /home/gabriel/python-for-android/dist/goulbi/private/lib/python2.7/lib-dynload/unicodedata.so
No libsqlite3.so
No gralloc.rk29board.so
No libGLSLC.so
No libpymodules.so
0x5fdca9ac 0x5fdccb20 Yes /home/gabriel/python-for-android/dist/goulbi/private/lib/python2.7/lib-dynload/_multiprocessing.so
(gdb)
edit: j'étais pas loin en fait
(gdb) b semlock_release
Breakpoint 1 at 0x5b755538: file /home/gabriel/python-for-android/build/python/Python-2.7.2/Modules/_multiprocessing/semaphore.c, line 354.
(gdb) c
Continuing.
[Switching to Thread 7588]
Breakpoint 1, semlock_release (self=0x649638a0, args=0x0)
at /home/gabriel/python-for-android/build/python/Python-2.7.2/Modules/_multiprocessing/semaphore.c:354
354 {
(gdb) l
349 Py_RETURN_TRUE;
350 }
351
352 static PyObject *
353 semlock_release(SemLockObject *self, PyObject *args)
354 {
355 if (self->kind == RECURSIVE_MUTEX) {
356 if (!ISMINE(self)) {
357 PyErr_SetString(PyExc_AssertionError, "attempt to "
358 "release recursive lock not owned "
(gdb)
\o/ je vais pouvoir débugger!
Dernière modification par tshirtman (Le 07/11/2012, à 12:31)
Hors ligne
#2418 Le 07/11/2012, à 02:20
- cm-t
Re : /* Topic des codeurs [7] */
Actu Ubuntu ☺/
Pauses Ubuntu sur Paris \_< -t
[(π)] La Quadrature du net
Hors ligne
#2419 Le 07/11/2012, à 14:25
- tshirtman
Re : /* Topic des codeurs [7] */
@grim: si jamais tu passes dans le coins, j'ai une trace gdb, mais je comprends pas bien, si je comprends bien c'est le même thread qui échoue et ensuite réussis le sem_post, (et semble décrémenter deux fois), je ne peux ni stepper dans sem_post, ni l'appeler pour savoir son résultat, n'ayant pas le symbole, mais je peux voir que self->handle vaut 2147483646 avant l'appel qui échoue, alors qu'il vaut 0 avant l'appel qui réussis, et je vois que bits/semaphore.h définit "#define SEM_VALUE_MAX (2147483647)" donc on a max - 1, ce qui ressemble en effet à un overflow négatif, maintenant, qu'est ce qui pourrait causer ça?
(gdb) i breakpoints
Num Type Disp Enb Address What
1 breakpoint keep y 0x5b7b0538 in semlock_release
at /home/gabriel/python-for-android/build/python/Python-2.7.2/Modules/_multiprocessing/semaphore.c:354
breakpoint already hit 2 times
(gdb) c
Continuing.
[New Thread 7680]
[Switching to Thread 7680]
Breakpoint 1, semlock_release (self=0x646ea8a0, args=0x0)
at /home/gabriel/python-for-android/build/python/Python-2.7.2/Modules/_multiprocessing/semaphore.c:354
354 {
(gdb) list
349 Py_RETURN_TRUE;
350 }
351
352 static PyObject *
353 semlock_release(SemLockObject *self, PyObject *args)
354 {
355 if (self->kind == RECURSIVE_MUTEX) {
356 if (!ISMINE(self)) {
357 PyErr_SetString(PyExc_AssertionError, "attempt to "
358 "release recursive lock not owned "
(gdb) n
355 if (self->kind == RECURSIVE_MUTEX) {
(gdb)
357 PyErr_SetString(PyExc_AssertionError, "attempt to "
(gdb)
355 if (self->kind == RECURSIVE_MUTEX) {
(gdb)
354 {
(gdb)
357 PyErr_SetString(PyExc_AssertionError, "attempt to "
(gdb)
355 if (self->kind == RECURSIVE_MUTEX) {
(gdb)
370 if (self->maxvalue == 1) {
(gdb) x /d self->handle
0x66ca28: 2147483646
(gdb) n
405 if (sem_post(self->handle) < 0)
(gdb) s
(gdb) x /d self->handle
0x66ca28: 2147483646
406 return PyErr_SetFromErrno(PyExc_OSError);
(gdb) c
Continuing.
Breakpoint 1, semlock_release (self=0x646ea860, args=0x0)
at /home/gabriel/python-for-android/build/python/Python-2.7.2/Modules/_multiprocessing/semaphore.c:354
354 {
(gdb) n
355 if (self->kind == RECURSIVE_MUTEX) {
(gdb)
357 PyErr_SetString(PyExc_AssertionError, "attempt to "
(gdb)
355 if (self->kind == RECURSIVE_MUTEX) {
(gdb)
354 {
(gdb)
357 PyErr_SetString(PyExc_AssertionError, "attempt to "
(gdb)
355 if (self->kind == RECURSIVE_MUTEX) {
(gdb)
370 if (self->maxvalue == 1) {
(gdb)
372 if (sem_trywait(self->handle) < 0) {
(gdb)
373 if (errno != EAGAIN) {
(gdb)
405 if (sem_post(self->handle) < 0)
(gdb) x /d self->handle
0x68dd08: 0
(gdb) n
409 Py_RETURN_NONE;
(gdb)
408 --self->count;
(gdb)
409 Py_RETURN_NONE;
(gdb)
408 --self->count;
(gdb)
409 Py_RETURN_NONE;
(gdb)
410 }
(gdb) n
Cannot access memory at address 0x0
0x5b91a228 in ?? ()
(gdb)
Cannot find bounds of current function
(gdb) c
Continuing.
[Inferior 1 (Remote target) exited normally]
edit: je recompile avec -O0, c'est un peu fatiguant d'avoir des <optimised out> quand on demande la valeur d'une variable…
Dernière modification par tshirtman (Le 07/11/2012, à 18:36)
Hors ligne
#2420 Le 07/11/2012, à 19:02
- grim7reaper
Re : /* Topic des codeurs [7] */
Désolé, mais je ne pourrais pas me pencher là-dessus avant ce week-end (si d’ici là tu n’as pas résolu le problème).
Hors ligne
#2421 Le 07/11/2012, à 19:36
- :!pakman
Re : /* Topic des codeurs [7] */
Vous ne connaîtriez pas par hasard un bon cours sur les sockets (plus particulièrement en java) ?
Y'an a un sur le site du zero, mais 2 amis l'ont lu et me disent qu'il ne le trouvent pas terrible...
...
Hors ligne
#2422 Le 07/11/2012, à 19:47
#2423 Le 08/11/2012, à 00:08
- tshirtman
Re : /* Topic des codeurs [7] */
@grim: pas de soucis, je continue d'avancer ^^
Hors ligne
#2424 Le 08/11/2012, à 07:00
#2425 Le 08/11/2012, à 11:09
- Mindiell
Re : /* Topic des codeurs [7] */
@tshirtman : J'ai quelques questions rapport à Kivy :
- Est-ce python 3+ compatible ?
- On est d'accord qu'on peut aussi faire des programmes pour les PCs avec ?
- Peut-on faire du plein écran (je suppose que oui) ?
- Je suis sur Lucid (10.04), je n'ai donc pas accès à la lib gles2-mesa-dev, je vais quand même essayer de compiler quelque chose ou alors il faut vraiment passer à autre chose (le pb c'est que Ubuntu après, je trouve ça lourd et lent, il faudrait passer à Trisquel et/ou Debian)
Oui, je sais, RTFM. Mais je suis déjà en train de l'installer pour voir ce que ça pourrait donner et j'ai pas envie de farfouiller partout alors que tu as surement déjà les réponses
EDIT :
- compilation ok, utilisation ok : sans la lib gles2, ça doit servir à fairedes trucs spéciaux uniquement
- Je suis les tutoriels, et je n'ai pas besoin de la Factory (le tuto parle de la version 1.0.9, j'ai la 1.4.2-dev, ça a du changer...)
- Très bonne première impression : je connais les notions de widget et tout, et je joue déjà un peu avec, et ça marche comme je l'imagine : ca c'est top
Dernière modification par Mindiell (Le 08/11/2012, à 11:47)
Hors ligne