git.iko.soy/typeable/nixpkgs
on master help sign in
coin3d: include fix for newer compilers

This manifests as a segfault in any applications that use the library.

commitcf32537210014b55b69c2ad1f62db91b3a3ff000 authortimor <timor.dd@googlemail.com> dateSat 9 Sep 2017, 20:18 (9 years ago) parente960eb0
2 files changed+28
pkgs/development/libraries/coin3d/default.nix+3 pkgs/development/libraries/coin3d/sbhashentry.patch+25
pkgs/development/libraries/coin3d/default.nix+3
@@ -16,6 +16,9 @@ stdenv.mkDerivation rec {
1616 sha256 = "076dyc52swk8qc7ylps53fg6iqmd52x8s7m18i80x49dd109yw20";
1717 })
1818 ./gcc-4.8.patch # taken from FC-17 source rpm
19+ # see https://bitbucket.org/Coin3D/coin/issues/128/crash-in-cc_memalloc_deallocate
20+ # patch adapted from https://bitbucket.org/Coin3D/coin/pull-requests/75/added-fix-for-issue-128-provided-by-fedora/diff
21+ ./sbhashentry.patch
1922 ];
2023
2124 buildInputs = [ mesa ];
pkgs/development/libraries/coin3d/sbhashentry.patchnew file+25
@@ -0,0 +1,25 @@
1+diff -u --label /tmp/Coin-3.1.3/src/misc/SbHash.h --label \#\<buffer\ SbHash.h\> /tmp/Coin-3.1.3/src/misc/SbHash.h /tmp/buffer-content-21756V0
2+--- a/src/misc/SbHash.h
3++++ b/src/misc/SbHash.h
4+@@ -88,8 +88,8 @@
5+ SbHashEntry<Type, Key> * entry = static_cast<SbHashEntry<Type, Key> *>( ptr);
6+ cc_memalloc_deallocate(entry->memhandler, ptr);
7+ }
8+- SbHashEntry(const Key & key, const Type & obj) : key(key), obj(obj) {}
9+-
10++ SbHashEntry(const Key & key, const Type & obj, cc_memalloc *memhandler)
11++ : key(key), obj(obj), memhandler(memhandler) {}
12+ Key key;
13+ Type obj;
14+ SbHashEntry<Type, Key> * next;
15+@@ -218,7 +218,7 @@
16+ /* Key not already in the hash table; insert a new
17+ * entry as the first element in the bucket
18+ */
19+- entry = new (this->memhandler) SbHashEntry<Type, Key>(key, obj);
20++ entry = new (this->memhandler) SbHashEntry<Type, Key>(key, obj, this->memhandler);
21+ entry->next = this->buckets[i];
22+ this->buckets[i] = entry;
23+
24+
25+Diff finished. Sat Sep 9 19:50:32 2017