mtasa-blue icon indicating copy to clipboard operation
mtasa-blue copied to clipboard

Microsoft Visual C++ Runtime Library error

Open FileEX opened this issue 6 years ago • 15 comments

Describe the bug Some times mta has been crashed and show error. It's totally random and rare.

To reproduce

Expected behaviour Fix it

Screenshots image

Version 1.5.6

Additional context

FileEX avatar Jun 02 '19 21:06 FileEX

Hm, interesting... My PR had the same problem(#907) if there were a lot of elements in a google::dense_hash_map(in MTA SC referred as CFastHashMap) If i remember correctly its related to some memory issue, namely it can't allocate a new memory buffer for it's elements. Please attach a dump, so I cant find out where the problem is.

Pirulax avatar Jun 16 '19 20:06 Pirulax

crash dump of this error has not created

FileEX avatar Jun 17 '19 13:06 FileEX

neat. my pr isn't merged yet, so nothing related to that. without a crashdump it'll be pretty hard to investigate where the problem lies.

Pirulax avatar Jul 09 '19 15:07 Pirulax

Does Assertion failed ever give a crash dump?

ccw808 avatar Jul 09 '19 15:07 ccw808

In my case, never.

FileEX avatar Jul 13 '19 01:07 FileEX

What about if you click "Retry" or "Ignore" ?

ccw808 avatar Jul 13 '19 02:07 ccw808

@ccw808 I had the same issue, you can get it quite easily if you use CFastHashMap and fill it with elements(a few million). The interesting this is, it doesnt really run out of memory, but for some reason if fails to allocate it.

void clear_to_size(size_type new_num_buckets)
{
    if (!table)
    {
        table = val_info.allocate(new_num_buckets);
    }
    else
    {
        destroy_buckets(0, num_buckets);
        if (new_num_buckets != num_buckets)
        {            // resize, if necessary
            typedef base::integral_constant<bool, base::is_same<value_alloc_type, libc_allocator_with_realloc<value_type> >::value> realloc_ok;
            resize_table(num_buckets, new_num_buckets, realloc_ok());
        }
    }
    assert(table);
    fill_range_with_empty(table, table + new_num_buckets);
    num_elements = 0;
    num_deleted = 0;
    num_buckets = new_num_buckets;            // our new size
    settings.reset_thresholds(bucket_count());
}

Pirulax avatar Nov 27 '19 20:11 Pirulax

I would think the allocation fails because of free memory fragmentation

ccw808 avatar Nov 27 '19 21:11 ccw808

Yeah, thats actually a pretty good explanation, but I guess we can do nothing about it, except maybe replace it with a linked list based map, which probably would be slower due to cache misses.

Pirulax avatar May 10 '20 22:05 Pirulax

@ccw808 I had the same issue, you can get it quite easily if you use CFastHashMap and fill it with elements(a few million). The interesting this is, it doesnt really run out of memory, but for some reason if fails to allocate it.

void clear_to_size(size_type new_num_buckets)
{
    if (!table)
    {
        table = val_info.allocate(new_num_buckets);
    }
    else
    {
        destroy_buckets(0, num_buckets);
        if (new_num_buckets != num_buckets)
        {            // resize, if necessary
            typedef base::integral_constant<bool, base::is_same<value_alloc_type, libc_allocator_with_realloc<value_type> >::value> realloc_ok;
            resize_table(num_buckets, new_num_buckets, realloc_ok());
        }
    }
    assert(table);
    fill_range_with_empty(table, table + new_num_buckets);
    num_elements = 0;
    num_deleted = 0;
    num_buckets = new_num_buckets;            // our new size
    settings.reset_thresholds(bucket_count());
}

Hi, can you please help me where to put this code? how to implement it?

MichaelFarad avatar Apr 06 '22 19:04 MichaelFarad

@MichaelFarad what exactly are you trying to do?

Lpsd avatar Apr 06 '22 19:04 Lpsd

ntoskrnl.exe in System32 should do it. You will have to get the source-code for Windows 10, but that should be easy, as it can be downloaded from here.

Now, jokes aside.. You dont. (... put it anywhere, just leave it here as is.)

Pirulax avatar Apr 06 '22 19:04 Pirulax

ntoskrnl.exe in System32 should do it. You will have to get the source-code for Windows 10, but that should be easy, as it can be downloaded from here.

Now, jokes aside.. You dont. (... put it anywhere, just leave it here as is.)

help, I beg how can I remove this error, I have been looking for an answer for about a week, you are my hope

MichaelFarad avatar Apr 06 '22 19:04 MichaelFarad

@MichaelFarad what exactly are you trying to do?

I can't fix this error....I'm in the wall, I don't know what to do

MichaelFarad avatar Apr 06 '22 19:04 MichaelFarad

Nothing described on this page can help you immediately - this is a development discussion.

GitHub isn't for general MTA support. If you're experiencing issues please visit our Discord and use the #help-support channel.

Lpsd avatar Apr 06 '22 19:04 Lpsd