OpenSceneGraph icon indicating copy to clipboard operation
OpenSceneGraph copied to clipboard

TXP plugin causes assertion failed errors

Open greasel opened this issue 2 years ago • 2 comments

When using the txp plugin in Debug configuration, the application may crash with an error message as show in the image below: txpError

This is caused in various lines of code which all look similar to: errMess[0] = '\0';

where it should instead be errMess.clear();

since errMess is std::string and setting the first element of en empty string is not valid.

In OpenSceneGraph 3.6.5, these are the source locations: src\osgPlugins\txp\trpage_header.cpp, line 85 src\osgPlugins\txp\trpage_io.h, line 604 src\osgPlugins\txp\trpage_light.cpp, lines 705 and 932 src\osgPlugins\txp\trpage_material.cpp, line 1626 src\osgPlugins\txp\trpage_range.cpp, line 55 src\osgPlugins\txp\trpage_tile.cpp, line 44 src\osgPlugins\txp\trpage_warchive.cpp, line 88

greasel avatar Nov 12 '21 08:11 greasel

Could you please generate PR for the changes you've made. Also is there a public database that reproduces the problem?

On Fri, 12 Nov 2021 at 08:20, greasel @.***> wrote:

When using the txp plugin in Debug configuration, the application may crash with an error message as show in the image below: [image: txpError] https://user-images.githubusercontent.com/94164788/141431534-66842149-6e38-49cb-a459-2b6e9991207f.png

This is caused in various line sof code which all look similar to: errMess[0] = '\0';

where it should instead be errMess.clear();

since errMess is std::string and setting the first element of en empty string is not valid.

In OpenSceneGraph 3.6.5, these are the source locations: src\osgPlugins\txp\trpage_header.cpp, line 85 src\osgPlugins\txp\trpage_io.h, line 604 src\osgPlugins\txp\trpage_light.cpp, lines 705 and 932 src\osgPlugins\txp\trpage_material.cpp, line 1626 src\osgPlugins\txp\trpage_range.cpp, line 55 src\osgPlugins\txp\trpage_tile.cpp, line 44 src\osgPlugins\txp\trpage_warchive.cpp, line 88

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/openscenegraph/OpenSceneGraph/issues/1098, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAKEGUBGUCXVW5VNLEBNBX3ULTE4LANCNFSM5H4IKKMQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

robertosfield avatar Nov 12 '21 12:11 robertosfield

PR made: https://github.com/openscenegraph/OpenSceneGraph/pull/1100 I'm not sure what a "public database" means. I hope the pull request is enough to fix this issue. Thanks.

greasel avatar Nov 15 '21 19:11 greasel