avro-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject [avro] branch master updated: Fix crash of DataFileReader with gcc 4.8
Date Fri, 16 Aug 2019 18:35:43 GMT
This is an automated email from the ASF dual-hosted git repository.

dkulp pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/avro.git


The following commit(s) were added to refs/heads/master by this push:
     new 574d5ea  Fix crash of DataFileReader with gcc 4.8
574d5ea is described below

commit 574d5ea5dea62afc58f195ddf7c0b8b4390270d3
Author: Yong Tang <yong.tang.github@outlook.com>
AuthorDate: Sun May 12 02:57:42 2019 +0000

    Fix crash of DataFileReader with gcc 4.8
    
    While using DataFileReader (C++) through InputStream,
    the following error encountered in Ubuntu 14.04, gcc 4.8:
    ```
    terminate called after throwing an instance of 'std::logic_error'
      what():  basic_string::_S_construct null not valid
    Aborted (core dumped)
    ```
    
    The reason is that gcc 4.8 does not allow string(NULL) for initialization.
    
    This fix fixes the issue on gcc 4.8 (Ubuntu 14.04).
    
    Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
---
 lang/c++/impl/DataFile.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lang/c++/impl/DataFile.cc b/lang/c++/impl/DataFile.cc
index 908ff1c..904e5a3 100644
--- a/lang/c++/impl/DataFile.cc
+++ b/lang/c++/impl/DataFile.cc
@@ -272,7 +272,7 @@ DataFileReaderBase::DataFileReaderBase(const char* filename) :
 }
 
 DataFileReaderBase::DataFileReaderBase(std::unique_ptr<InputStream> inputStream) :
-    filename_(NULL), stream_(std::move(inputStream)),
+    filename_(""), stream_(std::move(inputStream)),
     decoder_(binaryDecoder()), objectCount_(0), eof_(false)
 {
     readHeader();


Mime
View raw message