[GRASS-git] [OSGeo/grass] 705036: lib/proj: fix data race on METERS_in/METERS_out in...

Kaushik Raja noreply at github.com
Sat Jul 25 01:45:16 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/OSGeo/grass
  Commit: 7050369433b0a954f3a1420b24517d641f462a05
      https://github.com/OSGeo/grass/commit/7050369433b0a954f3a1420b24517d641f462a05
  Author: Kaushik Raja <85415462+krcoder123 at users.noreply.github.com>
  Date:   2026-07-25 (Sat, 25 Jul 2026)

  Changed paths:
    M lib/proj/do_proj.c

  Log Message:
  -----------
  lib/proj: fix data race on METERS_in/METERS_out in coordinate transform functions (#7764)

lib/proj: make METERS_in and METERS_out local to fix a data race

The file-scope variables METERS_in and METERS_out were written on every
call to GPJ_transform, GPJ_transform_array, pj_do_proj, and
pj_do_transform. When GPJ_transform is called from multiple threads,
ThreadSanitizer reports data races on both variables even when each
thread uses its own cloned PJ object.

Each function writes both variables before reading them, so they carry
no state between calls. This change makes them locals of the four
functions and removes the file-scope declaration. Output is unchanged.



To unsubscribe from these emails, change your notification settings at https://github.com/OSGeo/grass/settings/notifications


More information about the grass-commit mailing list