- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Folks,
I've downloaded the 30 day trial for Parallel Studio. It has helped me find a few bugs, but when I started to analyse stack accesses it seems to have produced a lot of false positives. Here is an example
[cpp]void DriveTrain::finalise() { _engine->finalise(); _driveShaftHinge->FixLinkParams(); _gearBox->FixLinkParams(); _diff->FixLinkParams(); }It has reported an "Uninitialized Memory Access" on the last line (_diff->FixLinkParams()). _diff is created in the constructor, it is a boost::shared_ptr
[/cpp]
[cpp]int PhyConstraint::FixLinkParams() { gunsigned i; for(i=0;i==NULL) return 1; } return 0; }[/cpp]
In the FixLinkParams method I'm sure that NRigidBody and ppRigidBody are initialised.
Am I missing something or is there a problem here?
Thanks for your help
All the best,
Am I missing something or is there a problem here?
Thanks for your help
All the best,
Ash
Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Ash-
Is Parallel Inspector reporting the problem as being inside the function FixLinkParams() or at the point when you are dereferencing _diff (line 6. of finalise()?) And is any of _diff or that which _diff points to allocated on the stack? (For anything not on the stack the "uninitialized memory access" diagnostic should be giving you the code location where the object was allocated.)
-Matt
Is Parallel Inspector reporting the problem as being inside the function FixLinkParams() or at the point when you are dereferencing _diff (line 6. of finalise()?) And is any of _diff or that which _diff points to allocated on the stack? (For anything not on the stack the "uninitialized memory access" diagnostic should be giving you the code location where the object was allocated.)
-Matt
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Matt,
Thanks for the reply,
It is at the point of dereferencing _diff. Diff is created in the constructor like so: -
_diff = boost::shared_ptr(new PhyDifferentialConstraint());
This error isn't reported when I run the test without ticking the "Analyse Stack Accesses". It doesn't show the point of allocation with the error, so it must think there is a problem with the stack. This is why I thought perhaps it was having difficulties with the boost::shared_ptr.
I am new to this, so I thought perhaps I was doing something incorrectly.
Thanks for your help
All the best,
Ash
This error isn't reported when I run the test without ticking the "Analyse Stack Accesses". It doesn't show the point of allocation with the error, so it must think there is a problem with the stack. This is why I thought perhaps it was having difficulties with the boost::shared_ptr.
I am new to this, so I thought perhaps I was doing something incorrectly.
Thanks for your help
All the best,
Ash
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Matt,
I did a little experiment, I changed _diff to use a normal pointer and the error no longer is reported. There is an error reported for the other 3 lines (engine / driveshaft / gearbox) - they are using boost::shared_ptr.
So it looks like either there is a problem with boost::shared_ptr or it is a false positive.
Is there any way to ignore all the errors reported for boost::shared_ptrs? I am getting a couple of hundred problems.
Thanks for your help
PS. The forum post editor is a bit useless :) (in Chrome at least) - I have to use shift+enter to get a line break
I did a little experiment, I changed _diff to use a normal pointer and the error no longer is reported. There is an error reported for the other 3 lines (engine / driveshaft / gearbox) - they are using boost::shared_ptr.
So it looks like either there is a problem with boost::shared_ptr or it is a false positive.
Is there any way to ignore all the errors reported for boost::shared_ptrs? I am getting a couple of hundred problems.
Thanks for your help
All the best,
Ash
Ash
PS. The forum post editor is a bit useless :) (in Chrome at least) - I have to use shift+enter to get a line break
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Matt,
I tried _diff with the new std::shared_ptr and it seems to work (i.e. not reporting an error), seems to be boost::shared_ptr it has a problem with
I tried _diff with the new std::shared_ptr and it seems to work (i.e. not reporting an error), seems to be boost::shared_ptr it has a problem with
All the best,
Ash
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page