Skip to content

glibc: inconsistency detected by ld.so #128

@ghost

Description

I get this strange error:

Inconsistency detected by ld.so: dl-fini.c: 87: _dl_fini: Assertion `ns != LM_ID_BASE || i == nloaded' failed!

The code used to work before until I rearranged it but I got segmentation fault when calling libc fgets twice or more until this recent error about assertion failed.

Here is the code causing the error:

get_inf :: fn(arg: *u8) -> []string {
    _rcp_file : rawptr = fopen(arg, "r".raw)

    if !_rcp_file {
        printf("error: could not open file: '%s'\n".raw, arg)
        exit(1)
    }

    INF_PKG, INF_VER, INF_REL: string
    rcp_buff_pkg, rcp_buff_ver, rcp_buff_rel: *u8
    rcp_line_pkg : i32 = 100
    //rcp_line_ver : i32 = 50
    //rcp_line_rel : i32 = 10

    INF_PKG.raw = fgets(rcp_buff_pkg, rcp_line_pkg, _rcp_file)
    //INF_VER.raw = fgets(rcp_buff_ver, rcp_line_ver, _rcp_file)
    //INF_REL.raw = fgets(rcp_buff_rel, rcp_line_rel, _rcp_file)

    //INF_PKG_CUT := strstr(INF_PKG.raw, ":".raw)
    //INF_VER_CUT := strstr(INF_VER.raw, ":".raw)
    //INF_REL_CUT := strstr(INF_REL.raw, ":".raw)

    //INF_PKG_TRIM := trimstr(INF_PKG_CUT)
    //INF_VER_TRIM := trimstr(INF_VER_CUT)
    //INF_REL_TRIM := trimstr(INF_REL_CUT)

    fclose(_rcp_file)
    return []string { "hello", "world", "!" }
    //return []string {INF_PKG_TRIM, INF_VER_TRIM, INF_REL_TRIM}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions