Comments (5)
Hi David!
Thanks for the heads up. It looks like it's working for me on Ubuntu 16.04 with GCC 5.4.0. Clang doesn't work in that setup but it looks like an lcov <-> Clang issue, not a segfault. What version of GCC are you using?
I'll definitely take a look when as I setup coverage reporting.
from h3.
damocles@Talyn:~/oss/h3(master)$ gcc --version
gcc (Ubuntu 7.2.0-8ubuntu3) 7.2.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
from h3.
Ran a gdb trace and I think I can fix this relatively quickly.
damocles@Talyn:~/oss/h3(master)$ gdb
GNU gdb (Ubuntu 8.0.1-0ubuntu1) 8.0.1
Copyright (C) 2017 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word".
(gdb) file
No executable file now.
No symbol file now.
(gdb) file bin/testCompact
Reading symbols from bin/testCompact...done.
(gdb) run
Starting program: /home/damocles/oss/h3/bin/testCompact
TEST compact
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7bbf38d in uncompact (compactedSet=0x60a020, numHexes=122, h3Set=0x0, maxHexes=122, res=0) at /home/damocles/oss/h3/src/h3lib/lib/h3Index.c:400
400 h3Set[outOffset] = compactedSet[i];
(gdb) bt
#0 0x00007ffff7bbf38d in uncompact (compactedSet=0x60a020, numHexes=122, h3Set=0x0, maxHexes=122, res=0) at /home/damocles/oss/h3/src/h3lib/lib/h3Index.c:400
#1 0x0000000000401c86 in main (argc=1, argv=0x7fffffffdc58) at /home/damocles/oss/h3/src/apps/testapps/testCompact.c:90
(gdb)
from h3.
Found it. It was a silly typo when callocing the output memory.
damocles@Talyn:~/oss/h3(master)$ git diff
diff --git a/src/apps/testapps/testCompact.c b/src/apps/testapps/testCompact.c
index 9277469..eedc9f2 100644
--- a/src/apps/testapps/testCompact.c
+++ b/src/apps/testapps/testCompact.c
@@ -85,7 +85,7 @@ TEST(res0) {
}
H3Index* decompressed = calloc(
- H3_EXPORT(maxUncompactSize)(compressed, hexCount, 9), sizeof(H3Index));
+ H3_EXPORT(maxUncompactSize)(compressed, hexCount, 0), sizeof(H3Index));
int err2 =
H3_EXPORT(uncompact)(compressed, hexCount, decompressed, hexCount, 0);
t_assert(err2 == 0, "no error on uncompact");
from h3.
Thanks for fixing it!
from h3.
Related Issues (20)
- About RFC: Polyfill modes release plan HOT 1
- replace `sprintf` with `snprintf` HOT 1
- Add additional modes for polygonToCells HOT 12
- Hex (cell) ID validation HOT 3
- Fuzzer timeout on fuzzerIj: gridPathCells
- Broken Link to website docs in contributing.md
- Broken link to website in contributing docs
- Uber CLA Contact HOT 1
- Has cell_to_vertex been implemented? HOT 2
- Replace empty function parameters with `void` HOT 1
- cell_to_child_pos() version 4 of the Python API client HOT 3
- polygonToCells: validity of polygons HOT 3
- Missing library stubs MYPY HOT 2
- polygonToCells not returning all H3Cells for the bounding box containing both USA and Russia HOT 1
- Confirmation of grid algorithm HOT 3
- cellToChildren error HOT 2
- Add function for returning the H3 indices of each endpoint of a directed edge HOT 5
- Expose cellToChildrenSize in bindings HOT 1
- Getting unexpected results when converting coordinates in either direction HOT 4
- Meta: blog post has broken images HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from h3.