Project

General

Profile

Actions

Bug #506

closed

Exception in BLAST: "sanity check: mem_temp recycled?"

Added by Vadim Mutilin over 13 years ago. Updated over 12 years ago.

Status:
Closed
Priority:
Low
Assignee:
Category:
Infrastructure
Start date:
10/27/2010
Due date:
08/10/2011
% Done:

0%

Estimated time:
Detected in build:
ebfe9ed48e0684365a6f8aacb0b8c22e82157b8a
Platform:
Published in build:

Description

Blast fails with exception on the orginal driver drivers/net/wireless/wl12xx/wl12xx.ko

The corresponding code fragments which cause exceptions of that kind are shown below.
If line in items 1-3 are commented, then the result is unsafe, and Exception otherwise.

Command line:
LDV_DEBUG=100 BLAST_EXP_NOALIAS=1 RCV_TIMELIMIT=900 RCV_MEMLIMIT=1800000 BLAST_SOLVER=yices BLAST_OPTIONS="-devdebug" ldv-manager tag=current envs=linux-2.6.31.6.tar.bz2 drivers=wl12xx.ko.tar.bz2 "rule_models=32_7"
Extracted driver with commented line is attached.

1. ZZZ: Exception: Failure("sanity check: mem_temp recycled? ((mem_conf@wl1251_mem_cfg).header).len")
in wl1251.c

static int wl1251_mem_cfg(struct wl12xx *wl)
       //mem_conf.header.len -=
       //      (MAX_TX_QUEUE_CONFIGS - mem_conf.mem_config.num_tx_queues) *
       //      sizeof(struct wl1251_acx_tx_queue_config);

2. ZZZ: Exception: Failure(""sanity check: mem_temp recycled? mem_size@wl12xx_set_partition")
in spi.c

void wl12xx_set_partition(struct wl12xx *wl,
             u32 mem_start, u32 mem_size,
             u32 reg_start, u32 reg_size)
...
//mem_size = HW_ACCESS_MEMORY_MAX_RANGE - reg_size;

3. ZZZ: Exception: Failure("sanity check: mem_temp recycled? mem_blocks@wl12xx_tx_frag_block_num")
in tx.c

static void wl12xx_tx_frag_block_num(struct tx_double_buffer_desc *tx_hdr)
...
       //mem_blocks_per_frag =
       //    ((frag_threshold + MAX_MPDU_HEADER_AND_SECURITY) /
       //     HW_BLOCK_SIZE) + 1;

       //mem_blocks = num_mpdus * mem_blocks_per_frag;

...
   //mem_blocks += (payload_len / HW_BLOCK_SIZE) + 1;

   //if (num_mpdus > 1)
       //mem_blocks += min(num_mpdus, mem_blocks_per_frag);


Files

wl12xx.ko.tar.bz2 (46.9 KB) wl12xx.ko.tar.bz2 extracted driver with commented lines Vadim Mutilin, 10/27/2010 04:15 PM
Actions #1

Updated by Pavel Shved over 13 years ago

The thing is that CIL unrolls certain kinds of expressions (for example, nested dereferences of structs and function calls as subexpressions) into assignment like this:

mem_1 = call_function();
if (mem_1 < 10) ...

So all mem_ variables are treated as internal. So BLAST's sanity checks for them fail.

Perhaps, we should use a less common name for that...

Actions #2

Updated by Pavel Shved over 13 years ago

  • Category set to Infrastructure
  • Status changed from New to Open
  • Assignee set to Pavel Shved
Tasks to do:
  1. Add problem to the problem_db that describes the situation
  2. Use less common prefix—such as cil_temp_var_—instead of mem.
Actions #3

Updated by Alexey Khoroshilov about 13 years ago

  • Priority changed from Normal to High

It is easy enough to fix.

Actions #4

Updated by Pavel Shved about 13 years ago

  • Priority changed from High to Normal

"Easy" fixes tend to turn out uneasy to recover from bugs they introduce...

Actions #5

Updated by Pavel Shved over 12 years ago

  • Due date set to 08/10/2011
  • Priority changed from Normal to Low

Going to replace mem_ with cil_. Just scanned the whole kernel if it contains such a string in its sources.

If you have a better idea for the prefix, please, make a comment here!

Actions #6

Updated by Pavel Shved over 12 years ago

  • Status changed from Open to Resolved

Fixed in d8a9b64. The prefix is now "cil_".

Actions #7

Updated by Pavel Shved over 12 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF