mapmap_cpu icon indicating copy to clipboard operation
mapmap_cpu copied to clipboard

MSVC debug mode assertion in void PairwiseTable<COSTTYPE, SIMDWIDTH>:: set_costs

Open ubc-nvining opened this issue 5 years ago • 4 comments

Hi folks:

I'm trying to get this working in debug mode on MSVC 2017. Inside of void PairwiseTable<COSTTYPE, SIMDWIDTH>::set_costs(), an assert is being triggered in debug mode claiming an out of bounds operation from these lines here:

/* expand table into aligned storage */
for(_iv_st<COSTTYPE, SIMDWIDTH> li_a = 0; li_a < len_a; ++li_a)
    std::copy(&packed_table[li_a * len_b], 
        &packed_table[(li_a + 1) * len_b],
        &m_packed_table[li_a * padded_b]);

in Release mode, or even RelWithDebugInfo, this works fine.

ubc-nvining avatar Aug 06 '19 21:08 ubc-nvining

Is it the latest version, or the one that I have been using?

h00shi avatar Aug 06 '19 22:08 h00shi

Both. I tried updating to the latest version with no luck.

ubc-nvining avatar Aug 07 '19 01:08 ubc-nvining

If you think it would be of any help, I can take a look if you point me to the input data that trigger the assertion.

h00shi avatar Aug 12 '19 04:08 h00shi

Hi,

unfortunately, I lack a WIndows/MSVC system to reproduce the issue; however, could you please check the following:

  1. What is the SIMDWIDTH selected / reported for your system?
  2. In what array is the out of bounds detected? packed_table or m_packed_table? You could e.g. look at the address valgrind returns and compare them with the address ranges of both arrays.
  3. Are you getting a similar exception from std::fill(m_packed_table, m_packed_table + padded_size, 0); (in the constructor)? This should access the same memory range -- if the problem is m_packed_table.

Thanks!

dthuerck avatar Aug 12 '19 18:08 dthuerck