Skip to content
This repository was archived by the owner on Mar 22, 2023. It is now read-only.

Commit 31b402d

Browse files
Merge pull request #1129 from lukaszstolarczuk/merge-stable-1.7-into-stable-1.8
Merge stable-1.7 into stable-1.8
2 parents f117250 + ffdd874 commit 31b402d

8 files changed

Lines changed: 108 additions & 18 deletions

File tree

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright 2018-2020, Intel Corporation
2+
# Copyright 2018-2021, Intel Corporation
33
#
44
# Redistribution and use in source and binary forms, with or without
55
# modification, are permitted provided that the following conditions

ChangeLog

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,34 @@
1+
Tue Jul 06 2021 Łukasz Stolarczuk <lukasz.stolarczuk@intel.com>
2+
3+
* Version 1.6.1
4+
5+
This release fixes minor bugs.
6+
7+
This is the last patch release for libpmemobj-cpp 1.6 version.
8+
Maintenance of this version is no longer supported.
9+
10+
Notable changes:
11+
- string: fix max_size() return value
12+
- allocation_flag: mark constructor as explicit
13+
- peristent_ptr: change ptr_offset_magic to be properly aligned
14+
- fix few headers' includes
15+
16+
Mon Jun 28 2021 Łukasz Stolarczuk <lukasz.stolarczuk@intel.com>
17+
18+
* Version 1.5.2
19+
20+
This release fixes minor bugs.
21+
22+
This is the last patch release for libpmemobj-cpp 1.5 version.
23+
Maintenance of this version is no longer supported.
24+
25+
Notable changes:
26+
- operator[] for contiguous_iterator takes signed integral instead of
27+
unsigned
28+
- throw an exception when pmemobj_mutex_unlock fail
29+
- fix crash when a previous transaction failed to start because of
30+
already taken lock.
31+
132
Fri Jan 24 2020 Szymon Romik <szymon.romik@intel.com>
233

334
* Version 1.8.1
@@ -87,7 +118,7 @@ Fri Mar 15 2019 Igor Chorążewicz <igor.chorazewicz@intel.com>
87118
- decrease number of persistent_ptr dereferences in
88119
make_persistent_array
89120

90-
Tue Feb 19 2018 Marcin Ślusarz <marcin.slusarz@intel.com>
121+
Tue Feb 19 2019 Marcin Ślusarz <marcin.slusarz@intel.com>
91122

92123
* Version 1.5.1
93124

include/libpmemobj++/container/detail/contiguous_iterator.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2018-2020, Intel Corporation
2+
* Copyright 2018-2021, Intel Corporation
33
*
44
* Redistribution and use in source and binary forms, with or without
55
* modification, are permitted provided that the following conditions
@@ -242,7 +242,7 @@ struct range_snapshotting_iterator
242242
{
243243
assert(data <= ptr);
244244

245-
if (snapshot_size > 0)
245+
if (snapshot_size && ptr)
246246
snapshot_range(ptr);
247247
}
248248

include/libpmemobj++/detail/persistent_ptr_base.hpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2016-2019, Intel Corporation
2+
* Copyright 2016-2021, Intel Corporation
33
*
44
* Redistribution and use in source and binary forms, with or without
55
* modification, are permitted provided that the following conditions
@@ -372,7 +372,10 @@ class persistent_ptr_base {
372372
inline ptrdiff_t
373373
calculate_offset() const
374374
{
375-
static const ptrdiff_t ptr_offset_magic = 0xDEADBEEF;
375+
static const ptrdiff_t ptr_offset_magic = 0xF00000000000000;
376+
377+
static_assert(ptr_offset_magic % alignof(U) == 0, "");
378+
static_assert(ptr_offset_magic % alignof(T) == 0, "");
376379

377380
U *tmp{reinterpret_cast<U *>(ptr_offset_magic)};
378381
T *diff = static_cast<T *>(tmp);

tests/memcheck-libunwind.supp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,17 @@
2121
obj:*libunwind*
2222
...
2323
}
24+
{
25+
libunwind calls glibc's setcontext on some architectures, e.g. ppc
26+
Memcheck:Addr8
27+
fun:setcontext*
28+
...
29+
}
30+
{
31+
libunwind exception suppresion
32+
Memcheck:Param
33+
write(buf)
34+
...
35+
obj:*libunwind*
36+
...
37+
}

tests/ptr/ptr.cpp

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2015-2019, Intel Corporation
2+
* Copyright 2015-2021, Intel Corporation
33
*
44
* Redistribution and use in source and binary forms, with or without
55
* modification, are permitted provided that the following conditions
@@ -344,6 +344,38 @@ test_offset(nvobj::pool<root> &pop)
344344
UT_ASSERT(0);
345345
}
346346
}
347+
348+
/*
349+
* test_offset_with_alignment -- test offset calculation within a hierarchy of
350+
* objects with different alignments
351+
*/
352+
void
353+
test_offset_alignment(nvobj::pool<root> &pop)
354+
{
355+
struct A {
356+
char a;
357+
};
358+
359+
struct B {
360+
uint64_t b;
361+
};
362+
363+
struct C : public A, public B {
364+
uint64_t c;
365+
};
366+
367+
try {
368+
nvobj::transaction::run(pop, [] {
369+
auto cptr = nvobj::make_persistent<C>();
370+
nvobj::persistent_ptr<B> bptr = cptr;
371+
UT_ASSERT((bptr.raw().off - cptr.raw().off) ==
372+
alignof(B));
373+
nvobj::delete_persistent<C>(cptr);
374+
});
375+
} catch (...) {
376+
UT_ASSERT(0);
377+
}
378+
}
347379
}
348380

349381
int
@@ -370,6 +402,7 @@ main(int argc, char *argv[])
370402
test_ptr_transactional(pop);
371403
test_ptr_array(pop);
372404
test_offset(pop);
405+
test_offset_alignment(pop);
373406

374407
pop.close();
375408

travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ before_install:
2626
- export GITHUB_REPO=pmem/libpmemobj-cpp
2727
- export DOCKERHUB_REPO=pmem/libpmemobj-cpp
2828
- cd utils/docker
29-
- ./pull-or-rebuild-image.sh
29+
- ./pull-or-rebuild-image.sh rebuild
3030
- if [[ -f push_image_to_repo_flag ]]; then PUSH_THE_IMAGE=1; fi
3131
- if [[ -f skip_build_package_check ]]; then export SKIP_CHECK=1; fi
3232
- rm -f push_image_to_repo_flag skip_build_package_check

utils/docker/pull-or-rebuild-image.sh

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env bash
22
#
3-
# Copyright 2016-2020, Intel Corporation
3+
# Copyright 2016-2021, Intel Corporation
44
#
55
# Redistribution and use in source and binary forms, with or without
66
# modification, are permitted provided that the following conditions
@@ -34,17 +34,18 @@
3434
# pull-or-rebuild-image.sh - rebuilds the Docker image used in the
3535
# current Travis build if necessary.
3636
#
37-
# The script rebuilds the Docker image if the Dockerfile for the current
38-
# OS version (Dockerfile.${OS}-${OS_VER}) or any .sh script from the directory
39-
# with Dockerfiles were modified and committed.
37+
# The script rebuilds the Docker image if:
38+
# 1. the Dockerfile for the current OS version (Dockerfile.${OS}-${OS_VER})
39+
# or any .sh script in the Dockerfiles directory were modified and committed, or
40+
# 2. "rebuild" param was passed as a first argument to this script.
4041
#
4142
# If the Travis build is not of the "pull_request" type (i.e. in case of
4243
# merge after pull_request) and it succeed, the Docker image should be pushed
4344
# to the Docker Hub repository. An empty file is created to signal that to
4445
# further scripts.
4546
#
4647
# If the Docker image does not have to be rebuilt, it will be pulled from
47-
# Docker Hub.
48+
# the Docker Hub.
4849
#
4950

5051
set -e
@@ -75,9 +76,21 @@ if [[ -z "$HOST_WORKDIR" ]]; then
7576
exit 1
7677
fi
7778

79+
# Path to directory with Dockerfiles and image building scripts
80+
images_dir_name=images
81+
base_dir=utils/docker/$images_dir_name
82+
83+
# If "rebuild" param is passed to the script, force rebuild
84+
if [[ "${1}" == "rebuild" ]]; then
85+
pushd ${images_dir_name}
86+
./build-image.sh ${DOCKERHUB_REPO} ${OS}-${OS_VER}
87+
popd
88+
exit 0
89+
fi
90+
7891
# TRAVIS_COMMIT_RANGE is usually invalid for force pushes - fix it when used
7992
# with non-upstream repository
80-
if [ -n "$TRAVIS_COMMIT_RANGE" -a "$TRAVIS_REPO_SLUG" != "$GITHUB_REPO" ]; then
93+
if [ -n "$TRAVIS_COMMIT_RANGE" -a "$TRAVIS_REPO_SLUG" != "${GITHUB_REPO}" ]; then
8194
if ! git rev-list $TRAVIS_COMMIT_RANGE; then
8295
# get commit id of the last merge
8396
LAST_MERGE=$(git log --merges --pretty=%H -1)
@@ -113,10 +126,6 @@ files=$(for commit in $commits; do git diff-tree --no-commit-id --name-only \
113126
echo "Files modified within the commit range:"
114127
for file in $files; do echo $file; done
115128

116-
# Path to directory with Dockerfiles and image building scripts
117-
images_dir_name=images
118-
base_dir=utils/docker/$images_dir_name
119-
120129
# Check if committed file modifications require the Docker image to be rebuilt
121130
for file in $files; do
122131
# Check if modified files are relevant to the current build

0 commit comments

Comments
 (0)