Bonjour,
J'ai un programme qui gère l’émission et la réception de donnée sur Raspbian (Dernière version stage)

Dans ma boucle principale, périodiquement, j'ouvre un fichier temporaire de stockage de données pour les émettre :
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
while 1: #Voir que faire pour l'arrêt'    #Test de réception'
    print("li")
    Ligne=[]
    print("fl")
    radio.flush_tx()
    radio.flush_rx()
    print("list")
    radio.startListening()
    print("ev")
    GPIO.add_event_detect(irq_gpio_pin, GPIO.FALLING, callback=GPIO_NRF_Int, bouncetime=75)
    print("attente")
    time.sleep(30)
    radio.stopListening()
    print("rm")
    GPIO.remove_event_detect(irq_gpio_pin)
    #Emission si nécessaire
    print("op")
 
 
    f=open(ChFiEm,"rb")
    print("rd")
    cs=csv.reader(f,delimiter=',',quotechar='"',quoting=csv.QUOTE_NONNUMERIC,lineterminator="\r\n")
    for line in cs:
        print("ap")
        Ligne.append(map(int,line))
    print("cl1")
    while(not f.closed):
        f.close()
        time.sleep(1)
    print("rm")
    f=open(ChFiEm,"wb")
    #f.truncate()
    print("cl2")
    while(not f.closed):
        f.close()
        time.sleep(1)
    for line in Ligne:
        print("ligne")
        while(not Datagl==line):
            Datagl=[line[0]]
            #Test si Heure ou tableau d'activation.'
            if len(line)==3:
                #Emission heure
                Emission(line[0],line[-2:])
            elif len(line)==7:
                #Tableau d'activation'
                Emission(line[0], line[-6:])
            #Test de bonne émission'
            radio.flush_tx()
            radio.flush_rx()
            radio.startListening()
            GPIO.add_event_detect(irq_gpio_pin, GPIO.FALLING, callback=GPIO_NRF_Int, bouncetime=75)
            time.sleep(2)
            radio.stopListening()
            GPIO.remove_event_detect(irq_gpio_pin)
            print('Data:',Datagl,'line',line)
        Datagl=[-1]
Au bout d'un certain nombre d'itérations, quand il n'y a aucune donnée à émettre, à la ligne 27, mon programme s’interrompt. Dans GDB, j'obtients l'erreur suivante :
Thread 2 "python" received signal SIGSEGV, Segmentation fault.[Switching to Thread 0x76a4e470 (LWP 2253)]
0x76a7dbc0 in ?? ()
from /usr/lib/python2.7/dist-packages/RPi/_GPIO.arm-linux-gnueabihf.so

Lorsque je fait un backtrace, j'obtiens la réponse suivante :
#0 0x76a7dbc0 in ?? ()
from /usr/lib/python2.7/dist-packages/RPi/_GPIO.arm-linux-gnueabihf.so
#1 0x00000000 in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

Avez-vous une idée du problème. Je soupçonne un pointeur null sur le fichier ou un dépassement de mémoire. Cependant, je ne sais pas comment agir pour résoudre ce problème.

Merci d'avance.