You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Thread constructor throws an exception if the pthread_create call fails. Review all code where Thread object is instantiated and ensure that there are no memory leaks.
For example, in the icsat2 plugin, all readers and the atl03 viewer catch the exception but do not free the info pointer resulting in memory leaks. The same issue is present in the GEDI and SWOT plugins. GeoIndexRaster lets the exception propagate all the way to luaSample call possibly leaking memory.
The text was updated successfully, but these errors were encountered:
I'm not sure what the best approach is here... if we are unable to create a thread, we may want to just exit. But again, I am not sure. Being able to handle it would be great; but my worry is that handling the exception is just the tip of the iceberg. Is all of the downstream logic for each thread creation assuming the thread has been created and therefor potentially not safe? Not sure.
There is another issue we need to address. The Atl03Reader code is a good example, but a similar problem exists in the raster code as well. If a reader needs to create, for example, 6 threads, and the last couple fail to be created, the code will catch the exception and execute the "no more data/signalComplete()" logic. However, the threads that were successfully created will continue running and sending data.
I am not sure if this is a problem or not but we should probably take a closer look at it. Ideally, if even one thread failed we should delete/join the ones already started and only than signalComplete() I am hoping this can be done in a safe way. I can instrument the code and create a test scenario.
Another idea is to create a "FatalException" class and have classes like the Thread class and the Timer class throw it when an exception occurs. It will be different than the "RunTimeException" which the developer should catch and gives some indication that giving up is acceptable.
The Thread constructor throws an exception if the pthread_create call fails. Review all code where Thread object is instantiated and ensure that there are no memory leaks.
For example, in the icsat2 plugin, all readers and the atl03 viewer catch the exception but do not free the info pointer resulting in memory leaks. The same issue is present in the GEDI and SWOT plugins. GeoIndexRaster lets the exception propagate all the way to luaSample call possibly leaking memory.
The text was updated successfully, but these errors were encountered: