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

context.h exceptions should be documented and caught #1727

Open
Tracked by #1929
mwestphal opened this issue Nov 23, 2024 · 13 comments
Open
Tracked by #1929

context.h exceptions should be documented and caught #1727

mwestphal opened this issue Nov 23, 2024 · 13 comments
Assignees
Labels
help wanted Please help with this issue! source:libf3d
Milestone

Comments

@mwestphal
Copy link
Contributor

mwestphal commented Nov 23, 2024

Describe the bug
context.h can throw exceptions, however they are not documented and not caugth, relying on main.cxx catch all to not segfault, this should be fixed.

To Reproduce
Steps to reproduce the behavior:

  1. comment main.cxx catch all
  2. ctest -R WGL
  3. segfault
@mwestphal mwestphal added this to the 3.1.0 milestone Nov 23, 2024
@mwestphal mwestphal added this to F3D Nov 23, 2024
@mwestphal mwestphal changed the title context.h exception should be documented and caugth context.h exception should be documented and caught Nov 23, 2024
@mwestphal mwestphal changed the title context.h exception should be documented and caught context.h exceptions should be documented and caught Nov 23, 2024
@saneck2150
Copy link

Hi, i would like to work on this issue, if is still relevant

@mwestphal
Copy link
Contributor Author

It is! Do you know guidance ?

@saneck2150
Copy link

saneck2150 commented Nov 23, 2024

No, I'm just starting to figure out the project, where can I get documentation? I thought it is a good issue to get started with

@mwestphal
Copy link
Contributor Author

where can I get documentation?

https://f3d.app

https://discord.f3d.app

I thought it is a good issue to get started with

It is! But I wrote it a bit fast, I can add more context

@mwestphal
Copy link
Contributor Author

Do you need any help moving forward @saneck2150 ?

@saneck2150
Copy link

Hello, yes, I had problems with running the program, I asked tech support to help with solving it in your discord, but in the end nothing worked out. So I can't work with this project, sorry :(

@mwestphal
Copy link
Contributor Author

No worries @saneck2150 , thanks for the feedback.

@mwestphal mwestphal added the help wanted Please help with this issue! label Jan 28, 2025
@mwestphal mwestphal mentioned this issue Feb 27, 2025
35 tasks
@exbluesbreaker
Copy link
Contributor

I would like to try to work on this issue.

@mwestphal
Copy link
Contributor Author

Sure!

@exbluesbreaker
Copy link
Contributor

First of all, this comment took my attention from VTK Doxygen:

vtkDynamicLoader provides a portable interface to loading dynamic libraries into a process.

See also:
A more portable and lightweight solution is kwsys::DynamicLoader

The second, I wanted to clarify a scope of this task. I see there are loading_exception and symbol_exception thrown by context itself. Does it mean we need to rework those 2, or task is about handling other possible causes of exception in context.cxx - loading/getting symbols for different OpenGL wrappers (egl,glx etc.)?

@mwestphal
Copy link
Contributor Author

I see there are loading_exception and symbol_exception thrown by context itself. Does it mean we need to rework those 2, or task is about handling other possible causes of exception in context.cxx - loading/getting symbols for different OpenGL wrappers (egl,glx etc.)?

Actually, not at all.

The point of this task is to catch loading_exception and symbol_exception in the application in a proper way in order to handle erroring out cleanly.

The catch all in main.cxx is a last resort and not suposed to be reachable.

The modification should be in the application.

eg in F3DStarter.cxx there are calls for createGLX(). These create* methods are documented as:

   * Throws a context::loading_exception if a needed graphic library cannot be loaded
   * Throws a context::symbol_exception if a needed symbol cannot be found in graphic library
   * Throws a engine::no_window_exception if the window cannot be created for another reason
   * Throws a engine::cache_exception if the default cache directory cannot be used

But in F3DStarter we never catch these exceptions. They should be cached, logged and handled properly.

@exbluesbreaker
Copy link
Contributor

I have initial version of commit prepared, but I need to find out how to test last 3 exceptions.

@exbluesbreaker
Copy link
Contributor

I made #2064 but will need to find a way to test all 4 exceptions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Please help with this issue! source:libf3d
Projects
Status: No status
Development

No branches or pull requests

3 participants