Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xcvrd crash: Exception occured at CmisManagerTask thread due to TypeError #379

Closed
amnsinghal opened this issue Jun 2, 2023 · 2 comments
Closed

Comments

@amnsinghal
Copy link

cmis.py:get_application() did not check 'NoneType' return from xcvr_eeprom.read().

Jun  1 23:32:49.924628 sonic ERR pmon#xcvrd[273]: Exception occured at CmisManagerTask thread due to TypeError("unsupported operand type(s) for >>: 'NoneType' and 'int'")
Jun  1 23:32:49.927284 sonic ERR pmon#xcvrd[273]: Traceback (most recent call last):
Jun  1 23:32:49.927284 sonic ERR pmon#xcvrd[273]:   File "/usr/local/lib/python3.9/dist-packages/xcvrd/xcvrd.py", line 1666, in run
Jun  1 23:32:49.927301 sonic ERR pmon#xcvrd[273]:     self.task_worker()
Jun  1 23:32:49.927339 sonic ERR pmon#xcvrd[273]:   File "/usr/local/lib/python3.9/dist-packages/xcvrd/xcvrd.py", line 1536, in task_worker
Jun  1 23:32:49.927375 sonic ERR pmon#xcvrd[273]:     need_update = self.is_cmis_application_update_required(api, appl, host_lanes_mask)
Jun  1 23:32:49.927394 sonic ERR pmon#xcvrd[273]:   File "/usr/local/lib/python3.9/dist-packages/xcvrd/xcvrd.py", line 1162, in is_cmis_application_update_required
Jun  1 23:32:49.927413 sonic ERR pmon#xcvrd[273]:     elif app_old != api.get_application(lane):
Jun  1 23:32:49.927432 sonic ERR pmon#xcvrd[273]:   File "/usr/local/lib/python3.9/dist-packages/sonic_platform_base/sonic_xcvr/api/public/cmis.py", line 2000, in get_application
Jun  1 23:32:49.927447 sonic ERR pmon#xcvrd[273]:     appl = self.xcvr_eeprom.read(name) >> 4
Jun  1 23:32:49.927465 sonic ERR pmon#xcvrd[273]: TypeError: unsupported operand type(s) for >>: 'NoneType' and 'int'
Jun  1 23:32:49.927621 sonic ERR pmon#xcvrd[273]: Xcvrd: exception found at child thread CmisManagerTask due to TypeError("unsupported operand type(s) for >>: 'NoneType' and 'int'")
Jun  1 23:32:49.927621 sonic ERR pmon#xcvrd[273]: Exiting main loop as child thread raised exception!
Jun  1 23:32:49.944454 sonic INFO pmon#supervisord 2023-06-01 23:32:49,944 INFO exited: xcvrd (terminated by SIGKILL; not expected)

Similar issue fixed recently: #371

@prgeor
Copy link
Collaborator

prgeor commented Oct 20, 2023

@jaganbal-a could you please take a look. Check with Anoop?

@jaganbal-a
Copy link
Contributor

Issue is not reproducible in latest image.
Please close the issue and reopen if the issue reproducible.

@prgeor prgeor closed this as completed Dec 1, 2023
oleksandrivantsiv pushed a commit to oleksandrivantsiv/sonic-platform-common that referenced this issue Oct 25, 2024
**Why I did it**
[Semgrep](https://github.com/returntocorp/semgrep) is a static analysis tool to find security vulnerabilities.
When opening a PR or commtting to PR, Semgrep performs a diff-aware scanning, which scans changed files in PRs.
When merging PR, Semgrep performs a full scan on master branch and report all findings.

Ref: - [Supported Language](https://semgrep.dev/docs/supported-languages/#language-maturity) - [Semgrep Rules](https://registry.semgrep.dev/rule)

**How I did it**
Integrate Semgrep into this repository by committing a job configuration file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants