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

Threads & Processus C++ Discussion :

Segfault a la fermeture d'un threads


Sujet :

Threads & Processus C++

  1. #1
    Membre averti
    Profil pro
    Inscrit en
    Mai 2010
    Messages
    43
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mai 2010
    Messages : 43
    Par défaut Segfault a la fermeture d'un threads
    Bonjour,

    J'ai un probleme avec mon threads , a la fermeture du programme le threads s'arrête avec un segfault que je lance le thread avec la sdl ou pthread ....
    Ici les dernier souffle du debugger:

    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
    In SDL_Delay () (D:\CodeBlocks\projets\34\bin\Debug\SDL.dll)
    In SDL_SemPost () (D:\CodeBlocks\projets\34\bin\Debug\SDL.dll)
    In msvcrt!free () (C:\Windows\syswow64\msvcrt.dll)
    In msvcrt!memset () (C:\Windows\syswow64\msvcrt.dll)
    In msvcrt!free () (C:\Windows\syswow64\msvcrt.dll)
    In ntdll!LdrWx86FormatVirtualImage () (C:\Windows\system32\ntdll.dll)
    In ntdll!RtlEncodePointer () (C:\Windows\system32\ntdll.dll)
    In ntdll!LdrWx86FormatVirtualImage () (C:\Windows\system32\ntdll.dll)
    In ntdll!RtlEncodePointer () (C:\Windows\system32\ntdll.dll)
    In ntdll!ZwAccessCheckByTypeAndAuditAlarm () (C:\Windows\system32\ntdll.dll)
    In ntdll!AlpcMaxAllowedMessageLength () (C:\Windows\system32\ntdll.dll)
    In ntdll!TpQueryPoolStackInformation () (C:\Windows\system32\ntdll.dll)
    In ntdll!LdrWx86FormatVirtualImage () (C:\Windows\system32\ntdll.dll)
    In ntdll!TpQueryPoolStackInformation () (C:\Windows\system32\ntdll.dll)
    In ntdll!RtlSidHashLookup () (C:\Windows\system32\ntdll.dll)
    In ntdll!TpQueryPoolStackInformation () (C:\Windows\system32\ntdll.dll)
    In ntdll!LdrQueryProcessModuleInformation () (C:\Windows\system32\ntdll.dll)
    In ntdll!TpQueryPoolStackInformation () (C:\Windows\system32\ntdll.dll)
    In ntdll!TpReleaseTimer () (C:\Windows\system32\ntdll.dll)
    In ntdll!LdrAddRefDll () (C:\Windows\system32\ntdll.dll)
    In ntdll!TpReleaseTimer () (C:\Windows\system32\ntdll.dll)
    In ntdll!TpDbgSetLogRoutine () (C:\Windows\system32\ntdll.dll)
    In ntdll!TpQueryPoolStackInformation () (C:\Windows\system32\ntdll.dll)
    In ntdll!CsrAllocateCaptureBuffer () (C:\Windows\system32\ntdll.dll)
    In ntdll!RtlCreateUserStack () (C:\Windows\system32\ntdll.dll)
    In ntdll!RtlGetDaclSecurityDescriptor () (C:\Windows\system32\ntdll.dll)
    In ntdll!RtlImageRvaToSection () (C:\Windows\system32\ntdll.dll)
    In ntdll!RtlGetDaclSecurityDescriptor () (C:\Windows\system32\ntdll.dll)
    In ntdll!RtlCreateUserStack () (C:\Windows\system32\ntdll.dll)
    In ntdll!CsrAllocateCaptureBuffer () (C:\Windows\system32\ntdll.dll)
    In ntdll!TpQueryPoolStackInformation () (C:\Windows\system32\ntdll.dll)
    In ntdll!RtlValidateHeap () (C:\Windows\system32\ntdll.dll)
    In ntdll!LdrWx86FormatVirtualImage () (C:\Windows\system32\ntdll.dll)
    In ntdll!RtlEncodePointer () (C:\Windows\system32\ntdll.dll)
    In ntdll!LdrWx86FormatVirtualImage () (C:\Windows\system32\ntdll.dll)
    In ntdll!RtlEncodePointer () (C:\Windows\system32\ntdll.dll)
    In ntdll!ZwAccessCheckByTypeAndAuditAlarm () (C:\Windows\system32\ntdll.dll)
    In ntdll!AlpcMaxAllowedMessageLength () (C:\Windows\system32\ntdll.dll)
    In ntdll!RtlEncodePointer () (C:\Windows\system32\ntdll.dll)
    In ntdll!RtlGetThreadPreferredUILanguages () (C:\Windows\system32\ntdll.dll)
    In ntdll!RtlEncodePointer () (C:\Windows\system32\ntdll.dll)
    In ntdll!ZwAccessCheckByTypeAndAuditAlarm () (C:\Windows\system32\ntdll.dll)
    In ntdll!RtlEncodePointer () (C:\Windows\system32\ntdll.dll)
    In ntdll!ZwAccessCheckByTypeAndAuditAlarm () (C:\Windows\system32\ntdll.dll)
    In ntdll!AlpcMaxAllowedMessageLength () (C:\Windows\system32\ntdll.dll)
    In ntdll!RtlImageRvaToSection () (C:\Windows\system32\ntdll.dll)
    In ntdll!AlpcMaxAllowedMessageLength () (C:\Windows\system32\ntdll.dll)
    In ntdll!ZwAccessCheckByTypeAndAuditAlarm () (C:\Windows\system32\ntdll.dll)
    In ntdll!RtlIdnToAscii () (C:\Windows\system32\ntdll.dll)
    In ntdll!RtlLeaveCriticalSection () (C:\Windows\system32\ntdll.dll)
    In ntdll!AlpcMaxAllowedMessageLength () (C:\Windows\system32\ntdll.dll)
    In ntdll!RtlLeaveCriticalSection () (C:\Windows\system32\ntdll.dll)
    In wcsnicmp () (C:\Windows\system32\ntdll.dll)
    In ntdll!RtlLeaveCriticalSection () (C:\Windows\system32\ntdll.dll)
    In ntdll!EtwTraceEventInstance () (C:\Windows\system32\ntdll.dll)
    In ntdll!LdrGetDllHandleEx () (C:\Windows\system32\ntdll.dll)
    In ntdll!LdrLoadAlternateResourceModuleEx () (C:\Windows\system32\ntdll.dll)
    Program received signal SIGSEGV, Segmentation fault.
    In newton!NewtonCreateCompoundCollisionFromMesh () (D:\CodeBlocks\projets\34\bin\Debug\newton.dll)
    Et la la fonction du thread:
    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
    int f_prepare (void* fpsetworld)
    {
        argnewtonupdate* arg=(argnewtonupdate*)fpsetworld;
     
        while(!(*(arg->end)))
        {
            if(!(*(arg->pause)))
            {
                (*arg->progress) = IN_PROGRESS;
                SDL_framerateDelay ((arg->manager));
                NewtonUpdate ((arg->nWorld), 1.0f/80.0f);
            }
            else
            {
            SDL_Delay(50);
            }
            (*arg->progress) = IDLE;
        }
        return 0;
    }
    Je sèche complètement quelqu'un peut il m'aider ??

    ps: a noter que je n'utilise pas la fonction NewtonCreateCompoundCollisionFromMesh () qui provoque la segfault dans mon programme.

  2. #2
    Membre averti
    Profil pro
    Inscrit en
    Mai 2010
    Messages
    43
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mai 2010
    Messages : 43
    Par défaut
    up

  3. #3
    Membre expérimenté Avatar de vikki
    Profil pro
    Inscrit en
    Mai 2007
    Messages
    292
    Détails du profil
    Informations personnelles :
    Âge : 40
    Localisation : France, Bouches du Rhône (Provence Alpes Côte d'Azur)

    Informations forums :
    Inscription : Mai 2007
    Messages : 292
    Par défaut
    Espérer que le thread se termine bien proprement à la fin du programme me semble un peu optimiste . Tu devrais peut être attendre la fin de l'exécution de tous tes threads avant de quitter le prog avec un monthread->join() (ou tout autre fonction permettant d'attendre le fin de l'exécution du thread).

  4. #4
    Membre averti
    Profil pro
    Inscrit en
    Mai 2010
    Messages
    43
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mai 2010
    Messages : 43
    Par défaut
    Même en mettant en attente avec sleep pendant 10 sec il bug .....

Discussions similaires

  1. Détection fermeture pour arrêté thread
    Par kt180 dans le forum C#
    Réponses: 8
    Dernier message: 10/11/2010, 16h26
  2. Fermeture application - Erreur thread
    Par b_lob dans le forum C#
    Réponses: 4
    Dernier message: 23/02/2007, 16h47
  3. [C#] - Problème sur fermeture d'un thread
    Par Erakis dans le forum Windows Forms
    Réponses: 4
    Dernier message: 27/01/2006, 01h22
  4. Probleme fermeture Thread
    Par Raton dans le forum MFC
    Réponses: 4
    Dernier message: 29/09/2005, 09h51
  5. [Thread][socket]Problème de fermeture d'un thread
    Par meda dans le forum Concurrence et multi-thread
    Réponses: 4
    Dernier message: 04/11/2004, 01h03

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