[Debichem-devel] Bug#921510: Bug#921510: qutemol: segfaults at startup when compiled with GCC 8

Adrian Bunk bunk at debian.org
Wed Feb 6 21:53:20 GMT 2019


Control: tags -1 patch

On Wed, Feb 06, 2019 at 08:50:21PM +0200, Graham Inggs wrote:
> Commenting out AOgpu2::init() avoids the problem with GCC 8 and so far
> I haven't noticed any side-effects.
> 
> --- a/src/Common.cpp
> +++ b/src/Common.cpp
> @@ -1054,7 +1054,7 @@
>    if (!shadowmap.init())     res|=ERRGL_NO_FBO_SHADOWMAP;
>    if (!shadowmap.initHalo()) res|=ERRGL_NO_FBO_HALO;
> 
> -  if (! AOgpu2::init()) res|=ERRGL_NO_FBO_AO;
> +//  if (! AOgpu2::init()) res|=ERRGL_NO_FBO_AO;

With -Wall gcc even tells what the actual bug is:
  src/ShadowMap.cpp: In static member function 'static bool AOgpu2::init()':
  src/ShadowMap.cpp:250:25: warning: control reaches end of non-void function [-Wreturn-type]

Proper fix attached.

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed

-------------- next part --------------
diff -Nru qutemol-0.4.1~cvs20081111/debian/control qutemol-0.4.1~cvs20081111/debian/control
--- qutemol-0.4.1~cvs20081111/debian/control	2019-02-06 13:20:00.000000000 +0200
+++ qutemol-0.4.1~cvs20081111/debian/control	2019-02-06 23:42:28.000000000 +0200
@@ -6,7 +6,6 @@
 Section: science
 Priority: optional
 Build-Depends: debhelper (>= 12~),
-               g++-7,
                libgif-dev (>= 5),
                libglew-dev,
                libpng-dev,
diff -Nru qutemol-0.4.1~cvs20081111/debian/patches/41_aogpu2_init_return.patch qutemol-0.4.1~cvs20081111/debian/patches/41_aogpu2_init_return.patch
--- qutemol-0.4.1~cvs20081111/debian/patches/41_aogpu2_init_return.patch	1970-01-01 02:00:00.000000000 +0200
+++ qutemol-0.4.1~cvs20081111/debian/patches/41_aogpu2_init_return.patch	2019-02-06 23:47:20.000000000 +0200
@@ -0,0 +1,14 @@
+Description: Fix segfault due to not returning true in AOgpu2::init()
+Author: Adrian Bunk <bunk at debian.org>
+Bug-Debian: https://bugs.debian.org/921510
+
+--- qutemol-0.4.1~cvs20081111.orig/src/ShadowMap.cpp
++++ qutemol-0.4.1~cvs20081111/src/ShadowMap.cpp
+@@ -248,6 +248,7 @@ bool ShadowMap::initHalo(){
+ bool AOgpu2::init(){
+   if (!moltextureCanvas.Test()) return false;
+   mainCanvas.SetAsOutput();
++  return true;
+ }
+ 
+ float myrand();
diff -Nru qutemol-0.4.1~cvs20081111/debian/patches/series qutemol-0.4.1~cvs20081111/debian/patches/series
--- qutemol-0.4.1~cvs20081111/debian/patches/series	2019-02-04 13:28:00.000000000 +0200
+++ qutemol-0.4.1~cvs20081111/debian/patches/series	2019-02-06 23:47:20.000000000 +0200
@@ -36,3 +36,4 @@
 38_libpng15.patch
 39_reproducible_build.patch
 40_c++11_compatibility.patch
+41_aogpu2_init_return.patch
Binary files /tmp/mefexQx1b2/qutemol-0.4.1~cvs20081111/debian/qutemol.png and /tmp/eIepoe2zGj/qutemol-0.4.1~cvs20081111/debian/qutemol.png differ
diff -Nru qutemol-0.4.1~cvs20081111/debian/rules qutemol-0.4.1~cvs20081111/debian/rules
--- qutemol-0.4.1~cvs20081111/debian/rules	2019-02-06 13:20:00.000000000 +0200
+++ qutemol-0.4.1~cvs20081111/debian/rules	2019-02-06 23:47:20.000000000 +0200
@@ -2,7 +2,7 @@
 
 export DEB_BUILD_MAINT_OPTIONS = hardening=+all
 export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
-export CXX = g++-7
+export DEB_CXXFLAGS_MAINT_APPEND = -Wall
 
 %:
 	dh $@


More information about the Debichem-devel mailing list