f-sanitizer report run time error in coverage-cf-cf_cfdp_s-testrunner
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- c
- Domain
- embedded-iot, testing-qa
Research direction
Reproduce the sanitizer-enabled native unit-test build and inspect the reports at cf_cfdp_s.c:275 and cf_cdp_s.c:515, along with the CF_CFDP_S_Tick_Nak and CF_CFDP_S2_Nak cases in cf_cfdp_s_tests.c. Trace the null CF_ChunkWrapper_t accesses and update the relevant behavior so the tests still pass without sanitizer runtime errors.
Written by the indexing model from the issue text.
Description
Checklist (Please check before submitting)
- I reviewed the Contributing Guide.
- I performed a cursory search to see if the bug report is relevant, not redundant, nor in conflict with other tickets.
Describe the bug
f-sanitizer report runtime error::
[BEGIN] 19 CF_CFDP_S2_Nak
[ PASS] 19.001 cf_cfdp_s_tests.c:744 - CF_CFDP_S2_Nak(txn, ph)
[ PASS] 19.002 cf_test_utils.c:94 - Generated event: CF_EID_ERR_CFDP_S_PDU_NAK (101)
[ PASS] 19.003 cf_cfdp_s_tests.c:746 - CF_AppData.hk.Payload.channel_hk[txn->chan_num].counters.recv.error (1) == 1 (1)
[ PASS] 19.004 cf_cfdp_s_tests.c:753 - CF_CFDP_S2_Nak(txn, ph)
[ PASS] 19.005 cf_cfdp_s_tests.c:754 - txn->flags.tx.md_need_send (1) == true (1)
[ PASS] 19.006 cf_cfdp_s_tests.c:755 - CF_AppData.hk.Payload.channel_hk[txn->chan_num].counters.recv.nak_segment_requests (1) == 1 (1)
/home/vboxuser/Desktop/cFS/apps/cf/fsw/src/cf_cfdp_s.c:515:17: runtime error: member access within null pointer of type 'struct CF_ChunkWrapper_t'
[ PASS] 19.007 cf_cfdp_s_tests.c:764 - CF_CFDP_S2_Nak(txn, ph)
[ PASS] 19.008 cf_cfdp_s_tests.c:765 - CF_AppData.hk.Payload.channel_hk[txn->chan_num].counters.recv.nak_segment_requests (3) == 3 (3)
[ PASS] 19.009 cf_cfdp_s_tests.c:775 - CF_CFDP_S2_Nak(txn, ph)
[ PASS] 19.010 cf_cfdp_s_tests.c:776 - CF_AppData.hk.Payload.channel_hk[txn->chan_num].counters.recv.nak_segment_requests (6) == 6 (6)
[ PASS] 19.011 cf_test_utils.c:94 - Generated event: CF_EID_ERR_CFDP_S_INVALID_SR (100)
[ PASS] 19.012 cf_cfdp_s_tests.c:784 - CF_CFDP_S2_Nak(txn, ph)
[ PASS] 19.013 cf_cfdp_s_tests.c:785 - CF_AppData.hk.Payload.channel_hk[txn->chan_num].counters.recv.error (2) == 2 (2)
[ PASS] 19.014 cf_test_utils.c:94 - Generated event: CF_EID_ERR_CFDP_S_PDU_NAK (101)
[ INFO] ABORT::0 WARN::0 FLOW::0 DEBUG::0 N/A::0
[ END] 19 CF_CFDP_S2_Nak TOTAL::14 PASS::14 FAIL::0 MIR::0 TSF::0 TTF::0
[BEGIN] 06 CF_CFDP_S_Tick_Nak
/home/vboxuser/Desktop/cFS/apps/cf/fsw/src/cf_cfdp_s.c:275:44: runtime error: member access within null pointer of type 'struct CF_ChunkWrapper_t'
[ PASS] 06.001 cf_cfdp_s_tests.c:319 - CF_CFDP_S_Tick_Nak(txn, &cont)
[ PASS] 06.002 cf_cfdp_s_tests.c:320 - cont (0) == ZERO (0)
[ PASS] 06.003 cf_cfdp_s_tests.c:325 - CF_CFDP_S_Tick_Nak(txn, &cont)
[ PASS] 06.004 cf_cfdp_s_tests.c:326 - cont (1) != ZERO (0)
[ INFO] ABORT::0 WARN::0 FLOW::0 DEBUG::0 N/A::0
[ END] 06 CF_CFDP_S_Tick_Nak TOTAL::4 PASS::4 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
A clear and concise description of what you expected to happen.
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