Skip to content

Fix/libiiov1 segfault #535

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

Merged
merged 2 commits into from
Apr 7, 2025
Merged

Fix/libiiov1 segfault #535

merged 2 commits into from
Apr 7, 2025

Conversation

nunojsa
Copy link
Contributor

@nunojsa nunojsa commented Apr 7, 2025

PR Description

Main patch is to fix a segfault when we fail to properly IIO context. Rest is just removal of dead unused code...

PR Type

  • Bug fix (a change that fixes an issue)
  • New feature (a change that adds new functionality)
  • Breaking change (a change that affects other repos or cause CIs to fail)

PR Checklist

  • I have followed the coding standards and guidelines
  • I have conducted a self-review of my own code changes
  • I have commented new code, particulary complex or unclear areas
  • I have checked in CI output that no new warnings/errors got introduced
  • I have updated documentation accordingly (GitHub Pages, READMEs, etc)

iio_create_context() now returns an error pointer instead of NULL when a
context is not properly created. This was later leading to a segmentation
fault.

Signed-off-by: Nuno Sá <[email protected]>
libini2.c Outdated
Comment on lines 261 to 268

/*for (i = 0; i < iio_device_get_channels_count(dev); i++)
iio_channel_attr_read_all(iio_device_get_channel(dev, i),
save_to_ini_chn_cb, &params);
iio_device_attr_read_all(dev, save_to_ini_dev_cb, &params);

params.is_debug = true;
iio_device_debug_attr_read_all(dev, save_to_ini_dev_cb, &params);*/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cristina-suteu you disabled this code in this commit (1a67750). Is it not required at all?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, yes... it might be that I just blindly removed stuff without giving it a thought if it needs rewriting...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, and I just see that likely all of the unused stuff is because of that commented code.... If it needs a rewrite, I can drop this commit

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's best to drop the commit now. Keep it local or on a separate branch in case it turns out it is needed.

Get rid of an unused variable...

Signed-off-by: Nuno Sá <[email protected]>
@nunojsa nunojsa force-pushed the fix/libiiov1-segfault branch from e1a8300 to bc83e35 Compare April 7, 2025 13:49
@nunojsa
Copy link
Contributor Author

nunojsa commented Apr 7, 2025

v2:

  • Drop libini commit;

Copy link
Contributor

@dNechita dNechita left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks!

@dNechita dNechita merged commit 3c80197 into libiio-v1-support Apr 7, 2025
2 of 4 checks passed
@dNechita dNechita deleted the fix/libiiov1-segfault branch April 7, 2025 14:43
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

Successfully merging this pull request may close these issues.

2 participants