Fossil SCM

Invoke abort() after a call to fossil_panic(), not exit(1). This will leave a core file if the system is correctly configured. Also show the panic on debugging logs.

drh 2018-07-30 16:44 UTC forum-v2
Commit 8163228997755fcb67d5f0842bf9160f2f9383197fd5e28a3452f931f502389a
1 file changed +4
--- src/printf.c
+++ src/printf.c
@@ -1085,12 +1085,16 @@
10851085
mainInFatalError = 1;
10861086
db_force_rollback();
10871087
va_start(ap, zFormat);
10881088
sqlite3_vsnprintf(sizeof(z),z,zFormat, ap);
10891089
va_end(ap);
1090
+ if( g.fAnyTrace ){
1091
+ fprintf(stderr, "/***** panic on %d *****/\n", getpid());
1092
+ }
10901093
fossil_errorlog("panic: %s", z);
10911094
rc = fossil_print_error(rc, z);
1095
+ abort();
10921096
exit(rc);
10931097
}
10941098
NORETURN void fossil_fatal(const char *zFormat, ...){
10951099
char *z;
10961100
int rc = 1;
10971101
--- src/printf.c
+++ src/printf.c
@@ -1085,12 +1085,16 @@
1085 mainInFatalError = 1;
1086 db_force_rollback();
1087 va_start(ap, zFormat);
1088 sqlite3_vsnprintf(sizeof(z),z,zFormat, ap);
1089 va_end(ap);
 
 
 
1090 fossil_errorlog("panic: %s", z);
1091 rc = fossil_print_error(rc, z);
 
1092 exit(rc);
1093 }
1094 NORETURN void fossil_fatal(const char *zFormat, ...){
1095 char *z;
1096 int rc = 1;
1097
--- src/printf.c
+++ src/printf.c
@@ -1085,12 +1085,16 @@
1085 mainInFatalError = 1;
1086 db_force_rollback();
1087 va_start(ap, zFormat);
1088 sqlite3_vsnprintf(sizeof(z),z,zFormat, ap);
1089 va_end(ap);
1090 if( g.fAnyTrace ){
1091 fprintf(stderr, "/***** panic on %d *****/\n", getpid());
1092 }
1093 fossil_errorlog("panic: %s", z);
1094 rc = fossil_print_error(rc, z);
1095 abort();
1096 exit(rc);
1097 }
1098 NORETURN void fossil_fatal(const char *zFormat, ...){
1099 char *z;
1100 int rc = 1;
1101

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button