Skip to content

Conversation

@flange-ipb
Copy link
Collaborator

Add CI workflow for compilation and regression testing of libinchi using gcc and musl (a popular C standard library). Flawless compilation with musl has become possible with 1.07-beta.3's definition of is_ascii in INCHI-1-SRC/INCHI_BASE/src/util.c (see commit c778dfa).

Changes to the CI workflow:

  • rename existing gcc+glibc job
  • move most steps of the workflow to a reusable Action
  • uploaded artifacts (test logs/reports) from different jobs receive distinct names
  • show information on gcc and ldd
  • use alpine as docker image for the gcc+musl job

Lessons learned:

  • actions/setup-python cannot be used in Alpine containers, so Python installation is done via Alpine's package manager.
  • Virtual environments in Python do not work across different workflow steps, thus special care needs to be taken for Python's package manager pip due to PEP 668.
  • musl's ldd --version does not return with exitcode 0.

Copy link
Collaborator

@JanCBrammer JanCBrammer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! The workflow fails as intended with a manipulated reference (https://github.com/flange-ipb/InChI/actions/runs/7846614779).

@JanCBrammer JanCBrammer merged commit 1ba86af into IUPAC-InChI:main Feb 13, 2024
ricrogz added a commit to ricrogz/InChI that referenced this pull request Feb 22, 2025
    (if we start moving from the 7th byte, we have to reduce the number
    of bytes by the same amount, or we'll overflow the buffer!)

==7771==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x503000000084 at pc 0x7b8e82ee93c0 bp 0x7ffe4113cbb0 sp 0x7ffe4113c370
READ of size 18 at 0x503000000084 thread T0
    #0 0x7b8e82ee93bf in memmove (/usr/local/lib64/libasan.so.8+0xf73bf)
    IUPAC-InChI#1 0x5f5cdd in get_V3000_input_line_to_strbuf ../../../INCHI_BASE/src/mol_fmt3.c:1875
    IUPAC-InChI#2 0x5f5e95 in MolfileV3000ReadCTABBeginAndCountsLine ../../../INCHI_BASE/src/mol_fmt3.c:475
    IUPAC-InChI#3 0x5ec962 in MolfileReadDataLines ../../../INCHI_BASE/src/mol_fmt1.c:252
    IUPAC-InChI#4 0x5f216f in ReadMolfile ../../../INCHI_BASE/src/mol_fmt1.c:130
    IUPAC-InChI#5 0x60559b in ReadMolfileToInpAtoms ../../../INCHI_BASE/src/mol2atom.c:373
    IUPAC-InChI#6 0x605b7e in CreateOrigInpDataFromMolfile ../../../INCHI_BASE/src/mol2atom.c:160
    IUPAC-InChI#7 0x61bcc5 in ReadTheStructure ../../../INCHI_BASE/src/runichi2.c:470
    IUPAC-InChI#8 0x61cc8c in GetOneStructure ../../../INCHI_BASE/src/runichi2.c:229
    IUPAC-InChI#9 0x659b16 in GetTheNextRecordOfInputFile ../src/ichimain.c:1092
    IUPAC-InChI#10 0x65e7f1 in ProcessSingleInputFile ../src/ichimain.c:816
    IUPAC-InChI#11 0x65f9ae in main ../src/ichimain.c:250
    IUPAC-InChI#12 0x7b8e828be249  (/lib/x86_64-linux-gnu/libc.so.6+0x27249) (BuildId: c047672cae7964324658491e7dee26748ae5d2f8)
    IUPAC-InChI#13 0x7b8e828be304 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x27304) (BuildId: c047672cae7964324658491e7dee26748ae5d2f8)
    IUPAC-InChI#14 0x4025a0 in _start (/inchi/INCHI-1-TEST/exes/inchi-1+0x4025a0)
djb-rwth pushed a commit that referenced this pull request Feb 23, 2025
    (if we start moving from the 7th byte, we have to reduce the number
    of bytes by the same amount, or we'll overflow the buffer!)

==7771==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x503000000084 at pc 0x7b8e82ee93c0 bp 0x7ffe4113cbb0 sp 0x7ffe4113c370
READ of size 18 at 0x503000000084 thread T0
    #0 0x7b8e82ee93bf in memmove (/usr/local/lib64/libasan.so.8+0xf73bf)
    #1 0x5f5cdd in get_V3000_input_line_to_strbuf ../../../INCHI_BASE/src/mol_fmt3.c:1875
    #2 0x5f5e95 in MolfileV3000ReadCTABBeginAndCountsLine ../../../INCHI_BASE/src/mol_fmt3.c:475
    #3 0x5ec962 in MolfileReadDataLines ../../../INCHI_BASE/src/mol_fmt1.c:252
    #4 0x5f216f in ReadMolfile ../../../INCHI_BASE/src/mol_fmt1.c:130
    #5 0x60559b in ReadMolfileToInpAtoms ../../../INCHI_BASE/src/mol2atom.c:373
    #6 0x605b7e in CreateOrigInpDataFromMolfile ../../../INCHI_BASE/src/mol2atom.c:160
    #7 0x61bcc5 in ReadTheStructure ../../../INCHI_BASE/src/runichi2.c:470
    #8 0x61cc8c in GetOneStructure ../../../INCHI_BASE/src/runichi2.c:229
    #9 0x659b16 in GetTheNextRecordOfInputFile ../src/ichimain.c:1092
    #10 0x65e7f1 in ProcessSingleInputFile ../src/ichimain.c:816
    #11 0x65f9ae in main ../src/ichimain.c:250
    #12 0x7b8e828be249  (/lib/x86_64-linux-gnu/libc.so.6+0x27249) (BuildId: c047672cae7964324658491e7dee26748ae5d2f8)
    #13 0x7b8e828be304 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x27304) (BuildId: c047672cae7964324658491e7dee26748ae5d2f8)
    #14 0x4025a0 in _start (/inchi/INCHI-1-TEST/exes/inchi-1+0x4025a0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants