Giter VIP home page Giter VIP logo

Comments (5)

isaacbrodsky avatar isaacbrodsky commented on May 16, 2024

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.

dfellis avatar dfellis commented on May 16, 2024
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.

dfellis avatar dfellis commented on May 16, 2024

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.

dfellis avatar dfellis commented on May 16, 2024

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.

isaacbrodsky avatar isaacbrodsky commented on May 16, 2024

Thanks for fixing it!

from h3.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.