[ 
https://issues.apache.org/jira/browse/PARQUET-1265?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16434251#comment-16434251
 ] 

ASF GitHub Bot commented on PARQUET-1265:
-----------------------------------------

pitrou commented on a change in pull request #452: PARQUET-1265: Segfault on 
static ApplicationVersion initialization
URL: https://github.com/apache/parquet-cpp/pull/452#discussion_r180831387
 
 

 ##########
 File path: src/parquet/metadata.h
 ##########
 @@ -38,9 +38,9 @@ using KeyValueMetadata = ::arrow::KeyValueMetadata;
 class ApplicationVersion {
  public:
   // Known Versions with Issues
-  static const ApplicationVersion PARQUET_251_FIXED_VERSION;
-  static const ApplicationVersion PARQUET_816_FIXED_VERSION;
-  static const ApplicationVersion PARQUET_CPP_FIXED_STATS_VERSION;
+  static const ApplicationVersion& PARQUET_251_FIXED_VERSION();
 
 Review comment:
   What do you mean?
   
   """In short, suppose you have two static objects x and y which exist in 
separate source files, say x.cpp and y.cpp. Suppose further that the 
initialization for the y object (typically the y object’s constructor) calls 
some method on the x object."""
   
   That doesn't seem to apply here (there are no external static objects 
involved in the initialization of the application versions). That said, I'm ok 
with leaving these as methods if you think it's more future-proof.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> 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
>            Assignee: Deepak Majeti
>            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