bugGNU CSSC - Bugs: bug #54497, [patch] mylist implementation...

 
 

bug #54497: [patch] mylist implementation error segfaults with g++-8

Submitter:  Yann Dirson <ydirson>
Submitted:  Sat 11 Aug 2018 09:37:53 PM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  jay
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Sat 11 May 2019 06:37:24 AM UTC, comment #2: 

That code was eliminated in CSSC release 1.4.1 (replaced with std::vector).

James Youngman <jay>
Group administrator
Sun 05 May 2019 08:21:26 PM UTC, comment #1: 

Hmm, I think a release is overdue.  

mylist.h (at git head is now basically just this:


#ifndef CSSC__LIST_H__
#define CSSC__LIST_H__

#include <vector>

template<class TYPE> using mylist = std::vector<TYPE>;

#endif /* CSSC__LIST_H__ */

James Youngman <jay>
Group administrator
Sat 11 Aug 2018 09:37:53 PM UTC, original submission:  

With g++-8 self-tests fail with:

[ RUN      ] MylistTest.Catenate
Segmentation fault

This is due to operator+= and -= not returning anything, looks like it only ever worked by chance with previous versions of the compiler - g++ does show a warning where the problems are:


unit-tests$ make CC=gcc-8 CXX=g++-8 test_mylist
g++-8 -DHAVE_CONFIG_H -I. -I..  -I./googletest//include -pthread -I./../src  -pthread -DGTEST_HAS_PTHREAD=1 -g -O2 -MT test_mylist.o -MD -MP -MF .deps/test_mylist.Tpo -c -o test_mylist.o test
_mylist.cc
In file included from test_mylist.cc:24:
./../src/mylist.h: In instantiation of ‘const mylist<TYPE>& mylist<TYPE>::operator+=(const mylist<TYPE>&) [with TYPE = int]’:
test_mylist.cc:70:8:   required from here
./../src/mylist.h:106:3: warning: no return statement in function returning non-void [-Wreturn-type]
   }
   ^
./../src/mylist.h: In instantiation of ‘const mylist<TYPE>& mylist<TYPE>::operator-=(const mylist<TYPE>&) [with TYPE = int]’:
test_mylist.cc:82:8:   required from here
./../src/mylist.h:125:3: warning: no return statement in function returning non-void [-Wreturn-type]
   }
   ^
mv -f .deps/test_mylist.Tpo .deps/test_mylist.Po


Bug-Debian: https://bugs.debian.org/897731
Last-Update: 2018-08-11

--- cssc-1.4.0.orig/src/mylist.h
+++ cssc-1.4.0/src/mylist.h
@@ -103,6 +103,7 @@ public:
       {
        items_.push_back(*ci);
       }
+    return *this;
   }
 
   const mylist<TYPE>& operator-=(const mylist& other)
@@ -122,6 +123,7 @@ public:
          }
        items_.swap(remaining);
       }
+    return *this;
   }
 
 

Yann Dirson <ydirson>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by jay (Posted a comment)
  • -email is unavailable- added by ydirson (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-05-11 jay Open/ClosedOpen Closed
    2019-05-05 jay StatusNone Fixed
        Assigned toNone jay

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code