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

CPN W64: simulator crashes on selection of FLYSKY external module #3682

Closed
1 task done
mha1 opened this issue Jun 13, 2023 · 6 comments · Fixed by #3501
Closed
1 task done

CPN W64: simulator crashes on selection of FLYSKY external module #3682

mha1 opened this issue Jun 13, 2023 · 6 comments · Fixed by #3501
Assignees
Labels
bug 🪲 Something isn't working simulator
Milestone

Comments

@mha1
Copy link
Contributor

mha1 commented Jun 13, 2023

Is there an existing issue for this problem?

  • I have searched the existing issues

What part of EdgeTX is the focus of this bug?

Companion

Current Behavior

W64 simulator crashes if FLYSKY is chosen as external RF module.

Expected Behavior

Don't crash

Steps To Reproduce

  1. standalone simulator
  • start Firmware Simulator 2.9
  • goto model settings and select external RF module
  • select FLYSKY
  1. from Companion
  • start Companion 2.9
  • select File/New then click on +Model
  • press cancel to exit the wizard
  • double click on the newly created MODEL01
  • select AFHDS3 as external radio module
  • press simulate

Version

Nightly (Please give date/commit below)

Transmitter

Radiomaster TX16S / TX16SMK2

Operating System (OS)

Windows

OS Version

No response

Anything else?

Companion W64 build: Actions, main branch, Windows Companion 64-bit, chore: Translation catchup (#3619) - https://github.com/EdgeTX/edgetx/suites/13479597982/artifacts/740096546

Note: the crash was introduced with commit 125fd2b (#3442)

@richardclli: please check

@mha1 mha1 added bug 🪲 Something isn't working triage Bug report awaiting review / sorting labels Jun 13, 2023
@pfeerick pfeerick added this to the 2.9 milestone Jun 17, 2023
@pfeerick pfeerick added simulator and removed triage Bug report awaiting review / sorting labels Jun 17, 2023
@richardclli
Copy link
Collaborator

Note: the crash was introduced with commit 125fd2b (#3442)

@raphaelcoeffic The problematic code is your work. Not sure where is the best way to prevent SIMU to crash in your serial API.

@richardclli
Copy link
Collaborator

Interesting, cannot repeat this with Linux simulator. It will not crash.

@pfeerick pfeerick self-assigned this Jun 19, 2023
@pfeerick
Copy link
Member

pfeerick commented Jun 19, 2023

Able to reproduce on WSL2 with current main (excuse the Japanese, didn't bother changing it from a prior test build), as well as native Windows Companion simulator.

https://github.com/EdgeTX/edgetx/tree/pfeerick/issue3682 is a tentative fix, until Raphael screams at me it's not the way to fix it 🤭

Code_ENBjNstwRn.mp4

image

@richardclli
Copy link
Collaborator

Interesting, if this is the problem, I should be able to repeat in Linux sim, obviously a nullptr problem.

@richardclli
Copy link
Collaborator

@pfeerick Please check if this PR has problem:

#3501

@raphaelcoeffic recommended this change and may solve the problem.

inline const etx_serial_driver_t* modulePortGetSerialDrv(const etx_module_driver_t& d) {
if (d.port == nullptr) return nullptr;
return d.port->drv.serial;
}
inline const etx_timer_driver_t* modulePortGetTimerDrv(const etx_module_driver_t& d) {
if (d.port == nullptr) return nullptr;
return d.port->drv.timer;
}

@pfeerick pfeerick linked a pull request Jun 19, 2023 that will close this issue
4 tasks
@pfeerick
Copy link
Member

Yup, that nullptr check will do the trick. So was already fixed in #3501 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🪲 Something isn't working simulator
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants