From: Ken M. <zar...@nt...> - 2020-05-26 17:09:35
|
On Sun, May 24, 2020 at 11:21:34AM -0700, Branden Archer wrote: > Hi Ken. > Hi Branden, it's taken me a little while to get back to this, but here we go: > Thanks for taking a look at the logs, Chris. > > I'd like to give another look over the logs to see what may be amiss. > [...] > > and all those should report "Passed". I notice that there are two tests > which are not reporting the expected result: > > check_check_master.c:746:F:Core Tests:test_check_all_msgs:179: For > test 179:Signal Tests:test_fpe expected 'Received signal 8 (Floating > point exception)', got 'Passed' > check_check_master.c:746:F:Core Tests:test_check_all_msgs:180: For > test 180:Signal Tests:test_mark_point expected 'Received signal 8 > (Floating point exception)', got 'Shouldn't reach here' > > > Both of these failures are related to raising SIGFPE. Looking at the first > test, test_fpe: > > > START_TEST(test_fpe) > > { > > record_test_name(tcase_name()); > > record_failure_line_num(__LINE__-4); /* -4 as the failure is reported at > START_TEST() */ > > raise (SIGFPE); > > } > > > Apparently on the system under test raise(SIGFPE) is either not causing a > signal or Check is not able to detect the signal. Other signals being > tested (such as SIGSEGV in test_segv) are being correctly detected. > While going through the details of my other package tests in this build, I noticed that bash seemed to be failing because it didn't SIGFPE. ... > The signal tests are only enabled with fork() is enabled. If fork() is > disabled the test will not be run, as it will not be relevant (e.g. Check > cannot detect signals unless the test are run from within their own > processes). > > I suggest looking into an example program that raises a SIGFPE and > determining if it does cause a failure or not. For example. on my OSX > system: > > Brandens-MBP:raise brarcher$ cat test.c > > #include <stdio.h> > > #include <signal.h> > > > int main() { > > printf("Before\n"); > > raise(SIGFPE); > > printf("After\n"); > > return 0; > > } > > Brandens-MBP:raise brarcher$ gcc test.c > > Brandens-MBP:raise brarcher$ ./a.out > > Before > > Floating point exception: 8 > > Brandens-MBP:raise brarcher$ > > > Hope it helps. > > - Branden > Using that program: ken@plexi ~/check-debug $vim test.c ken@plexi ~/check-debug $gcc test.c ken@plexi ~/check-debug $./a.out Before After So I am indeed not getting that signal. However, if I change the program to do a division by zero ken@plexi ~/check-debug $diff -u test.c divbyzero.c --- test.c 2020-05-26 17:48:11.655277178 +0100 +++ divbyzero.c 2020-05-26 17:59:22.661766358 +0100 @@ -5,13 +5,18 @@ int main() { + int a = 1000; + int z = 0; + int result; + printf("Before\n"); - raise(SIGFPE); + //raise(SIGFPE); + result = a / z; printf("After\n"); - return 0; + return result; } I get the exception - ken@plexi ~/check-debug $./divbyzero Before Floating point exception So, raise on its own apparently doesn't generate the exception. ĸen -- Do you not know that, what you belittle by the name tree is but the mere four-dimensional analogue of a whole multidimensional universe which - no, I can see you do not. -- Druellae (a Dryad) |