Skip to content

ERROR: SIGSEGV (11/11) in linkern.c #4

Description

@Genlight

I am running concorde in WSL2 in Windows 10, Debian, LInux v

master@Dell:~$ uname -s
Linux
master@Dell:~$ uname -r
4.19.128-microsoft-standard 

I installed concorde according to the README.
I can run concorde fine for most instances, but got a FATAL ERROR: SIGSEGV (11/11) when running the instance 1000.txt.tsp
1000.txt

i debugged it with gdb and found that in linkern.c, at line 1862 i ran into the error.

static void find_close_four (graph *G, distobj *D, CClk_flipper *F, int *t1,
        int *t2, int *t3, int *t4, int *t5, int *t6, int *t7, int *t8)
{
...
for (k = 0; k < RAND_TRYS; k++) tdist[k] = BIGINT;
    tdist[RAND_TRYS] = -BIGINT;
    for (i = 0; i < count; i++) {
        try1 = CCutil_lprand (G->rstate) % G->ncount;
        trydist = Edgelen (try1, s1, D);                                        // if trydist > BIGINT for most instances, than the faulty state is entered
        if (trydist < tdist[0]) {
            for (k = 0; tdist[k + 1] > trydist; k++) {
                tdist[k] = tdist[k + 1];                       //  line 1862: SIGSEG comes from here
                trials[k] = trials[k + 1];
            }
            tdist[k] = trydist;
            trials[k] = try1;
        }
    }

The problem lies with trydist, when it never is set to some int smaller than BIGINT (=2000000000 ). This will result in the loop not exiting, k becoming increased and set to 7. Then an Array out of Bounds Error (in C: Segmentation fault) happens.

I can change my input (I am using a big M constant, so there is some room...) but others might not be so lucky.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions