Jump to content
  • 0

Client Debug - Assertion Failed !



5 answers to this question

Recommended Posts

  • 0
1 hour ago, WeedHex said:


line 29

(capacity >0)

Assertion failure




        assert(capacity > 0);



This is the file and line ;


#include "StdAfx.h"
#include <stdlib.h>
#include <lzo/lzoLibLink.h>

#include "lzo.h"
#include "tea.h"
#include "debug.h"

#define dbg_printf

static class LZOFreeMemoryMgr
		for(size_t i = 0; i < m_freeVector.size(); ++i)
			delete m_freeVector[i];
	BYTE* Alloc(unsigned capacity)
		assert(capacity > 0);
		if (capacity < REUSING_CAPACITY)
			if (!m_freeVector.empty())
				BYTE* freeMem = m_freeVector.back();

				dbg_printf("lzo.reuse_alloc\t%p(%d) free\n", freeMem, capacity);
				return freeMem;
			dbg_printf("lzo.reuse_alloc\t%p(%d) real\n", newMem, capacity);
			return newMem;
		BYTE* newMem = new BYTE[capacity];
		dbg_printf("lzo.real_alloc\t%p(%d)\n", newMem, capacity);
		return newMem;


What should i do now ? Thanks.

Link to post
  • 0

you can backtrace the function calls in Visual Studio. Do this and you'll see what exactly causes the crash to happen.

The reason is: Alloc() should NOT be used with a capacity of 0. Why, you may ask?

That can be explained by two reasons: First, Alloc() is there to allocate some memory if there's not enough memory left in m_freeVector (which allocates

64*1024 bytes as stated above in the file).

So, naturally you'd think about this: HOW MUCH memory needs to be allocated? And here you got your answer to the question above. Your function gets a call with capacity == 0. This means that 0 memory is needed and 0 bytes of memory should be allocated. Does that make any sense? Nope! We have an abnormal situation here and the program needs to be terminated since something went seriously wrong.

Needless to say, removing that alloc line will NOT fix your problem.


So, how could this happen? Since we're talking about lzo maybe one of your packs has 0 size or is otherwise corrupt? I'd advise you to backtrace the function calls so you may find out what operation exactly triggers Alloc(0) and therefore causes the crash. This should solve your problem then.

  • Love 2

We are the tortured.
We're not your friends.
As long as we're not visible.
We are unfixable.

Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Answer this question...

×   Pasted as rich text.   Restore formatting

  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.

  • Recently Browsing

    No registered users viewing this page.

  • Activity

    1. 1

      Making animated weapons

    2. 0

      Skill leveling help?

    3. 14

      GRAPHIC & ANIMATION & CODE | Pixarts - Game Development Studio

    4. 3

      DirectX9 Wrapper for laptop's dedicated gpu

    5. 3


    6. 7

      Official Character Details

    7. 0

      Weird memory issues

    8. 1

      Making animated weapons

  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.