f-sanitizer report run time error in coverage-cf-cf_cfdp_r-testrunner
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- c
- Domain
- networking
Research direction
Start with the sanitizer reports at lines 133 and 426 of fsw/src/cf_cfdp_r.c, then read the related CF_CFDP_R2_Complete and CF_CFDP_R2_SubstateRecvFileData cases in cf_cfdp_r_tests.c. Reproduce with the listed sanitizer compile options and native unit-test commands. Done means the affected tests still pass without null-pointer runtime errors.
Written by the indexing model from the issue text.
Description
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:
-
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
) -
Make SIMULATION=native ENABLE_UNIT_TESTS=true prep
-
make install
-
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
- Dominant language
- C
- Stars
- 123
- Forks
- 82
- Avg merge
- 2d 22h
- Merged PRs (30d)
- 2
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from nasa/CF
-
CF_CFDP_S_SendFileData computes the file checksum from the SB buffer after CFE_SB_TransmitBufferOpen
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Assert checks non-existent variable (`pt`) in `CF_CFDP_ProcessPlaybackDirectory()`May be free again A pull request for this issue was closed without being merged. Openinvalid
Difficulty 1/5 Under an hour Newbie friendliness 68/100
Similar issues
-
needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
389ds/389-ds-base#8251 ·
Maintainers usually reply within 1 day
-
bug data-types
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
ClickHouse/clickhouse-cpp#645 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
ROCm/hrx-system#3628 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
OpenPrinting/cups#1844 ·
Maintainers usually reply within 1 day