IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

GTK+ avec C & C++ Discussion :

Instabilitée et debugage avec GTK+


Sujet :

GTK+ avec C & C++

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre averti
    Profil pro
    Inscrit en
    Juillet 2008
    Messages
    13
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juillet 2008
    Messages : 13
    Par défaut Instabilitée et debugage avec GTK+
    Bonjours a tous,

    J'ai un petit probleme: mon programme est instable et il plante de facon plus ou moins aleatoire... (quand je dis plus ou moins c'est que je sais quelles manops faire pour le planter mais que cette meme manip ne le plante pas toujours...).
    Donc avant de ma tourner vers vous j'ai cherché... et j'ai utiliser pour la premiere fois un debugger: GDB (sous linux ) apres quelque correction ca va mieux mais j'ai toujours ces 3 rapports de GDB que je ne comprend pas... (je les obtient en faisant "where" ):

    Premierement celui ci, je n'y vois que des erreur GTK+ vous assi? si non vous avez peut etre une idee de ou ca vient ?

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    #0  0xb7840e66 in ?? () from /lib/tls/i686/cmov/libc.so.6
    #1  0xb7842edd in ?? () from /lib/tls/i686/cmov/libc.so.6
    #2  0xb7844cad in malloc () from /lib/tls/i686/cmov/libc.so.6
    #3  0xb7a26059 in cairo_create () from /usr/lib/libcairo.so.2
    #4  0xb7b48799 in setup_backing_rect_method (method=0x832b768, window=0x72657320, paint=0x178, x_offset_cairo=0, y_offset_cairo=0)
        at /build/buildd/gtk+2.0-2.12.9/gdk/gdkwindow.c:1882
    #5  0xb7b488b9 in gdk_window_clear_backing_rect (window=0x8322eb8, x=0, y=410, width=211, height=23) at /build/buildd/gtk+2.0-2.12.9/gdk/gdkwindow.c:1912
    #6  0xb7b49b6f in IA__gdk_window_begin_paint_region (window=0x8322eb8, region=0x8334e80) at /build/buildd/gtk+2.0-2.12.9/gdk/gdkwindow.c:1021
    #7  0xb7ce6ff5 in IA__gtk_main_do_event (event=0xbf921094) at /build/buildd/gtk+2.0-2.12.9/gtk/gtkmain.c:1513
    #8  0xb7b49f33 in gdk_window_process_updates_internal (window=0x8322eb8) at /build/buildd/gtk+2.0-2.12.9/gdk/gdkwindow.c:2378
    #9  0xb7b4a4a4 in IA__gdk_window_process_updates (window=0x8322eb8, update_children=1) at /build/buildd/gtk+2.0-2.12.9/gdk/gdkwindow.c:2494
    #10 0xb7de6a11 in gtk_tree_view_clamp_node_visible (tree_view=0x81b6078, tree=0x81c05d8, node=<value optimized out>)
        at /build/buildd/gtk+2.0-2.12.9/gtk/gtktreeview.c:8974
    #11 0xb7def2e2 in gtk_tree_view_real_set_cursor (tree_view=0x81b6078, path=0x8335830, clear_and_select=1, clamp_node=1)
        at /build/buildd/gtk+2.0-2.12.9/gtk/gtktreeview.c:12637
    #12 0xb7df31ca in gtk_tree_view_real_move_cursor (tree_view=0x81b6078, step=GTK_MOVEMENT_DISPLAY_LINES, count=1)
        at /build/buildd/gtk+2.0-2.12.9/gtk/gtktreeview.c:9800
    #13 0xb7cec4dc in _gtk_marshal_BOOLEAN__ENUM_INT (closure=0x81b3028, return_value=0xbf9215f8, n_param_values=3, param_values=0x8333c10, 
        invocation_hint=0xbf9214ac, marshal_data=0xb7df2c30) at /build/buildd/gtk+2.0-2.12.9/gtk/gtkmarshalers.c:286
    #14 0xb79e8079 in ?? () from /usr/lib/libgobject-2.0.so.0
    #15 0xb79e9759 in g_closure_invoke () from /usr/lib/libgobject-2.0.so.0
    #16 0xb79fe11a in ?? () from /usr/lib/libgobject-2.0.so.0
    #17 0xb7a000c0 in g_signal_emitv () from /usr/lib/libgobject-2.0.so.0
    #18 0xb7c09ff1 in gtk_binding_entry_activate (entry=0x81b3790, object=0x81b6078) at /build/buildd/gtk+2.0-2.12.9/gtk/gtkbindings.c:536
    #19 0xb7c0a54c in binding_match_activate (pspec_list=<value optimized out>, object=0x81b6078, path_length=11, path=0x8333ca8 "GtkTreeView", 
        path_reversed=0x8345028 "weiVeerTktG", unbound=0xbf92168c) at /build/buildd/gtk+2.0-2.12.9/gtk/gtkbindings.c:1100
    #20 0xb7c0a6fe in gtk_bindings_activate_list (object=0x81b6078, entries=0x81f2748, is_release=0) at /build/buildd/gtk+2.0-2.12.9/gtk/gtkbindings.c:1244
    #21 0xb7c0a90b in IA__gtk_bindings_activate_event (object=0x81b6078, event=0x80c9ee0) at /build/buildd/gtk+2.0-2.12.9/gtk/gtkbindings.c:1338
    #22 0xb7df071b in gtk_tree_view_key_press (widget=0x81b6078, event=0x80c9ee0) at /build/buildd/gtk+2.0-2.12.9/gtk/gtktreeview.c:5392
    #23 0xb7cec8d4 in _gtk_marshal_BOOLEAN__BOXED (closure=0x8083f28, return_value=0xbf921970, n_param_values=2, param_values=0xbf921a54, 
        invocation_hint=0xbf92195c, marshal_data=0xb7df0510) at /build/buildd/gtk+2.0-2.12.9/gtk/gtkmarshalers.c:84
    #24 0xb79e8079 in ?? () from /usr/lib/libgobject-2.0.so.0
    #25 0xb79e982f in g_closure_invoke () from /usr/lib/libgobject-2.0.so.0
    #26 0xb79fe11a in ?? () from /usr/lib/libgobject-2.0.so.0
    #27 0xb79ff947 in g_signal_emit_valist () from /usr/lib/libgobject-2.0.so.0
    #28 0xb79fff69 in g_signal_emit () from /usr/lib/libgobject-2.0.so.0
    #29 0xb7e0b667 in gtk_widget_event_internal (widget=0x81b6078, event=0x80c9ee0) at /build/buildd/gtk+2.0-2.12.9/gtk/gtkwidget.c:4678
    #30 0xb7e1cdf0 in IA__gtk_window_propagate_key_event (window=0x808c818, event=0x80c9ee0) at /build/buildd/gtk+2.0-2.12.9/gtk/gtkwindow.c:4936
    #31 0xb7e1ff5c in gtk_window_key_press_event (widget=0x808c818, event=0x80c9ee0) at /build/buildd/gtk+2.0-2.12.9/gtk/gtkwindow.c:4966
    #32 0xb7cec8d4 in _gtk_marshal_BOOLEAN__BOXED (closure=0x8083f28, return_value=0xbf921f60, n_param_values=2, param_values=0xbf922044, 
    ---Type <return> to continue, or q <return> to quit---invocation_hint=0xbf921Quit

    Et puis il y a celui la... comme vous pouvez le voir il y 2 lignes (12 et 13) qui m'indique mon code, or cette a cette ligne j'ai la fonction "gtk_list_store_clear( blabla )" qui detruit une list... sauf que je vois vraiment pas pourquoi des fois ca marche et des fois pas...

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    #0  0xb7efc410 in __kernel_vsyscall ()
    #1  0xb77d6085 in raise () from /lib/tls/i686/cmov/libc.so.6
    #2  0xb77d7a01 in abort () from /lib/tls/i686/cmov/libc.so.6
    #3  0xb780eb7c in ?? () from /lib/tls/i686/cmov/libc.so.6
    #4  0xb7817962 in ?? () from /lib/tls/i686/cmov/libc.so.6
    #5  0xb7818cad in malloc () from /lib/tls/i686/cmov/libc.so.6
    #6  0xb781a836 in realloc () from /lib/tls/i686/cmov/libc.so.6
    #7  0xb7939cb5 in g_realloc () from /usr/lib/libglib-2.0.so.0
    #8  0xb7d9f4c7 in IA__gtk_tree_path_append_index (path=0x81d25a8, index=0) at /build/buildd/gtk+2.0-2.12.9/gtk/gtktreemodel.c:556
    #9  0xb7cb64a6 in gtk_list_store_get_path (tree_model=0x81ad758, iter=0xbfa0a75c) at /build/buildd/gtk+2.0-2.12.9/gtk/gtkliststore.c:472
    #10 0xb7cb8089 in IA__gtk_list_store_remove (list_store=0x81ad758, iter=0xbfa0a75c) at /build/buildd/gtk+2.0-2.12.9/gtk/gtkliststore.c:959
    #11 0xb7cb8180 in IA__gtk_list_store_clear (list_store=0x81ad758) at /build/buildd/gtk+2.0-2.12.9/gtk/gtkliststore.c:1167
    #12 0x0804f777 in Actualiser_liste (ptr_objets=0xbfa0cda0) at Actualiser_liste.c:9
    #13 0x0804e8c3 in Rechercher_membre (ptr_button=0x808c978, void_ptr_objets=0xbfa0cda0) at Signaux.c:220
    #14 0xb79caaff in g_cclosure_marshal_VOID__VOID () from /usr/lib/libgobject-2.0.so.0
    #15 0xb79bd759 in g_closure_invoke () from /usr/lib/libgobject-2.0.so.0
    #16 0xb79d1f8b in ?? () from /usr/lib/libgobject-2.0.so.0
    #17 0xb79d3c1f in g_signal_emit_valist () from /usr/lib/libgobject-2.0.so.0
    #18 0xb79d3ee0 in g_signal_emit_by_name () from /usr/lib/libgobject-2.0.so.0
    #19 0xb7c3af52 in emit_changed (entry=0x808c978) at /build/buildd/gtk+2.0-2.12.9/gtk/gtkentry.c:1172
    #20 0xb7c3c4b5 in gtk_entry_real_insert_text (editable=0x808c978, new_text=0x8327768 "q", new_text_length=<value optimized out>, position=0xbfa0b3f8)
        at /build/buildd/gtk+2.0-2.12.9/gtk/gtkentry.c:2551
    #21 0xb7cbeed8 in _gtk_marshal_VOID__STRING_INT_POINTER (closure=0x80b4520, return_value=0x0, n_param_values=4, param_values=0xbfa0b0e4, 
        invocation_hint=0xbfa0afec, marshal_data=0xb7c3c360) at /build/buildd/gtk+2.0-2.12.9/gtk/gtkmarshalers.c:1273
    #22 0xb79bc0e7 in ?? () from /usr/lib/libgobject-2.0.so.0
    #23 0xb79bd759 in g_closure_invoke () from /usr/lib/libgobject-2.0.so.0
    #24 0xb79d211a in ?? () from /usr/lib/libgobject-2.0.so.0
    #25 0xb79d3c1f in g_signal_emit_valist () from /usr/lib/libgobject-2.0.so.0
    #26 0xb79d3ee0 in g_signal_emit_by_name () from /usr/lib/libgobject-2.0.so.0
    #27 0xb7c3c7ae in gtk_entry_insert_text (editable=0x808c978, new_text=0x8213ed0 "q", new_text_length=1, position=0xbfa0b3f8)
        at /build/buildd/gtk+2.0-2.12.9/gtk/gtkentry.c:2244
    #28 0xb7c36b52 in IA__gtk_editable_insert_text (editable=0x808c978, new_text=0x8213ed0 "q", new_text_length=1, position=0xbfa0b3f8)
        at /build/buildd/gtk+2.0-2.12.9/gtk/gtkeditable.c:110
    #29 0xb7c38816 in gtk_entry_enter_text (entry=0x808c978, str=0x8213ed0 "q") at /build/buildd/gtk+2.0-2.12.9/gtk/gtkentry.c:3107
    #30 0xb79ca2ca in g_cclosure_marshal_VOID__STRING () from /usr/lib/libgobject-2.0.so.0
    #31 0xb79bd759 in g_closure_invoke () from /usr/lib/libgobject-2.0.so.0
    #32 0xb79d1f8b in ?? () from /usr/lib/libgobject-2.0.so.0
    #33 0xb79d3c1f in g_signal_emit_valist () from /usr/lib/libgobject-2.0.so.0
    #34 0xb79d3ee0 in g_signal_emit_by_name () from /usr/lib/libgobject-2.0.so.0
    #35 0xb7c9f4be in gtk_im_multicontext_commit_cb (slave=0x831bb88, str=0x8342ec8 "q", multicontext=0x80a95b0)
    ET enfin ^^ j'ai ce rapport la (c'est le dernier ): la GDB me dis que il y un truc bizar ligne or il s'agit de ma boucle evenementiel "gtk_main();" qui gere tout mon affichage arggg surtout qu'elle plante aussi de facon aleatoire...

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    #0  0xb781179b in ?? () from /lib/tls/i686/cmov/libc.so.6
    #1  0xb78154f0 in free () from /lib/tls/i686/cmov/libc.so.6
    #2  0xb7a12ac3 in cairo_pattern_destroy () from /usr/lib/libcairo.so.2
    #3  0xb79fc3cd in ?? () from /usr/lib/libcairo.so.2
    #4  0xb79f4fcf in cairo_destroy () from /usr/lib/libcairo.so.2
    #5  0xb7b17921 in gdk_window_clear_backing_rect (window=0x8349b10, x=0, y=0, width=274, height=34) at /build/buildd/gtk+2.0-2.12.9/gdk/gdkwindow.c:1924
    #6  0xb7b18b6f in IA__gdk_window_begin_paint_region (window=0x831e190, region=0x8351e00) at /build/buildd/gtk+2.0-2.12.9/gdk/gdkwindow.c:1021
    #7  0xb7cb5ff5 in IA__gtk_main_do_event (event=0xbfc26d54) at /build/buildd/gtk+2.0-2.12.9/gtk/gtkmain.c:1513
    #8  0xb7b18f33 in gdk_window_process_updates_internal (window=0x831e190) at /build/buildd/gtk+2.0-2.12.9/gdk/gdkwindow.c:2378
    #9  0xb7b195c8 in IA__gdk_window_process_all_updates () at /build/buildd/gtk+2.0-2.12.9/gdk/gdkwindow.c:2444
    #10 0xb7c1dcff in gtk_container_idle_sizer (data=0x0) at /build/buildd/gtk+2.0-2.12.9/gtk/gtkcontainer.c:1307
    #11 0xb7aff81b in gdk_threads_dispatch (data=0x82126d0) at /build/buildd/gtk+2.0-2.12.9/gdk/gdk.c:470
    #12 0xb792b1e1 in ?? () from /usr/lib/libglib-2.0.so.0
    #13 0xb792cdd6 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
    #14 0xb7930193 in ?? () from /usr/lib/libglib-2.0.so.0
    #15 0xb7930577 in g_main_loop_run () from /usr/lib/libglib-2.0.so.0
    #16 0xb7cb6264 in IA__gtk_main () at /build/buildd/gtk+2.0-2.12.9/gtk/gtkmain.c:1163
    #17 0x0804c901 in Interface_graphique (argc=1, argv=0xbfc271e4, ptr_global=0x8053450) at Interface_graphique.c:486
    #18 0x0804a0ec in main (argc=1, argv=0xbfc271e4) at main.c:13
    Voila voila, je n'ai pas eu d'autres rapports differents de la part de GDB (ouf!) donc si quelqu'un a eu la courage de tout lire et et a une idee a ma soumettre qu'il n'esite pas
    Au pire si quelqu'un a une meillieur facon pour debugger du GTK+ qu'il n'esite pas non plus

    Merci d'avance

  2. #2
    Membre Expert
    Homme Profil pro
    Inscrit en
    Janvier 2005
    Messages
    1 259
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations forums :
    Inscription : Janvier 2005
    Messages : 1 259
    Par défaut
    Plantage aléatoire + backtrace qui plante dans un malloc ou un free, ca sent la corruption mémoire. Pour debugger ça, valgrind est beaucoup plus adapté que gdb.

  3. #3
    Membre actif Avatar de bobyboby
    Inscrit en
    Septembre 2008
    Messages
    108
    Détails du profil
    Informations forums :
    Inscription : Septembre 2008
    Messages : 108
    Par défaut
    J'ai eu une fois un programme qui plantait au hasard et les erreurs montrées par le debugger n'étaient pas représentatives.
    Il s'agissait d'un problème de memoire du a une variable ou un pointeur que j'avais ouiblié d'initialiser. vérifie bien de ce coté la, car si ca plante au hasard en général c'est que la valeur de ta variable prise par defaut est parfois possible parfois impossible et ca plante. En esperant que ça t'aide.

  4. #4
    Membre Expert
    Homme Profil pro
    Inscrit en
    Janvier 2005
    Messages
    1 259
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations forums :
    Inscription : Janvier 2005
    Messages : 1 259
    Par défaut
    Valgrind détecte ces cas là aussi et donne une indication sur le problème. Sinon, quand tu compiles avec gcc en -O2 -Wall -Werror, je crois que t'as un warning qui te préviens quand t'essaie d'utiliser une variable non initialisée

  5. #5
    Membre averti
    Profil pro
    Inscrit en
    Juillet 2008
    Messages
    13
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juillet 2008
    Messages : 13
    Par défaut
    Salut,
    Ca fais plaisir de voir que vous m'avais repondu, merci

    Sinon, quand tu compiles avec gcc en -O2 -Wall -Werror, je crois que t'as un warning qui te préviens quand t'essaie d'utiliser une variable non initialisée
    En faite j'utilise toujour l'argument -Wall et meme avec les autre je n'ai rien d'affiché, tout compile parfaitement...

    Sinon j'ai testé valgrind, il est impressionnant! Mais j'avous pas comprendre la premiere erreur:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    -------------------------- 1 ----------------------------
    ==19242== Invalid read of size 4
    ==19242==    at 0x4015209: (within /lib/ld-2.7.so)
    ==19242==    by 0x4005C69: (within /lib/ld-2.7.so)
    ==19242==    by 0x4007A97: (within /lib/ld-2.7.so)
    ==19242==    by 0x4011543: (within /lib/ld-2.7.so)
    ==19242==    by 0x400D5D5: (within /lib/ld-2.7.so)
    ==19242==    by 0x4010F5D: (within /lib/ld-2.7.so)
    ==19242==    by 0x4735291: (within /lib/tls/i686/cmov/libc-2.7.so)
    ==19242==    by 0x400D5D5: (within /lib/ld-2.7.so)
    ==19242==    by 0x4735454: __libc_dlopen_mode (in /lib/tls/i686/cmov/libc-2.7.so)
    ==19242==    by 0x470F186: __nss_lookup_function (in /lib/tls/i686/cmov/libc-2.7.so)
    ==19242==    by 0x470F29F: (within /lib/tls/i686/cmov/libc-2.7.so)
    ==19242==    by 0x4711075: __nss_passwd_lookup (in /lib/tls/i686/cmov/libc-2.7.so)
    ==19242==  Address 0x4bcde1c is 36 bytes inside a block of size 38 alloc'd
    ==19242==    at 0x4022AB8: malloc (vg_replace_malloc.c:207)
    ==19242==    by 0x4008031: (within /lib/ld-2.7.so)
    ==19242==    by 0x4011543: (within /lib/ld-2.7.so)
    ==19242==    by 0x400D5D5: (within /lib/ld-2.7.so)
    ==19242==    by 0x4010F5D: (within /lib/ld-2.7.so)
    ==19242==    by 0x4735291: (within /lib/tls/i686/cmov/libc-2.7.so)
    ==19242==    by 0x400D5D5: (within /lib/ld-2.7.so)
    ==19242==    by 0x4735454: __libc_dlopen_mode (in /lib/tls/i686/cmov/libc-2.7.so)
    ==19242==    by 0x470F186: __nss_lookup_function (in /lib/tls/i686/cmov/libc-2.7.so)
    ==19242==    by 0x470F29F: (within /lib/tls/i686/cmov/libc-2.7.so)
    ==19242==    by 0x4711075: __nss_passwd_lookup (in /lib/tls/i686/cmov/libc-2.7.so)
    ==19242==    by 0x46BBB72: getpwnam_r (in /lib/tls/i686/cmov/libc-2.7.so)
    ==19242== 
    ==19242== Invalid read of size 4
    ==19242==    at 0x4015237: (within /lib/ld-2.7.so)
    ==19242==    by 0x4005C69: (within /lib/ld-2.7.so)
    ==19242==    by 0x4007A97: (within /lib/ld-2.7.so)
    ==19242==    by 0x400BC16: (within /lib/ld-2.7.so)
    ==19242==    by 0x400D5D5: (within /lib/ld-2.7.so)
    ==19242==    by 0x400BDF9: (within /lib/ld-2.7.so)
    ==19242==    by 0x40115A3: (within /lib/ld-2.7.so)
    ==19242==    by 0x400D5D5: (within /lib/ld-2.7.so)
    ==19242==    by 0x4010F5D: (within /lib/ld-2.7.so)
    ==19242==    by 0x4735291: (within /lib/tls/i686/cmov/libc-2.7.so)
    ==19242==    by 0x400D5D5: (within /lib/ld-2.7.so)
    ==19242==    by 0x4735454: __libc_dlopen_mode (in /lib/tls/i686/cmov/libc-2.7.so)
    ==19242==  Address 0x4bce164 is 28 bytes inside a block of size 31 alloc'd
    ==19242==    at 0x4022AB8: malloc (vg_replace_malloc.c:207)
    ==19242==    by 0x4008031: (within /lib/ld-2.7.so)
    ==19242==    by 0x400BC16: (within /lib/ld-2.7.so)
    ==19242==    by 0x400D5D5: (within /lib/ld-2.7.so)
    ==19242==    by 0x400BDF9: (within /lib/ld-2.7.so)
    ==19242==    by 0x40115A3: (within /lib/ld-2.7.so)
    ==19242==    by 0x400D5D5: (within /lib/ld-2.7.so)
    ==19242==    by 0x4010F5D: (within /lib/ld-2.7.so)
    ==19242==    by 0x4735291: (within /lib/tls/i686/cmov/libc-2.7.so)
    ==19242==    by 0x400D5D5: (within /lib/ld-2.7.so)
    ==19242==    by 0x4735454: __libc_dlopen_mode (in /lib/tls/i686/cmov/libc-2.7.so)
    ==19242==    by 0x470F186: __nss_lookup_function (in /lib/tls/i686/cmov/libc-2.7.so)
    ==19242== 
    ==19242== Invalid read of size 4
    ==19242==    at 0x40151F3: (within /lib/ld-2.7.so)
    ==19242==    by 0x4005C69: (within /lib/ld-2.7.so)
    ==19242==    by 0x4007A97: (within /lib/ld-2.7.so)
    ==19242==    by 0x4011543: (within /lib/ld-2.7.so)
    ==19242==    by 0x400D5D5: (within /lib/ld-2.7.so)
    ==19242==    by 0x4010F5D: (within /lib/ld-2.7.so)
    ==19242==    by 0x4735291: (within /lib/tls/i686/cmov/libc-2.7.so)
    ==19242==    by 0x400D5D5: (within /lib/ld-2.7.so)
    ==19242==    by 0x4735454: __libc_dlopen_mode (in /lib/tls/i686/cmov/libc-2.7.so)
    ==19242==    by 0x470F186: __nss_lookup_function (in /lib/tls/i686/cmov/libc-2.7.so)
    ==19242==    by 0x509CFFB: (within /lib/tls/i686/cmov/libnss_compat-2.7.so)
    ==19242==    by 0x509E5D4: _nss_compat_getpwnam_r (in /lib/tls/i686/cmov/libnss_compat-2.7.so)
    ==19242==  Address 0x4bce810 is 32 bytes inside a block of size 35 alloc'd
    ==19242==    at 0x4022AB8: malloc (vg_replace_malloc.c:207)
    ==19242==    by 0x4008031: (within /lib/ld-2.7.so)
    ==19242==    by 0x4011543: (within /lib/ld-2.7.so)
    ==19242==    by 0x400D5D5: (within /lib/ld-2.7.so)
    ==19242==    by 0x4010F5D: (within /lib/ld-2.7.so)
    ==19242==    by 0x4735291: (within /lib/tls/i686/cmov/libc-2.7.so)
    ==19242==    by 0x400D5D5: (within /lib/ld-2.7.so)
    ==19242==    by 0x4735454: __libc_dlopen_mode (in /lib/tls/i686/cmov/libc-2.7.so)
    ==19242==    by 0x470F186: __nss_lookup_function (in /lib/tls/i686/cmov/libc-2.7.so)
    ==19242==    by 0x509CFFB: (within /lib/tls/i686/cmov/libnss_compat-2.7.so)
    ==19242==    by 0x509E5D4: _nss_compat_getpwnam_r (in /lib/tls/i686/cmov/libnss_compat-2.7.so)
    ==19242==    by 0x46BBAF5: getpwnam_r (in /lib/tls/i686/cmov/libc-2.7.so)
    ==19242== 
    ==19242== Invalid read of size 4
    ==19242==    at 0x4015209: (within /lib/ld-2.7.so)
    ==19242==    by 0x4005C69: (within /lib/ld-2.7.so)
    ==19242==    by 0x4007A97: (within /lib/ld-2.7.so)
    ==19242==    by 0x400BC16: (within /lib/ld-2.7.so)
    ==19242==    by 0x400D5D5: (within /lib/ld-2.7.so)
    ==19242==    by 0x400BDF9: (within /lib/ld-2.7.so)
    ==19242==    by 0x40115A3: (within /lib/ld-2.7.so)
    ==19242==    by 0x400D5D5: (within /lib/ld-2.7.so)
    ==19242==    by 0x4010F5D: (within /lib/ld-2.7.so)
    ==19242==    by 0x4735291: (within /lib/tls/i686/cmov/libc-2.7.so)
    ==19242==    by 0x400D5D5: (within /lib/ld-2.7.so)
    ==19242==    by 0x4735454: __libc_dlopen_mode (in /lib/tls/i686/cmov/libc-2.7.so)
    ==19242==  Address 0x4bceb64 is 36 bytes inside a block of size 37 alloc'd
    ==19242==    at 0x4022AB8: malloc (vg_replace_malloc.c:207)
    ==19242==    by 0x4008031: (within /lib/ld-2.7.so)
    ==19242==    by 0x400BC16: (within /lib/ld-2.7.so)
    ==19242==    by 0x400D5D5: (within /lib/ld-2.7.so)
    ==19242==    by 0x400BDF9: (within /lib/ld-2.7.so)
    ==19242==    by 0x40115A3: (within /lib/ld-2.7.so)
    ==19242==    by 0x400D5D5: (within /lib/ld-2.7.so)
    ==19242==    by 0x4010F5D: (within /lib/ld-2.7.so)
    ==19242==    by 0x4735291: (within /lib/tls/i686/cmov/libc-2.7.so)
    ==19242==    by 0x400D5D5: (within /lib/ld-2.7.so)
    ==19242==    by 0x4735454: __libc_dlopen_mode (in /lib/tls/i686/cmov/libc-2.7.so)
    ==19242==    by 0x470F186: __nss_lookup_function (in /lib/tls/i686/cmov/libc-2.7.so)
    -------------------------- 2 ----------------------------
    en effet dans mon programme cela est codé par:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    puts("-------------------------- 1 ----------------------------");
    	gtk_init(&argc, &argv);
    puts("-------------------------- 2 ----------------------------");
    Autrement dis j'ai un probleme des le debut avec GTK_init
    Il y a peut etre une erreur de type ou un truc que j'ai pas initialisé, pourtant je n'ai vu nul pars qu'il fallait faire autrement...

    Alors que comment est organisé mon programme? comme ca:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    int main (int argc, char **argv) {
     
    //blabla
    // Plusieurs fonctions d'initialisations
    //blabla
     
    	Interface_graphique (argc, argv,ptr_global);					
     
    return 0;	
     
    }
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    int Interface_graphique (int argc, char **argv, GLOBAL *ptr_global) {
     
    puts("-------------------------- 1 ----------------------------");
    	gtk_init(&argc, &argv);
    puts("-------------------------- 2 ----------------------------");
     
    //blabla...
    // tout ce qui concerne l'interface avec les GTK_connect pour les bouton etc...
    //blabla
     
    return 0;
    }
    et tout mes GTK_widget et autre sont declarer dans une structure appeler OBJETS et dans la quelle il y a egalement un pointeur vers la structur GLOBAL qui comporte plein d'infos initilaliser avant le lancement de ma fonction Interface_graphique.

    Donc pour vous donner une idee je declare ma fenetre (dans la fonction_interface graphique) comme cela:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    objets.ptr_fenetre_principale = gtk_window_new (GTK_WINDOW_TOPLEVEL);						
    	gtk_window_set_position (GTK_WINDOW(objets.ptr_fenetre_principale), GTK_WIN_POS_CENTER);
    Voila, j'espere vous avoir donnée assez d'infos comprehensible et surtout utiles ^^
    Je vais continuer a chercher mais j'avous etre depasser par cette erreur sur le GTK_init...

    Bonne soirée a tous

  6. #6
    Rédacteur

    Avatar de gege2061
    Femme Profil pro
    Administrateur de base de données
    Inscrit en
    Juin 2004
    Messages
    5 840
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Âge : 41
    Localisation : France

    Informations professionnelles :
    Activité : Administrateur de base de données

    Informations forums :
    Inscription : Juin 2004
    Messages : 5 840
    Par défaut
    Bonjour,

    Citation Envoyé par DarkSubulba Voir le message
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    gtk_init(&argc, &argv);

Discussions similaires

  1. [utf-8] problème d'accents avec gtk+
    Par over_score dans le forum Général Python
    Réponses: 3
    Dernier message: 14/12/2005, 01h43
  2. [GTK]problème avec GTK+ sur DEV-C++
    Par afrikha dans le forum Dev-C++
    Réponses: 7
    Dernier message: 01/10/2005, 14h13
  3. [GTK]installer Dev-C++ avec gtk 1.2 ...
    Par vbcasimir dans le forum Dev-C++
    Réponses: 2
    Dernier message: 02/02/2004, 13h34

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo