phc2sys process exits with status 255

Bug #1983022 reported by Douglas Henrique Koerich
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
StarlingX
Fix Released
Medium
Douglas Henrique Koerich

Bug Description

Brief Description
-----------------
phc2sys service terminates with exit code 255 (-1) without any indication of root cause; other PTP services (ts2phc and ptp4l) continue to work without issues

Severity
--------
Major: feature is usable but degraded

Steps to Reproduce
------------------
- Stop the phc2sys service that is using interface "ifaceX" as master clock (-s ifaceX)
- Launch phc2sys program with same configuration (-f, -s, etc.) with debugging messages (-l 7)
- Provoke an instability in the interface "ifaceX" (e.g. iplink set dev ifaceX down/up)
- Wait for program to exit with code=255 and check user.log contains the message "ioctl PTP_SYS_OFFSET_EXTENDED: Device or resource busy" (it does not happen all the times, may need to repeat the instability step)

Expected Behavior
------------------
phc2sys service/program should continue to work

Actual Behavior
----------------
phc2sys service/program terminates with exit code=255

Reproducibility
---------------
Reproducible, but not 100% of times

System Configuration
--------------------
AIO-DX + worker(s)

Branch/Pull Time/Commit
-----------------------
stx6.0

Last Pass
---------
This scenario has not been tested before.

Timestamp/Logs
--------------
Original logs that started analysis:

2022-07-05T02:18:28.803 Notice: 2022-07-05 02:18:28 +0000 /Stage[main]/Platform::Ptpinstance/Ptp_config_files[phc-inst1]/Exec[enable-phc-inst1]/returns: executed successfully
2022-07-05T02:33:10.718 worker-0 systemd[1]: notice <email address hidden>: main process exited, code=exited, status=255/n/a
2022-07-05T02:33:10.745 worker-0 kernel: err [ 311.937905] ice 0000:51:00.0: PTP failed to get time
2022-07-05T02:33:13.000 worker-0 ts2phc: err [319.844] nmea source timed out

Logs from investigation (with steps to reproduce):

worker-0 phc2sys: debug [31190.453] phc-test ioctl PTP_SYS_OFFSET_EXTENDED: Device or resource busy

Test Activity
-------------
Evaluation

Workaround
----------
By removing "255" from phcsys's systemd configuration the service can at least restart

Changed in starlingx:
status: New → In Progress
assignee: nobody → Douglas Henrique Koerich (dkoerich-wr)
Ghada Khalil (gkhalil)
Changed in starlingx:
importance: Undecided → Medium
tags: added: stx.8.0 stx.networking
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to integ (master)

Fix proposed to branch: master
Review: https://review.opendev.org/c/starlingx/integ/+/851437

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to integ (master)

Reviewed: https://review.opendev.org/c/starlingx/integ/+/851437
Committed: https://opendev.org/starlingx/integ/commit/0a9b0570e9266d7d03e17de85f67fb64041dee5d
Submitter: "Zuul (22348)"
Branch: master

commit 0a9b0570e9266d7d03e17de85f67fb64041dee5d
Author: Douglas Henrique Koerich <email address hidden>
Date: Thu Jul 28 13:42:53 2022 -0300

    Don't exit when reading of PHC fails with EBUSY

    Pull in the following upstream commits for both CentOS and Debian:
    https://sourceforge.net/p/linuxptp/code/ci/7824b13db9533ddebe37cf444d7aaa5d235575d3/
    https://sourceforge.net/p/linuxptp/code/ci/270709323a161ff1cb83af511ce50691152c75cf/
    https://sourceforge.net/p/linuxptp/code/ci/dadd2593c7beaee9eba5828a7bd8a0b5849dd8bb/
    https://sourceforge.net/p/linuxptp/code/ci/e8dc364f9fd5fbdac5d2c5e433f28e9da0028d49/
    See the patches themselves for more details.

    Closes-Bug: 1983022
    Signed-off-by: Douglas Henrique Koerich <email address hidden>
    Change-Id: I20f18b17752588b5b031eed88b5e52fb15c830fa

Changed in starlingx:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.