Skip to content

f-sanitizer report run time error in coverage-cf-cf_cfdp_r-testrunner #450

@avan989

Description

@avan989

Checklist (Please check before submitting)

  • I reviewed the Contributing Guide.
  • performed a cursory search to see if the bug report is relevant, not redundant, nor in conflict with other tickets.

Describe the bug
The following run time error are reported when running with f-sanitizer options:

[BEGIN] 10 CF_CFDP_R2_Complete
[ PASS] 10.001 cf_cfdp_r_tests.c:494 - CF_CFDP_R2_Complete(txn, 0)
[ PASS] 10.002 cf_cfdp_r_tests.c:495 - txn->state_data.receive.sub_state (0) == CF_RxSubState_FILEDATA (0)
[ PASS] 10.003 cf_cfdp_r_tests.c:500 - CF_CFDP_R2_Complete(txn, 0)
[ PASS] 10.004 cf_cfdp_r_tests.c:505 - CF_CFDP_R2_Complete(txn, 1)
[ PASS] 10.005 cf_cfdp_r_tests.c:506 - txn->flags.rx.send_nak (1) == true (1)
[ PASS] 10.006 cf_cfdp_r_tests.c:507 - txn->state_data.receive.sub_state (0) == CF_RxSubState_FILEDATA (0)
[ PASS] 10.007 cf_cfdp_r_tests.c:508 - txn->state_data.receive.r2.acknak_count (1) == 1 (1)
[ PASS] 10.008 cf_cfdp_r_tests.c:511 - CF_CFDP_R2_Complete(txn, 1)
[ PASS] 10.009 cf_cfdp_r_tests.c:512 - txn->flags.rx.send_fin (1) == true (1)
[ PASS] 10.010 cf_cfdp_r_tests.c:513 - txn->flags.rx.complete (1) == true (1)
[ PASS] 10.011 cf_test_utils.c:94 - Generated event: CF_EID_ERR_CFDP_R_NAK_LIMIT (72)
[ PASS] 10.012 cf_cfdp_r_tests.c:515 - CF_AppData.hk.Payload.channel_hk[txn->chan_num].counters.fault.nak_limit (1) == 1 (1)
/home/vboxuser/Desktop/cFS/apps/cf/fsw/src/cf_cfdp_r.c:133:44: runtime error: member access within null pointer of type 'struct CF_ChunkWrapper_t'
[ PASS] 10.013 cf_cfdp_r_tests.c:521 - CF_CFDP_R2_Complete(txn, 0)
[ PASS] 10.014 cf_cfdp_r_tests.c:522 - txn->state_data.receive.sub_state (0) == CF_RxSubState_FILEDATA (0)
[ PASS] 10.015 cf_cfdp_r_tests.c:526 - CF_CFDP_R2_Complete(txn, 1)
[ PASS] 10.016 cf_cfdp_r_tests.c:527 - txn->flags.rx.send_nak (0) == false (0)
[ PASS] 10.017 cf_cfdp_r_tests.c:528 - txn->flags.rx.send_fin (1) == true (1)
[ PASS] 10.018 cf_cfdp_r_tests.c:529 - txn->flags.rx.complete (1) == true (1)
[ PASS] 10.019 cf_cfdp_r_tests.c:533 - CF_CFDP_R2_Complete(txn, 1)
[ PASS] 10.020 cf_cfdp_r_tests.c:534 - txn->flags.rx.send_nak (1) == true (1)
[ PASS] 10.021 cf_cfdp_r_tests.c:535 - txn->state_data.receive.sub_state (0) == CF_RxSubState_FILEDATA (0)
[ PASS] 10.022 cf_cfdp_r_tests.c:536 - txn->state_data.receive.r2.acknak_count (1) == 1 (1)
[ INFO]                        ABORT::0     WARN::0     FLOW::0     DEBUG::0     N/A::0   
[  END] 10 CF_CFDP_R2_Complete  TOTAL::22    PASS::22    FAIL::0     MIR::0     TSF::0     TTF::0  
[BEGIN] 16 CF_CFDP_R2_SubstateRecvFileData
/home/vboxuser/Desktop/cFS/apps/cf/fsw/src/cf_cfdp_r.c:426:9: runtime error: member access within null pointer of type 'struct CF_ChunkWrapper_t'
[ PASS] 16.001 cf_cfdp_r_tests.c:769 - CF_CFDP_R2_SubstateRecvFileData(txn, ph)
[ PASS] 16.002 cf_cfdp_r_tests.c:770 - CallCount: CF_ChunkListAdd() (1) == 1 (1)
[ PASS] 16.003 cf_cfdp_r_tests.c:771 - txn->state_data.receive.r2.acknak_count (0) == ZERO (0)
[ PASS] 16.004 cf_cfdp_r_tests.c:772 - CallCount: CF_CFDP_ArmAckTimer() (1) == 1 (1)
[ PASS] 16.005 cf_cfdp_r_tests.c:778 - CF_CFDP_R2_SubstateRecvFileData(txn, ph)
[ PASS] 16.006 cf_cfdp_r_tests.c:779 - CallCount: CF_CFDP_ArmAckTimer() (2) == 2 (2)
[ PASS] 16.007 cf_cfdp_r_tests.c:780 - txn->state_data.receive.r2.acknak_count (0) == ZERO (0)
[ PASS] 16.008 cf_cfdp_r_tests.c:786 - CF_CFDP_R2_SubstateRecvFileData(txn, ph)
[ PASS] 16.009 cf_cfdp_r_tests.c:787 - CallCount: CF_CFDP_ArmAckTimer() (2) == 2 (2)
[ PASS] 16.010 cf_cfdp_r_tests.c:788 - txn->state_data.receive.r2.acknak_count (0) == ZERO (0)
[ PASS] 16.011 cf_cfdp_r_tests.c:793 - CF_CFDP_R2_SubstateRecvFileData(txn, ph)
[ PASS] 16.012 cf_cfdp_r_tests.c:794 - txn->flags.rx.send_fin (1) == true (1)
[ PASS] 16.013 cf_cfdp_r_tests.c:800 - CF_CFDP_R2_SubstateRecvFileData(txn, ph)
[ PASS] 16.014 cf_cfdp_r_tests.c:801 - CallCount: CF_CFDP_ResetTransaction() (1) == 1 (1)
[ INFO]                        ABORT::0     WARN::0     FLOW::0     DEBUG::0     N/A::0   
[  END] 16 CF_CFDP_R2_SubstateRecvFileData TOTAL::14    PASS::14    FAIL::0     MIR::0     TSF::0     TTF::0   

To Reproduce
Steps to reproduce the behavior:

  1. Add the following option:
    add_compile_options(
    -fsanitize=address
    -fsanitize=undefined
    -fsanitize-recover=all
    -g
    )
    add_link_options(
    -fsanitize=address
    -fsanitize=undefined
    -fsanitize-recover=all
    )

  2. Make SIMULATION=native ENABLE_UNIT_TESTS=true prep

  3. make install

  4. Run Test

Expected behavior
N/A

Code snips
If applicable, add references to the software.

System observed on:

  • Hardware
  • OS: [e.g. Linux 4.4]
  • Versions [e.g. cFE 6.6, OSAL 4.2, PSP 1.3 for mcp750, any related apps]

Additional context
Add any other context about the problem here.

Reporter Info
Full name and company/organization if applicable

Anh Van, GSFC

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions