Uploaded image for project: ' AGL Development'
  1. AGL Development
  2. SPEC-4016

iMx8 : Facing segmentation issues while testing AGL service code base using CHECK Unit test framework

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • master
    • master
    • None
    • None

      Hi Josh,

      I am doing unit testing of the service codebase using the CHECK unit test framework. Written the test for calling service virtual_read function call which has an argument of type "afb_req_t". I created a dummy afb_req_x2 handler in the test file and called the virtual_read function using that dummy req handler. Created .so file for service code base and binary file for the test file. First loaded .so file using afb-daemon and after that ran the binary file but facing segmentation fault core dumped error,

      Running suite(s): RadarService
      50%: Checks: 4, Failures: 1, Errors: 1
      tests/radar_service_test.c:14: P :ServiceInitialization:PreInit:0: Passed
      tests/radar_service_test.c:33: P :ServiceInitialization:Init:0: Passed
      tests/radar_service_test.c:40: F :SerialPort:SerialInit:0: Assertion 'serial_init() == 0' failed: serial_init() == -1, 0 == 0
      tests/radar_service_test.c:70:E:SerialPort:VirtualRead:0: (after this point) Received signal 11 (Segmentation fault)

      journalctl logs
      ----------------------
      Jul 07 08:57:11 imx8mqevk audit[1644]: ANOM_ABEND auid=0 uid=0 gid=0 ses=6 subj=System pid=1644 comm="radar_service_u" exe="/home/radar-service/radar_service_unittest" sig=11 res=1
      Jul 07 08:57:11 imx8mqevk kernel: audit: type=1701 audit(1625648231.447:50): auid=0 uid=0 gid=0 ses=6 subj=System pid=1644 comm="radar_service_u" exe="/home/radar-service/radar_service_unittest" sig=11 res=1
      Jul 07 08:57:11 imx8mqevk systemd[1]: Started Process Core Dump (PID 1645/UID 0).
      Jul 07 08:57:11 imx8mqevk systemd-coredump[1646]: Process 1644 (radar_service_u) of user 0 dumped core.
      Jul 07 08:57:11 imx8mqevk systemd[1]: systemd-coredump@27-1645-0.service: Succeeded.

      From gdb, I found afb_event_push creating a problem for my service code side while trying to test the virtual_read function call.

      For Init and PreInit testing, I have taken references from SPEC-3996.

      Test source file attached please help me how to resolve the segmentation fault and make it virtual_read function to PASS state.

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            jobol-iot jose bollo
            rmani0029 Manikandan R
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: