[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: illegal instruction on atan2



I did some analysis here... I identified exactly where the error is occurring:

gdb --args ./bin/latLngToCell --resolution 10 --latitude 40.689167 --longitude -74.044444
GNU gdb (Debian 13.1-3) 13.1
Copyright (C) 2023 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 "powerpc64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://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"...
Reading symbols from ./bin/latLngToCell...
(gdb) run
Starting program: /home/bencz/h3/build/bin/latLngToCell --resolution 10 --latitude 40.689167 --longitude -74.044444
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/powerpc64-linux-gnu/libthread_db.so.1".

Program received signal SIGILL, Illegal instruction.
__cos (x=0.7101599340438236) at ../sysdeps/ieee754/dbl-64/s_sin.c:272
272     ../sysdeps/ieee754/dbl-64/s_sin.c: No such file or directory.
(gdb) bt full
#0  __cos (x=0.7101599340438236) at ../sysdeps/ieee754/dbl-64/s_sin.c:272
        y = <optimized out>
        a = 6.9533558075373792e-310
        da = 6.953355807549632e-310
        u = <optimized out>
        k = <optimized out>
        m = <optimized out>
        n = <optimized out>
        retval = 0
        ctx = <optimized out>
#1  0x0000000100013554 in _geoToVec3d (geo=0x7fffffffeb80, v=0x7fffffffe878) at /home/bencz/h3/src/h3lib/lib/vec3d.c:51
        r = 0
#2  0x000000010000bdc4 in _geoToClosestFace (g=0x7fffffffeb80, face=0x7fffffffeac8, sqd=0x7fffffffe970) at /home/bencz/h3/src/h3lib/lib/faceijk.c:938         v3d = {x = 2.1995190125098354e-106, y = 6.9533491603584174e-310, z = 0} #3  0x000000010000bb44 in _geoToHex2d (g=0x7fffffffeb80, res=10, face=0x7fffffffeac8, v=0x7fffffffea20) at /home/bencz/h3/src/h3lib/lib/faceijk.c:392
        sqd = 0
        r = 0
        theta = 0
#4  0x000000010000bacc in _geoToFaceIjk (g=0x7fffffffeb80, res=10, h=0x7fffffffeac8) at /home/bencz/h3/src/h3lib/lib/faceijk.c:374
        v = {x = 0, y = 0}
#5  0x000000010000825c in latLngToCell (g=0x7fffffffeb80, res=10, out=0x7fffffffeb78) at /home/bencz/h3/src/h3lib/lib/h3Index.c:784
        fijk = {face = 32767, coord = {i = -5424, j = 32767, k = -5200}}
#6  0x0000000100004428 in doCoords (lat=40.689166999999998, lng=-74.044443999999999, res=10) at /home/bencz/h3/src/apps/filters/latLngToCell.c:51
        g = {lat = 0.7101599340438236, lng = -1.2923193406085602}
        h = 4295059370
        e = 0
#7  0x0000000100004704 in main (argc=7, argv=0x7ffffffff328) at /home/bencz/h3/src/apps/filters/latLngToCell.c:102
        res = 10
        lat = 40.689166999999998
        lng = -74.044443999999999
        helpArg = {names = {0x1000166b8 "-h", 0x1000166bb "--help"}, required = false, scanFormat = 0x0, valueName = 0x0, value = 0x0, found = false, helpText = 0x1000166c2 "Show this help message."}         resArg = {names = {0x1000166da "-r", 0x1000166dd "--resolution"}, required = true, scanFormat = 0x1000166ea "%d", valueName = 0x1000166ed "res", value = 0x7fffffffee74, found = true, helpText = 0x1000166f1 "Resolution, 0-15 inclusive."}         latArg = {names = {0x10001670d "--lat", 0x100016713 "--latitude"}, required = false, scanFormat = 0x10001682b "%lf", valueName = 0x10001670f "lat", value = 0x7fffffffee68, found = true,           helpText = 0x10001671e "Latitude in degrees. If not specified, \"latitude longitude\" pairs will be read from standard input."}         lngArg = {names = {0x100016782 "--lng", 0x100016788 "--longitude"}, required = false, scanFormat = 0x10001682b "%lf", valueName = 0x100016784 "lng", value = 0x7fffffffee60, found = true, helpText = 0x100016794 "Longitude in degrees."}         args = {0x7fffffffee20, 0x7fffffffede0, 0x7fffffffeda0, 0x7fffffffed60}
        numArgs = 4
        helpText = 0x1000167aa "Convert degrees latitude/longitude coordinates to H3 indexes."


When I execute the command layout asm, it shows this line:

> 0x7ffff7ed8fec <__cos+28>        mffscrni f0,0


Reply to: