Fossil SCM

Add a segfault simulator to the test-warning page.

drh 2018-07-19 13:13 segvhandler
Commit c4dcb00dcc5f4a5b1e5dfecdaba1686add4b962519790c8bee93dac82d990018
1 file changed +7 -1
+7 -1
--- src/main.c
+++ src/main.c
@@ -2794,10 +2794,12 @@
27942794
** the administrator only.
27952795
**
27962796
** case=1 Issue a fossil_warning() while generating the page.
27972797
** case=2 Extra db_begin_transaction()
27982798
** case=3 Extra db_end_transaction()
2799
+** case=4 Error during SQL processing
2800
+** case=5 Call the segfault handler
27992801
*/
28002802
void test_warning_page(void){
28012803
int iCase = atoi(PD("case","0"));
28022804
int i;
28032805
login_check_credentials();
@@ -2811,11 +2813,11 @@
28112813
@ <p>Generate a message to the <a href="%R/errorlog">error log</a>
28122814
@ by clicking on one of the following cases:
28132815
}else{
28142816
@ <p>This is the test page for case=%d(iCase). All possible cases:
28152817
}
2816
- for(i=1; i<=4; i++){
2818
+ for(i=1; i<=5; i++){
28172819
@ <a href='./test-warning?case=%d(i)'>[%d(i)]</a>
28182820
}
28192821
@ </p>
28202822
@ <p><ol>
28212823
@ <li value='1'> Call fossil_warning()
@@ -2835,10 +2837,14 @@
28352837
Stmt q;
28362838
db_prepare(&q, "SELECT uuid FROM blob LIMIT 5");
28372839
db_step(&q);
28382840
sqlite3_log(SQLITE_ERROR, "Test warning message during SQL");
28392841
db_finalize(&q);
2842
+ }
2843
+ @ <li value='5'> simulate segfault handling
2844
+ if( iCase==5 ){
2845
+ sigsegv_handler(0);
28402846
}
28412847
@ </ol>
28422848
@ <p>End of test</p>
28432849
style_footer();
28442850
}
28452851
--- src/main.c
+++ src/main.c
@@ -2794,10 +2794,12 @@
2794 ** the administrator only.
2795 **
2796 ** case=1 Issue a fossil_warning() while generating the page.
2797 ** case=2 Extra db_begin_transaction()
2798 ** case=3 Extra db_end_transaction()
 
 
2799 */
2800 void test_warning_page(void){
2801 int iCase = atoi(PD("case","0"));
2802 int i;
2803 login_check_credentials();
@@ -2811,11 +2813,11 @@
2811 @ <p>Generate a message to the <a href="%R/errorlog">error log</a>
2812 @ by clicking on one of the following cases:
2813 }else{
2814 @ <p>This is the test page for case=%d(iCase). All possible cases:
2815 }
2816 for(i=1; i<=4; i++){
2817 @ <a href='./test-warning?case=%d(i)'>[%d(i)]</a>
2818 }
2819 @ </p>
2820 @ <p><ol>
2821 @ <li value='1'> Call fossil_warning()
@@ -2835,10 +2837,14 @@
2835 Stmt q;
2836 db_prepare(&q, "SELECT uuid FROM blob LIMIT 5");
2837 db_step(&q);
2838 sqlite3_log(SQLITE_ERROR, "Test warning message during SQL");
2839 db_finalize(&q);
 
 
 
 
2840 }
2841 @ </ol>
2842 @ <p>End of test</p>
2843 style_footer();
2844 }
2845
--- src/main.c
+++ src/main.c
@@ -2794,10 +2794,12 @@
2794 ** the administrator only.
2795 **
2796 ** case=1 Issue a fossil_warning() while generating the page.
2797 ** case=2 Extra db_begin_transaction()
2798 ** case=3 Extra db_end_transaction()
2799 ** case=4 Error during SQL processing
2800 ** case=5 Call the segfault handler
2801 */
2802 void test_warning_page(void){
2803 int iCase = atoi(PD("case","0"));
2804 int i;
2805 login_check_credentials();
@@ -2811,11 +2813,11 @@
2813 @ <p>Generate a message to the <a href="%R/errorlog">error log</a>
2814 @ by clicking on one of the following cases:
2815 }else{
2816 @ <p>This is the test page for case=%d(iCase). All possible cases:
2817 }
2818 for(i=1; i<=5; i++){
2819 @ <a href='./test-warning?case=%d(i)'>[%d(i)]</a>
2820 }
2821 @ </p>
2822 @ <p><ol>
2823 @ <li value='1'> Call fossil_warning()
@@ -2835,10 +2837,14 @@
2837 Stmt q;
2838 db_prepare(&q, "SELECT uuid FROM blob LIMIT 5");
2839 db_step(&q);
2840 sqlite3_log(SQLITE_ERROR, "Test warning message during SQL");
2841 db_finalize(&q);
2842 }
2843 @ <li value='5'> simulate segfault handling
2844 if( iCase==5 ){
2845 sigsegv_handler(0);
2846 }
2847 @ </ol>
2848 @ <p>End of test</p>
2849 style_footer();
2850 }
2851

Keyboard Shortcuts

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