[ 
https://issues.apache.org/jira/browse/PARQUET-1265?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Lawrence Chan updated PARQUET-1265:
-----------------------------------
    Description: 
I'm seeing a segfault when I link/run with a shared libparquet.so with 
statically linked boost. Given the backtrace, it seems that this is due to the 
static ApplicationVersion constants, likely due to some static initialization 
order issue. The problem goes away if I turn those static vars into static 
funcs returning function-local statics.

Backtrace:
{code}
#0  0x00007ffff753cf8b in std::basic_string<char, std::char_traits<char>, 
std::allocator<char> >::basic_string(std::string const&) () from 
/lib64/libstdc++.so.6
#1  0x00007ffff7aeae9c in 
boost::re_detail_106600::cpp_regex_traits_char_layer<char>::init() () from 
debug/libparquet.so.1
#2  0x00007ffff7adcc2b in 
boost::object_cache<boost::re_detail_106600::cpp_regex_traits_base<char>, 
boost::re_detail_106600::cpp_regex_traits_implementation<char> 
>::do_get(boost::re_detail_106600::cpp_regex_traits_base<char> const&, unsigned 
long) () from debug/libparquet.so.1
#3  0x00007ffff7ae9023 in boost::basic_regex<char, boost::regex_traits<char, 
boost::cpp_regex_traits<char> > >::do_assign(char const*, char const*, unsigned 
int) () from debug/libparquet.so.1
#4  0x00007ffff7a5ed98 in boost::basic_regex<char, boost::regex_traits<char, 
boost::cpp_regex_traits<char> > >::assign (this=0x7fffffff5580, 
p1=0x7ffff7af66d8 
"(.*?)\\s*(?:(version\\s*(?:([^(]*?)\\s*(?:\\(\\s*build\\s*([^)]*?)\\s*\\))?)?)?)",
 p2=0x7ffff7af6720 "", f=0) at 
/tmp/boost-1.66.0/include/boost/regex/v4/basic_regex.hpp:381
#5  0x00007ffff7a5b653 in boost::basic_regex<char, boost::regex_traits<char, 
boost::cpp_regex_traits<char> > >::assign (this=0x7fffffff5580, 
p=0x7ffff7af66d8 
"(.*?)\\s*(?:(version\\s*(?:([^(]*?)\\s*(?:\\(\\s*build\\s*([^)]*?)\\s*\\))?)?)?)",
 f=0) at /tmp/boost-1.66.0/include/boost/regex/v4/basic_regex.hpp:366
#6  0x00007ffff7a57049 in boost::basic_regex<char, boost::regex_traits<char, 
boost::cpp_regex_traits<char> > >::basic_regex (this=0x7fffffff5580, 
p=0x7ffff7af66d8 
"(.*?)\\s*(?:(version\\s*(?:([^(]*?)\\s*(?:\\(\\s*build\\s*([^)]*?)\\s*\\))?)?)?)",
 f=0) at /tmp/boost-1.66.0/include/boost/regex/v4/basic_regex.hpp:335
#7  0x00007ffff7a4fa1f in parquet::ApplicationVersion::ApplicationVersion 
(this=0x7ffff7ddbfc0 <parquet::ApplicationVersion::PARQUET_251_FIXED_VERSION>, 
created_by="parquet-mr version 1.8.0") at 
/tmp/parquet-cpp-apache-parquet-cpp-1.4.0/src/parquet/metadata.cc:477
#8  0x00007ffff7a516c5 in __static_initialization_and_destruction_0 
(__initialize_p=1, __priority=65535) at 
/tmp/parquet-cpp-apache-parquet-cpp-1.4.0/src/parquet/metadata.cc:58
#9  0x00007ffff7a5179e in _GLOBAL__sub_I_metadata.cc(void) () at 
/tmp/parquet-cpp-apache-parquet-cpp-1.4.0/src/parquet/metadata.cc:913
#10 0x00007ffff7dec1e3 in _dl_init_internal () from /lib64/ld-linux-x86-64.so.2
#11 0x00007ffff7dde21a in _dl_start_user () from /lib64/ld-linux-x86-64.so.2
#12 0x0000000000000001 in ?? ()
#13 0x00007fffffff5ff5 in ?? ()
#14 0x0000000000000000 in ?? ()
{code}

Versions:
- gcc-4.8.5
- boost-1.66.0
- parquet-cpp-1.4.0

  was:
I'm seeing a segfault when I link/run with a shared libparquet.so with 
statically linked boost. Given the backtrace, it seems that this is due to the 
static ApplicationVersion constants for the fixes, probably some static 
initialization order issue. The problem goes away if I turn those static vars 
into static funcs returning function-local statics.

Backtrace:
{code}
#0  0x00007ffff753cf8b in std::basic_string<char, std::char_traits<char>, 
std::allocator<char> >::basic_string(std::string const&) () from 
/lib64/libstdc++.so.6
#1  0x00007ffff7aeae9c in 
boost::re_detail_106600::cpp_regex_traits_char_layer<char>::init() () from 
debug/libparquet.so.1
#2  0x00007ffff7adcc2b in 
boost::object_cache<boost::re_detail_106600::cpp_regex_traits_base<char>, 
boost::re_detail_106600::cpp_regex_traits_implementation<char> 
>::do_get(boost::re_detail_106600::cpp_regex_traits_base<char> const&, unsigned 
long) () from debug/libparquet.so.1
#3  0x00007ffff7ae9023 in boost::basic_regex<char, boost::regex_traits<char, 
boost::cpp_regex_traits<char> > >::do_assign(char const*, char const*, unsigned 
int) () from debug/libparquet.so.1
#4  0x00007ffff7a5ed98 in boost::basic_regex<char, boost::regex_traits<char, 
boost::cpp_regex_traits<char> > >::assign (this=0x7fffffff5580, 
p1=0x7ffff7af66d8 
"(.*?)\\s*(?:(version\\s*(?:([^(]*?)\\s*(?:\\(\\s*build\\s*([^)]*?)\\s*\\))?)?)?)",
 p2=0x7ffff7af6720 "", f=0) at 
/tmp/boost-1.66.0/include/boost/regex/v4/basic_regex.hpp:381
#5  0x00007ffff7a5b653 in boost::basic_regex<char, boost::regex_traits<char, 
boost::cpp_regex_traits<char> > >::assign (this=0x7fffffff5580, 
p=0x7ffff7af66d8 
"(.*?)\\s*(?:(version\\s*(?:([^(]*?)\\s*(?:\\(\\s*build\\s*([^)]*?)\\s*\\))?)?)?)",
 f=0) at /tmp/boost-1.66.0/include/boost/regex/v4/basic_regex.hpp:366
#6  0x00007ffff7a57049 in boost::basic_regex<char, boost::regex_traits<char, 
boost::cpp_regex_traits<char> > >::basic_regex (this=0x7fffffff5580, 
p=0x7ffff7af66d8 
"(.*?)\\s*(?:(version\\s*(?:([^(]*?)\\s*(?:\\(\\s*build\\s*([^)]*?)\\s*\\))?)?)?)",
 f=0) at /tmp/boost-1.66.0/include/boost/regex/v4/basic_regex.hpp:335
#7  0x00007ffff7a4fa1f in parquet::ApplicationVersion::ApplicationVersion 
(this=0x7ffff7ddbfc0 <parquet::ApplicationVersion::PARQUET_251_FIXED_VERSION>, 
created_by="parquet-mr version 1.8.0") at 
/tmp/parquet-cpp-apache-parquet-cpp-1.4.0/src/parquet/metadata.cc:477
#8  0x00007ffff7a516c5 in __static_initialization_and_destruction_0 
(__initialize_p=1, __priority=65535) at 
/tmp/parquet-cpp-apache-parquet-cpp-1.4.0/src/parquet/metadata.cc:58
#9  0x00007ffff7a5179e in _GLOBAL__sub_I_metadata.cc(void) () at 
/tmp/parquet-cpp-apache-parquet-cpp-1.4.0/src/parquet/metadata.cc:913
#10 0x00007ffff7dec1e3 in _dl_init_internal () from /lib64/ld-linux-x86-64.so.2
#11 0x00007ffff7dde21a in _dl_start_user () from /lib64/ld-linux-x86-64.so.2
#12 0x0000000000000001 in ?? ()
#13 0x00007fffffff5ff5 in ?? ()
#14 0x0000000000000000 in ?? ()
{code}

Versions:
- gcc-4.8.5
- boost-1.66.0
- parquet-cpp-1.4.0


> Segfault on static ApplicationVersion initialization
> ----------------------------------------------------
>
>                 Key: PARQUET-1265
>                 URL: https://issues.apache.org/jira/browse/PARQUET-1265
>             Project: Parquet
>          Issue Type: Bug
>          Components: parquet-cpp
>    Affects Versions: cpp-1.4.0
>            Reporter: Lawrence Chan
>            Priority: Major
>
> I'm seeing a segfault when I link/run with a shared libparquet.so with 
> statically linked boost. Given the backtrace, it seems that this is due to 
> the static ApplicationVersion constants, likely due to some static 
> initialization order issue. The problem goes away if I turn those static vars 
> into static funcs returning function-local statics.
> Backtrace:
> {code}
> #0  0x00007ffff753cf8b in std::basic_string<char, std::char_traits<char>, 
> std::allocator<char> >::basic_string(std::string const&) () from 
> /lib64/libstdc++.so.6
> #1  0x00007ffff7aeae9c in 
> boost::re_detail_106600::cpp_regex_traits_char_layer<char>::init() () from 
> debug/libparquet.so.1
> #2  0x00007ffff7adcc2b in 
> boost::object_cache<boost::re_detail_106600::cpp_regex_traits_base<char>, 
> boost::re_detail_106600::cpp_regex_traits_implementation<char> 
> >::do_get(boost::re_detail_106600::cpp_regex_traits_base<char> const&, 
> unsigned long) () from debug/libparquet.so.1
> #3  0x00007ffff7ae9023 in boost::basic_regex<char, boost::regex_traits<char, 
> boost::cpp_regex_traits<char> > >::do_assign(char const*, char const*, 
> unsigned int) () from debug/libparquet.so.1
> #4  0x00007ffff7a5ed98 in boost::basic_regex<char, boost::regex_traits<char, 
> boost::cpp_regex_traits<char> > >::assign (this=0x7fffffff5580, 
> p1=0x7ffff7af66d8 
> "(.*?)\\s*(?:(version\\s*(?:([^(]*?)\\s*(?:\\(\\s*build\\s*([^)]*?)\\s*\\))?)?)?)",
>  p2=0x7ffff7af6720 "", f=0) at 
> /tmp/boost-1.66.0/include/boost/regex/v4/basic_regex.hpp:381
> #5  0x00007ffff7a5b653 in boost::basic_regex<char, boost::regex_traits<char, 
> boost::cpp_regex_traits<char> > >::assign (this=0x7fffffff5580, 
> p=0x7ffff7af66d8 
> "(.*?)\\s*(?:(version\\s*(?:([^(]*?)\\s*(?:\\(\\s*build\\s*([^)]*?)\\s*\\))?)?)?)",
>  f=0) at /tmp/boost-1.66.0/include/boost/regex/v4/basic_regex.hpp:366
> #6  0x00007ffff7a57049 in boost::basic_regex<char, boost::regex_traits<char, 
> boost::cpp_regex_traits<char> > >::basic_regex (this=0x7fffffff5580, 
> p=0x7ffff7af66d8 
> "(.*?)\\s*(?:(version\\s*(?:([^(]*?)\\s*(?:\\(\\s*build\\s*([^)]*?)\\s*\\))?)?)?)",
>  f=0) at /tmp/boost-1.66.0/include/boost/regex/v4/basic_regex.hpp:335
> #7  0x00007ffff7a4fa1f in parquet::ApplicationVersion::ApplicationVersion 
> (this=0x7ffff7ddbfc0 
> <parquet::ApplicationVersion::PARQUET_251_FIXED_VERSION>, 
> created_by="parquet-mr version 1.8.0") at 
> /tmp/parquet-cpp-apache-parquet-cpp-1.4.0/src/parquet/metadata.cc:477
> #8  0x00007ffff7a516c5 in __static_initialization_and_destruction_0 
> (__initialize_p=1, __priority=65535) at 
> /tmp/parquet-cpp-apache-parquet-cpp-1.4.0/src/parquet/metadata.cc:58
> #9  0x00007ffff7a5179e in _GLOBAL__sub_I_metadata.cc(void) () at 
> /tmp/parquet-cpp-apache-parquet-cpp-1.4.0/src/parquet/metadata.cc:913
> #10 0x00007ffff7dec1e3 in _dl_init_internal () from 
> /lib64/ld-linux-x86-64.so.2
> #11 0x00007ffff7dde21a in _dl_start_user () from /lib64/ld-linux-x86-64.so.2
> #12 0x0000000000000001 in ?? ()
> #13 0x00007fffffff5ff5 in ?? ()
> #14 0x0000000000000000 in ?? ()
> {code}
> Versions:
> - gcc-4.8.5
> - boost-1.66.0
> - parquet-cpp-1.4.0



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to