Jump to content
UBot Underground

C++ Runtime Error (v5) (shared_ptr.hpp)


Recommended Posts

Has someone seen this error before?

 

 

Just tested one of my multithreading bots in v5. 

Running 25 threads. Scraping 50000 items into a list.

 

Works perfectly fine in v4. 

 

In v5 (compiled bot) it crashes after round about 20-25k items.

 

v5-Bug.JPG

 

I know about the support system. Just wanted to know if someone has seen this before?

 

Dan

Link to post
Share on other sites

Yes but some time ago now so I can't remember what triggered it of the top of my head now

But you’ll not alone

Link to post
Share on other sites
  • 1 month later...

uninstall the ubot5, ubot 4, and delete the appdata/ubotstudio file, and reinstall ubot 5, then error gone

 

but the browser still crashes and pages turn blank

Link to post
Share on other sites
  • 2 weeks later...

Actually that's line 653 of boost's shared_ptr.hpp. The Ubot error is somewhere up the call stack I imagine, and is probably Ubot trying to use a pointer in one thread that has been deleted in another thread. These kinds of bugs are notoriously hard to fix.

 

Sorry to be pedantic :P

 

-meter

Link to post
Share on other sites

Thanks a lot Meter,

 

not pedantic at all. I think it all helps to solve the problem.

 

I also found some interesting information's:

http://www.boost.org/doc/libs/1_46_1/libs/smart_ptr/shared_ptr.htm#BestPractices

 

 

 

Best Practices

A simple guideline that nearly eliminates the possibility of memory leaks is: always use a named smart pointer variable to hold the result of new. Every occurence of the new keyword in the code should have the form:

shared_ptr<T> p(new Y);

It is, of course, acceptable to use another smart pointer in place of shared_ptr above; having T and Y be the same type, or passing arguments to Y's constructor is also OK.

If you observe this guideline, it naturally follows that you will have no explicit deletes; try/catch constructs will be rare.

Avoid using unnamed shared_ptr temporaries to save typing; to see why this is dangerous, consider this example:

void f(shared_ptr<int>, int);
int g();

void ok()
{
shared_ptr<int> p(new int(2));
f(p, g());
}

void bad()
{
f(shared_ptr<int>(new int(2)), g());
}

The function ok follows the guideline to the letter, whereas bad constructs the temporary shared_ptr in place, admitting the possibility of a memory leak. Since function arguments are evaluated in unspecified order, it is possible for new int(2) to be evaluated first, g() second, and we may never get to theshared_ptr constructor if g throws an exception. See Herb Sutter's treatment (also here) of the issue for more information.

The exception safety problem described above may also be eliminated by using the make_shared or allocate_shared factory functions defined in boost/make_shared.hpp. These factory functions also provide an efficiency benefit by consolidating allocations.

Link to post
Share on other sites
  • 6 months later...

What versions of microsoft visual C++ are you guys running
As I only had the x64 versions installed, and just thought ubot is still x86

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...