Skip to content
This repository was archived by the owner on Mar 25, 2024. It is now read-only.
This repository was archived by the owner on Mar 25, 2024. It is now read-only.

SIGSEV thrown in multithread environment #155

@danfran

Description

@danfran

I am running SFCGAL in a multithread env with the only sfcgal function sfcgal_geometry_intersects:

void *match_counter(void *threadarg) {
    struct thread_data *tdata = (struct thread_data *) threadarg;
    printf("starting thread-%d (%zu, %zu)\n", tdata->thread_id, tdata->idx_start, tdata->idx_end);

    int counter = 0;
    for (size_t p = tdata->idx_start; p < tdata->idx_end; p++) {
        if (sfcgal_geometry_intersects(tdata->polygon, tdata->listings->array[p].location) == 1) {
            counter++;
        }
    }
    printf("thread-%d final count %d\n", tdata->thread_id, counter);
    pthread_exit(NULL);
}

and I get Process finished with exit code 139 (interrupted by signal 11: SIGSEGV).

I have excluded issues from my side, so it looks like the SFCGAL call creates the issue. Now the relative code goes straight down to CGAL.

CGAL requires some configuration to be used on multi-threading env:
https://github.com/CGAL/cgal/wiki/Concurrency-in-CGAL

Is SFCGAL meant to work in multithread env?

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