Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Centos-7: segfault vrp_pickup_delivery.cc #1827

Closed
developer-qoo10 opened this issue Jan 7, 2020 · 7 comments
Closed

Centos-7: segfault vrp_pickup_delivery.cc #1827

developer-qoo10 opened this issue Jan 7, 2020 · 7 comments
Assignees
Labels
Bug Build: Makefile Makefile based build issue Lang: C++ Native implementation issue OS: Linux GNU/Linux OS Solver: Routing Uses the Routing library and the original CP solver
Projects
Milestone

Comments

@developer-qoo10
Copy link

developer-qoo10 commented Jan 7, 2020

Setup

OS : CentOS Linux release 7.5.1804
Or-Tools : 7.4.7247
g++ : 4.8.5

Protocol

I compiled an example vrp_pickup_delivery.cc using:

g++ -std=c++11 -lprotobuf -lglog -lgflags -lortools -o ex vrp_pickup_delivery.cc

Observed

However, an aborted error occurred in the compiled executable.

----------------------------------------------
WARNING: Logging before InitGoogleLogging() is written to STDERR
F0107 18:16:23.885967 14623 routing_index_manager.h:73] Check failed: index < index_to_node_.size() (140727098947872 vs. 24)
*** Check failure stack trace: ***
Aborted
-----------------------------------------------

Thank you.

@Mizux Mizux added Bug Help Needed Modeling/Usage problem Lang: C++ Native implementation issue Solver: Routing Uses the Routing library and the original CP solver and removed Help Needed Modeling/Usage problem labels Jan 7, 2020
@Mizux Mizux self-assigned this Jan 7, 2020
@Mizux Mizux added this to the v7.5 milestone Jan 7, 2020
@Mizux Mizux added this to To do in ToDo via automation Jan 7, 2020
@google google deleted a comment from developer-qoo10 Jan 7, 2020
@Mizux Mizux changed the title segfault segfault vrp_pickup_delivery.cc Jan 7, 2020
@Mizux Mizux moved this from To do to In progress in ToDo Jan 7, 2020
@Mizux
Copy link
Collaborator

Mizux commented Jan 9, 2020

did you modify this sample ? where did you find it ?

@developer-qoo10
Copy link
Author

@Mizux Mizux added Build: Makefile Makefile based build issue OS: Linux GNU/Linux OS labels Jan 13, 2020
@Mizux
Copy link
Collaborator

Mizux commented Jan 14, 2020

I can reproduce it using
Dockerfile:

FROM centos:7

RUN yum -y update
RUN yum groupinstall -y 'Development Tools'
RUN yum install -y wget zlib-devel

USER root
WORKDIR /root
RUN  wget https://github.com/google/or-tools/releases/download/v7.4/or-tools_centos-7_v7.4.7247.tar.gz
RUN tar xzvf *.tar.gz
WORKDIR /root/or-tools_CentOS-7.6.1810-64bit_v7.4.7247
COPY Makefile .
RUN make detect
RUN make run SOURCE=examples/cpp/vrp_pickup_delivery.cc

note I had to patch the Makefile to remove abseil dynamic library since we use static ones now

--- old	2020-01-14 10:19:11.000000000 +0100
+++ Makefile	2020-01-14 10:19:42.000000000 +0100
@@ -68,37 +68,7 @@
   LIB_PREFIX = lib
   PRE_LIB = -Llib -Llib64
   CBC_LNK = -lCbcSolver -lCbc -lOsiCbc -lCgl -lClpSolver -lClp -lOsiClp -lOsi -lCoinUtils
-  ABSL_LNK = \
--labsl_bad_any_cast_impl \
--labsl_bad_optional_access \
--labsl_bad_variant_access \
--labsl_base \
--labsl_city \
--labsl_civil_time \
--labsl_debugging_internal \
--labsl_demangle_internal \
--labsl_dynamic_annotations \
--labsl_examine_stack \
--labsl_failure_signal_handler \
--labsl_graphcycles_internal \
--labsl_hash \
--labsl_hashtablez_sampler \
--labsl_int128 \
--labsl_leak_check \
--labsl_malloc_internal \
--labsl_optional \
--labsl_raw_hash_set \
--labsl_spinlock_wait \
--labsl_stacktrace \
--labsl_str_format_internal \
--labsl_strings \
--labsl_strings_internal \
--labsl_symbolize \
--labsl_synchronization \
--labsl_throw_delegate \
--labsl_time \
--labsl_time_zone
-  OR_TOOLS_LNK = $(PRE_LIB) $(ABSL_LNK) -lprotobuf -lglog -lgflags $(CBC_LNK) -lortools
+  OR_TOOLS_LNK = $(PRE_LIB) -lprotobuf -lglog -lgflags $(CBC_LNK) -lortools
   OBJ_OUT = -o #
   EXE_OUT = -o #
   O = .o

@Mizux
Copy link
Collaborator

Mizux commented Jan 14, 2020

note: we build the centos archive using the image

FROM centos/devtoolset-7-toolchain-centos7
USER root

Using this image instead of centos:7 it works, I guess glibc or a system lib is incompatible somehow...

docker run --user root --rm --init -it centos:7
[root]# yum -y update
[root]# yum groupinstall -y 'Development Tools'
[root]# g++ --version
g++ (GCC) 4.8.5 20150623 (Red Hat 4.8.5-39)
docker run --user root --rm --init -it centos/devtoolset-7-toolchain-centos7 /bin/bash
[root]# g++ --version
g++ (GCC) 7.3.1 20180303 (Red Hat 7.3.1-5)

@Mizux
Copy link
Collaborator

Mizux commented Jan 14, 2020

Ok, you have to install gcc-7.3 using:

yum install centos-release-scl
yum install devtoolset-7-gcc-c++
export PATH=/opt/rh/devtoolset-7/root/usr/bin:$PATH
g++ --version
...

@Mizux Mizux closed this as completed Jan 14, 2020
ToDo automation moved this from In progress to Done Jan 14, 2020
@developer-qoo10
Copy link
Author

confirmed no problem in g ++ 7.3.1 20180303.
Thank you very much.

@Mizux Mizux changed the title segfault vrp_pickup_delivery.cc Centos-7: segfault vrp_pickup_delivery.cc Jan 17, 2020
@Mizux
Copy link
Collaborator

Mizux commented Jan 17, 2020

FYI we are dropping the support for cento-7 to replace it by centos-8 which don't have this issue since g++ default package is ok

docker run --user root --rm --init -it centos:8
[root]# yum -y update
[root]# yum groupinstall -y 'Development Tools'
[root]# g++ --version
g++ (GCC) 8.3.1 20190507 (Red Hat 8.3.1-4)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Build: Makefile Makefile based build issue Lang: C++ Native implementation issue OS: Linux GNU/Linux OS Solver: Routing Uses the Routing library and the original CP solver
Projects
ToDo
  
Done
Development

No branches or pull requests

2 participants