--- rpl/src/rpl.h 2016/03/23 21:51:14 1.294 +++ rpl/src/rpl.h 2016/10/11 12:02:46 1.302 @@ -1,7 +1,6 @@ -#define DEBUG_ERREURS /* ================================================================================ - RPL/2 (R) version 4.1.25 + RPL/2 (R) version 4.1.26 Copyright (C) 1989-2016 Dr. BERTRAND Joël This file is part of RPL/2. @@ -65,6 +64,11 @@ # define SA_ONSTACK 0 #endif +#ifdef BROKEN_SIGSEGV +# undef HAVE_STACK_OVERFLOW_RECOVERY +# undef HAVE_SIGSEGV_RECOVERY +#endif + #define DEBUG_TRACE uprintf("[%d/%X] %s(%d)\n", \ getpid(), pthread_self(), __FILE__, __LINE__); #define TEST_ABSENCE_FICHIER(nom) \ @@ -216,7 +220,11 @@ # endif # include "sqlite3.h" -# include "sigsegv.h" + +# ifndef BROKEN_SIGSEGV +# include "sigsegv.h" +# endif + # ifdef OS2 // Bug de libsigsegv # undef HAVE_STACK_OVERFLOW_RECOVERY @@ -273,6 +281,7 @@ # define __STATIC_MUTEX_INITIALIZATION__ #endif + /* ================================================================================ Bugs spécifiques @@ -529,8 +538,7 @@ union semun __EXTERN__ pthread_mutex_t mutex_sem __STATIC_MUTEX_INITIALIZATION__; __EXTERN__ volatile int routine_recursive; - __EXTERN__ volatile sig_atomic_t - nombre_thread_surveillance_processus; + __EXTERN__ volatile int nombre_thread_surveillance_processus; # define SEM_FORK 0 # define SEM_QUEUE 1 @@ -810,6 +818,36 @@ pid_t debug_fork(); # define __erreur_(i) i #endif +#ifdef DEBUG_FICHIERS +# define open(a, ...) \ + ({ ufprintf(stderr, "[%d] OPEN %s AT %s() FROM %s LINE %d\n", \ + getpid(), a, \ + __FUNCTION__, __FILE__, __LINE__); open(a, __VA_ARGS__); }) +# define pipe(a) \ + ({ ufprintf(stderr, "[%d] PIPE %s AT %s() FROM %s LINE %d\n", \ + getpid(), a, \ + __FUNCTION__, __FILE__, __LINE__); pipe(a); }) +# define shm_open(a, ...) \ + ({ ufprintf(stderr, "[%d] SHM_OPEN %s AT %s() FROM %s LINE %d\n", \ + getpid(), a, \ + __FUNCTION__, __FILE__, __LINE__); shm_open(a, __VA_ARGS__); }) +# define shm_unlink(a) \ + ({ ufprintf(stderr, "[%d] SHM_UNLINK %s AT %s() FROM %s LINE %d\n", \ + getpid(), a, \ + __FUNCTION__, __FILE__, __LINE__); shm_unlink(a); }) +# define sem_open(a, ...) \ + ({ ufprintf(stderr, "[%d] SEM_OPEN %s AT %s() FROM %s LINE %d\n", \ + getpid(), a, \ + __FUNCTION__, __FILE__, __LINE__); sem_open(a, __VA_ARGS__); }) +# define sem_unlink(a) \ + ({ ufprintf(stderr, "[%d] SEM_UNLINK %s AT %s() FROM %s LINE %d\n", \ + getpid(), a, \ + __FUNCTION__, __FILE__, __LINE__); sem_unlink(a); }) +# define close(a) \ + ({ ufprintf(stderr, "[%d] CLOSE %s AT %s() FROM %s LINE %d\n", \ + getpid(), a, \ + __FUNCTION__, __FILE__, __LINE__); close(a); }) +#endif // -1 : erreur provoquée par une bibliothèque externe #ifndef RPLARGS @@ -3120,7 +3158,10 @@ void interruption3(int signal); void interruption4(int signal); void interruption5(int signal); void interruption6(int signal); -void interruption_depassement_pile(int urgence, stackoverflow_context_t scp); +#ifdef HAVE_SIGSEGV_RECOVERY + void interruption_depassement_pile(int urgence, + stackoverflow_context_t scp); +#endif void inversion_matrice(struct_processus *s_etat_processus, struct_matrice *s_matrice); void lancement_daemon(struct_processus *s_etat_processus);