Skip to content

Commit

Permalink
lib/tests/nvml.sh: fix brk segment overflow in thread #1: can't grow …
Browse files Browse the repository at this point in the history
…to 0x4a28000

The issue is as below:
obj_tx_add_range_direct/TEST1: SETUP (check/non-pmem/debug/pmemcheck)
obj_tx_add_range_direct/TEST1: START: obj_tx_add_range_direct
[MATCHING FAILED, COMPLETE FILE (pmemcheck1.log) BELOW]
...
pmemcheck1.log.match:1   ==$(*)== pmemcheck$(*)
pmemcheck1.log:1         ==67474== pmemcheck-0.2, a simple persistent store checker
pmemcheck1.log.match:2   ==$(*)== Copyright$(*)
pmemcheck1.log:2         ==67474== Copyright (c) 2014-2016, Intel Corporation
pmemcheck1.log.match:3   ==$(*)== Using Valgrind-$(*)
pmemcheck1.log:3         ==67474== Using Valgrind-3.12.0 and LibVEX; rerun with -h for copyright info
pmemcheck1.log.match:4   ==$(*)== Command: ./obj_tx_add_range_direct$(*)
pmemcheck1.log:4         ==67474== Command: ./obj_tx_add_range_direct /tmp/tmp.WoPbIa5vlI//test_obj_tx_add_range_direct1😘⠝⠧⠍⠇ɗNVMLӜ⥺🙋/testfile1
pmemcheck1.log.match:5   ==$(*)== Parent PID: $(*)
pmemcheck1.log:5         ==67474== Parent PID: 67379
pmemcheck1.log.match:6   ==$(*)==
pmemcheck1.log:6         ==67474==
pmemcheck1.log.match:7   ==$(*)== Number of stores not made persistent: 0
pmemcheck1.log:7         ==67474== brk segment overflow in thread #1: can't grow to 0x4a27000  <===

when allocate memory below 128k, system use brk rather than mmap as default, while mmap behave better.
The edge can be changed by MALLOC_MMAP_THRESHOLD_.
Set it as zero can make the libc malloc use mmap earlier to ensure system allocate enough brk segment.

Signed-off-by: Xiang Dai <[email protected]>
Signed-off-by: Philip Li <[email protected]>
  • Loading branch information
Xiang Dai authored and rli9 committed Jun 15, 2017
1 parent d19e2f8 commit 7acb196
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/tests/nvml.sh
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ run()
}
}

# export this env variable to enable obj_tx_a* tests
[[ $testcase =~ obj_tx_a ]] && export MALLOC_MMAP_THRESHOLD_=0

if [ "$LKP_LOCAL_RUN" != "1" ] && [[ -s "$user_filter" ]] && grep -w -q "$testcase" "$user_filter"; then
log_cmd chown lkp:lkp -R $BENCHMARK_ROOT/$casename
log_cmd chown lkp:lkp -R /tmp
Expand All @@ -112,5 +115,8 @@ run()
else
log_cmd ./RUNTESTS -f $test $testcase 2>&1
fi

# unset env variable in case it do impact on other tests
[[ $testcase =~ obj_tx_a ]] && unset MALLOC_MMAP_THRESHOLD_
done <<< "$testcases"
}

0 comments on commit 7acb196

Please sign in to comment.