NOAA-EMC / NCEPLIBS-g2c

This library contains C decoder/encoder routines for GRIB edition 2.
Other
18 stars 11 forks source link

problem with jasper on MacOS #398

Closed edwardhartnett closed 7 months ago

edwardhartnett commented 1 year ago

A new poblem has developed on MacOS with Jasper:

    g2c_unpack7 igdsnum 0 gds_tmpl_len 19 idrsnum 40 drs_tmpl_len 7 ndpts 11041
17
        g2c_unpack7_int *iofst 0 igdsnum 0 idrsnum 40 ndpts 11041 v1 0
18
            lensec 10529
19
        g2c_jpcunpack len 10524 ndpts 11041
20
        jpcunpack_int len 10524 ndpts 11041 fld_is_double 0
21
            int_dec_jpeg2000 bufsize 10524 out_is_g2int 1
22
            ret 0 pcmpt->height_ 1 pcmpt->width_ 11041
23
                                                            i 0
24
                                                            i 0 j 0
25
AddressSanitizer:DEADLYSIGNAL
26
=================================================================
27
==5139==ERROR: AddressSanitizer: SEGV on unknown address (pc 0x00010da9737d bp 0x7ff7b26971c0 sp 0x7ff7b2696fa0 T0)
28
==5139==The signal is caused by a READ memory access.
29
==5139==Hint: this fault was caused by a dereference of a high value address (see register values below).  Disassemble the provided pc to learn which register was used.
30
    #0 0x10da9737d in int_dec_jpeg2000 dec_jpeg2000.c:131
31
    #1 0x10da97849 in dec_jpeg2000 dec_jpeg2000.c:210
32
    #2 0x10da9b610 in jpcunpack_int jpcunpack.c:71
33
    #3 0x10da9b299 in jpcunpack jpcunpack.c:131
34
    #4 0x10da55d89 in g2c_unpack7_int g2_unpack7.c:140
35
    #5 0x10da565d4 in g2c_unpack7 g2_unpack7.c:284
36
    #6 0x10da884de in g2c_get_prod g2cprod.c:111
37
    #7 0x10da86f1c in g2c_degrib2 g2cdegrib2.c:734
38
    #8 0x10d8684b1 in main tst_degrib2_fast.c:32
39
    #9 0x11051652d in start+0x1cd (dyld:x86_64+0x552d)
edwardhartnett commented 1 year ago

This problem goes away when I upgrade to jasper-4.0.

Sigh.

We should therefore make the CMake build require jasper-4.0 for MacOS. But is this a problem that just happens on MacOS, or one that also happens on Linux but is not detected by address santizer?

@DusanJovic-NOAA do you know anything about why Jasper versions earlier than 4.0 no longer work on macos-latest?

DusanJovic-NOAA commented 1 year ago

I don't know.