Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash in test_ogr_gpkg_field_operations_rollback #11679

Closed
rouault opened this issue Jan 17, 2025 · 2 comments · Fixed by #11680
Closed

Crash in test_ogr_gpkg_field_operations_rollback #11679

rouault opened this issue Jan 17, 2025 · 2 comments · Fixed by #11680
Assignees
Labels
blocker Bug that should be addressed (category reserved for usage of the maintainers of the library)
Milestone

Comments

@rouault
Copy link
Member

rouault commented Jan 17, 2025

@elpaso In my fork (on totally unrelated subject), I just got a crash in the fedora:rawhide CI target in test_ogr_gpkg_field_operations_rollback

Cf https://github.com/rouault/gdal/actions/runs/12821291036/job/35752281737

0: ..............................................Fatal Python error: Segmentation fault
30: 
30: Current thread 0x00007f5d126aeb80 (most recent call first):
30:   File "/home/runner/work/gdal/gdal/build-fedora_rawhide/swig/python/osgeo/ogr.py", line 1317 in DeleteField
30:   File "/home/runner/work/gdal/gdal/build-fedora_rawhide/autotest/pymod/ogrtest.py", line 453 in check_transaction_rollback
30:   File "/home/runner/work/gdal/gdal/build-fedora_rawhide/autotest/ogr/ogr_gpkg.py", line 10921 in test_ogr_gpkg_field_operations_rollback
@rouault
Copy link
Member Author

rouault commented Jan 17, 2025

good news is that the crash can be reliably reproduced locally in a Docker image applying .github/workflows/fedora_rawhide/ scripts:

with

  -DCMAKE_BUILD_TYPE=Release \
  -DCMAKE_C_COMPILER=clang \
  -DCMAKE_CXX_COMPILER=clang++ \
  -DCMAKE_C_FLAGS="-Werror -O1 -D_FORTIFY_SOURCE=2" \
  -DCMAKE_CXX_FLAGS="-std=c++20 -Werror -O1 -D_FORTIFY_SOURCE=2" \

we get:

[root@fc4e9b0f1299 build_fedora_rawhide]# PYTHONMALLOC=malloc valgrind python3 -m pytest autotest/ogr/ogr_gpkg.py::test_ogr_gpkg_field_operations_rollback
[....]
==9651== Conditional jump or move depends on uninitialised value(s)
==9651==    at 0x908124C: std::_Bit_reference::operator=(bool) (in /home/even/gdal/gdal/build_fedora_rawhide/libgdal.so.36.3.11.0)
==9651==    by 0x96CC9BF: std::_Bit_reference::operator=(std::_Bit_reference const&) (in /home/even/gdal/gdal/build_fedora_rawhide/libgdal.so.36.3.11.0)
==9651==    by 0x96CD0FF: std::_Bit_iterator std::__copy_move_a2<false, std::_Bit_iterator, std::_Bit_iterator, std::_Bit_iterator>(std::_Bit_iterator, std::_Bit_iterator, std::_Bit_iterator) (in /home/even/gdal/gdal/build_fedora_rawhide/libgdal.so.36.3.11.0)
==9651==    by 0x96CC6D9: std::_Bit_iterator std::copy<std::_Bit_iterator, std::_Bit_iterator>(std::_Bit_iterator, std::_Bit_iterator, std::_Bit_iterator) (in /home/even/gdal/gdal/build_fedora_rawhide/libgdal.so.36.3.11.0)
==9651==    by 0x9DA7EE3: std::vector<bool, std::allocator<bool> >::_M_erase(std::_Bit_iterator) (in /home/even/gdal/gdal/build_fedora_rawhide/libgdal.so.36.3.11.0)
==9651==    by 0x9DA0488: std::vector<bool, std::allocator<bool> >::erase(std::_Bit_const_iterator) (in /home/even/gdal/gdal/build_fedora_rawhide/libgdal.so.36.3.11.0)
==9651==    by 0x9D948ED: OGRGeoPackageTableLayer::DeleteField(int) (in /home/even/gdal/gdal/build_fedora_rawhide/libgdal.so.36.3.11.0)
==9651==    by 0x9EA3C66: OGR_L_DeleteField (in /home/even/gdal/gdal/build_fedora_rawhide/libgdal.so.36.3.11.0)
==9651==    by 0xCD07A2B: _wrap_Layer_DeleteField (in /home/even/gdal/gdal/build_fedora_rawhide/swig/python/osgeo/_ogr.cpython-313-x86_64-linux-gnu.so)
==9651==    by 0x49D0589: ??? (in /usr/lib64/libpython3.13.so.1.0)
==9651==    by 0x4A88385: ??? (in /usr/lib64/libpython3.13.so.1.0)
==9651==    by 0x49B331C: _PyEval_EvalFrameDefault (in /usr/lib64/libpython3.13.so.1.0)
==9651== 
==9651== Invalid read of size 8
==9651==    at 0x907EE5F: std::_Bit_reference::operator bool() const (in /home/even/gdal/gdal/build_fedora_rawhide/libgdal.so.36.3.11.0)
==9651==    by 0x96CC9B0: std::_Bit_reference::operator=(std::_Bit_reference const&) (in /home/even/gdal/gdal/build_fedora_rawhide/libgdal.so.36.3.11.0)
==9651==    by 0x96CD0FF: std::_Bit_iterator std::__copy_move_a2<false, std::_Bit_iterator, std::_Bit_iterator, std::_Bit_iterator>(std::_Bit_iterator, std::_Bit_iterator, std::_Bit_iterator) (in /home/even/gdal/gdal/build_fedora_rawhide/libgdal.so.36.3.11.0)
==9651==    by 0x96CC6D9: std::_Bit_iterator std::copy<std::_Bit_iterator, std::_Bit_iterator>(std::_Bit_iterator, std::_Bit_iterator, std::_Bit_iterator) (in /home/even/gdal/gdal/build_fedora_rawhide/libgdal.so.36.3.11.0)
==9651==    by 0x9DA7EE3: std::vector<bool, std::allocator<bool> >::_M_erase(std::_Bit_iterator) (in /home/even/gdal/gdal/build_fedora_rawhide/libgdal.so.36.3.11.0)
==9651==    by 0x9DA0488: std::vector<bool, std::allocator<bool> >::erase(std::_Bit_const_iterator) (in /home/even/gdal/gdal/build_fedora_rawhide/libgdal.so.36.3.11.0)
==9651==    by 0x9D948ED: OGRGeoPackageTableLayer::DeleteField(int) (in /home/even/gdal/gdal/build_fedora_rawhide/libgdal.so.36.3.11.0)
==9651==    by 0x9EA3C66: OGR_L_DeleteField (in /home/even/gdal/gdal/build_fedora_rawhide/libgdal.so.36.3.11.0)
==9651==    by 0xCD07A2B: _wrap_Layer_DeleteField (in /home/even/gdal/gdal/build_fedora_rawhide/swig/python/osgeo/_ogr.cpython-313-x86_64-linux-gnu.so)
==9651==    by 0x49D0589: ??? (in /usr/lib64/libpython3.13.so.1.0)
==9651==    by 0x4A88385: ??? (in /usr/lib64/libpython3.13.so.1.0)
==9651==    by 0x49B331C: _PyEval_EvalFrameDefault (in /usr/lib64/libpython3.13.so.1.0)
==9651==  Address 0x2cf00458 is 0 bytes after a block of size 8 alloc'd
==9651==    at 0x4841FEC: operator new(unsigned long) (vg_replace_malloc.c:487)
==9651==    by 0x8EEC125: std::__new_allocator<unsigned long>::allocate(unsigned long, void const*) (in /home/even/gdal/gdal/build_fedora_rawhide/libgdal.so.36.3.11.0)
==9651==    by 0x908434D: std::_Bvector_base<std::allocator<bool> >::_M_allocate(unsigned long) (in /home/even/gdal/gdal/build_fedora_rawhide/libgdal.so.36.3.11.0)
==9651==    by 0x99B6631: std::vector<bool, std::allocator<bool> >::_M_fill_insert(std::_Bit_iterator, unsigned long, bool) (in /home/even/gdal/gdal/build_fedora_rawhide/libgdal.so.36.3.11.0)
==9651==    by 0x99B5EAE: std::vector<bool, std::allocator<bool> >::insert(std::_Bit_const_iterator, unsigned long, bool const&) (in /home/even/gdal/gdal/build_fedora_rawhide/libgdal.so.36.3.11.0)
==9651==    by 0x99B4E47: std::vector<bool, std::allocator<bool> >::resize(unsigned long, bool) (in /home/even/gdal/gdal/build_fedora_rawhide/libgdal.so.36.3.11.0)
==9651==    by 0x9D85A9A: OGRGeoPackageTableLayer::CreateField(OGRFieldDefn const*, int) (in /home/even/gdal/gdal/build_fedora_rawhide/libgdal.so.36.3.11.0)
==9651==    by 0x9EA3BAD: OGR_L_CreateField (in /home/even/gdal/gdal/build_fedora_rawhide/libgdal.so.36.3.11.0)
==9651==    by 0xCCF3B15: _wrap_Layer_CreateField (in /home/even/gdal/gdal/build_fedora_rawhide/swig/python/osgeo/_ogr.cpython-313-x86_64-linux-gnu.so)
==9651==    by 0x49D0493: ??? (in /usr/lib64/libpython3.13.so.1.0)
==9651==    by 0x4A88385: ??? (in /usr/lib64/libpython3.13.so.1.0)
==9651==    by 0x49B331C: _PyEval_EvalFrameDefault (in /usr/lib64/libpython3.13.so.1.0)
==9651== 

and better with -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="-std=c++20" :

==12972== Conditional jump or move depends on uninitialised value(s)
==12972==    at 0x90B7DCC: std::_Bit_reference::operator=(bool) (stl_bvector.h:112)
==12972==    by 0x9791A7F: std::_Bit_reference::operator=(std::_Bit_reference const&) (stl_bvector.h:134)
==12972==    by 0x97921BF: __assign_one<false, std::_Bit_iterator, std::_Bit_iterator> (stl_algobase.h:421)
==12972==    by 0x97921BF: std::_Bit_iterator std::__copy_move_a2<false, std::_Bit_iterator, std::_Bit_iterator, std::_Bit_iterator>(std::_Bit_iterator, std::_Bit_iterator, std::_Bit_iterator) (stl_algobase.h:475)
==12972==    by 0x9791799: __copy_move_a1<false, std::_Bit_iterator, std::_Bit_iterator> (stl_algobase.h:505)
==12972==    by 0x9791799: __copy_move_a<false, std::_Bit_iterator, std::_Bit_iterator> (stl_algobase.h:514)
==12972==    by 0x9791799: std::_Bit_iterator std::copy<std::_Bit_iterator, std::_Bit_iterator>(std::_Bit_iterator, std::_Bit_iterator, std::_Bit_iterator) (stl_algobase.h:653)
==12972==    by 0x9EBF173: std::vector<bool, std::allocator<bool> >::_M_erase(std::_Bit_iterator) (vector.tcc:1222)
==12972==    by 0x9EB7698: std::vector<bool, std::allocator<bool> >::erase(std::_Bit_const_iterator) (stl_bvector.h:1414)
==12972==    by 0x9EAB58D: OGRGeoPackageTableLayer::DeleteField(int) (ogr/ogrsf_frmts/gpkg/ogrgeopackagetablelayer.cpp:6609)
==12972==    by 0x9FC334E: OGR_L_DeleteField (ogr/ogrsf_frmts/generic/ogrlayer.cpp:1003)
==12972==    by 0xCE79A2B: _wrap_Layer_DeleteField (in /home/even/gdal/gdal/build_fedora_rawhide/swig/python/osgeo/_ogr.cpython-313-x86_64-linux-gnu.so)
==12972==    by 0x49D0589: ??? (in /usr/lib64/libpython3.13.so.1.0)
==12972==    by 0x4A88385: ??? (in /usr/lib64/libpython3.13.so.1.0)
==12972==    by 0x49B331C: _PyEval_EvalFrameDefault (in /usr/lib64/libpython3.13.so.1.0)
==12972== 
==12972== Invalid read of size 8
==12972==    at 0x90B593F: std::_Bit_reference::operator bool() const (stl_bvector.h:106)
==12972==    by 0x9791A70: std::_Bit_reference::operator=(std::_Bit_reference const&) (stl_bvector.h:134)
==12972==    by 0x97921BF: __assign_one<false, std::_Bit_iterator, std::_Bit_iterator> (stl_algobase.h:421)
==12972==    by 0x97921BF: std::_Bit_iterator std::__copy_move_a2<false, std::_Bit_iterator, std::_Bit_iterator, std::_Bit_iterator>(std::_Bit_iterator, std::_Bit_iterator, std::_Bit_iterator) (stl_algobase.h:475)
==12972==    by 0x9791799: __copy_move_a1<false, std::_Bit_iterator, std::_Bit_iterator> (stl_algobase.h:505)
==12972==    by 0x9791799: __copy_move_a<false, std::_Bit_iterator, std::_Bit_iterator> (stl_algobase.h:514)
==12972==    by 0x9791799: std::_Bit_iterator std::copy<std::_Bit_iterator, std::_Bit_iterator>(std::_Bit_iterator, std::_Bit_iterator, std::_Bit_iterator) (stl_algobase.h:653)
==12972==    by 0x9EBF173: std::vector<bool, std::allocator<bool> >::_M_erase(std::_Bit_iterator) (vector.tcc:1222)
==12972==    by 0x9EB7698: std::vector<bool, std::allocator<bool> >::erase(std::_Bit_const_iterator) (stl_bvector.h:1414)
==12972==    by 0x9EAB58D: OGRGeoPackageTableLayer::DeleteField(int) (ogr/ogrsf_frmts/gpkg/ogrgeopackagetablelayer.cpp:6609)
==12972==    by 0x9FC334E: OGR_L_DeleteField (ogr/ogrsf_frmts/generic/ogrlayer.cpp:1003)
==12972==    by 0xCE79A2B: _wrap_Layer_DeleteField (in /home/even/gdal/gdal/build_fedora_rawhide/swig/python/osgeo/_ogr.cpython-313-x86_64-linux-gnu.so)
==12972==    by 0x49D0589: ??? (in /usr/lib64/libpython3.13.so.1.0)
==12972==    by 0x4A88385: ??? (in /usr/lib64/libpython3.13.so.1.0)
==12972==    by 0x49B331C: _PyEval_EvalFrameDefault (in /usr/lib64/libpython3.13.so.1.0)
==12972==  Address 0x2d36ff78 is 0 bytes after a block of size 8 alloc'd
==12972==    at 0x4841FEC: operator new(unsigned long) (vg_replace_malloc.c:487)
==12972==    by 0x8EF7855: std::__new_allocator<unsigned long>::allocate(unsigned long, void const*) (new_allocator.h:151)
==12972==    by 0x90BAF6D: allocate (alloc_traits.h:614)
==12972==    by 0x90BAF6D: std::_Bvector_base<std::allocator<bool> >::_M_allocate(unsigned long) (stl_bvector.h:685)
==12972==    by 0x9A9DF61: std::vector<bool, std::allocator<bool> >::_M_fill_insert(std::_Bit_iterator, unsigned long, bool) (vector.tcc:1136)
==12972==    by 0x9A9D7DE: std::vector<bool, std::allocator<bool> >::insert(std::_Bit_const_iterator, unsigned long, bool const&) (stl_bvector.h:1306)
==12972==    by 0x9A9C777: std::vector<bool, std::allocator<bool> >::resize(unsigned long, bool) (stl_bvector.h:1432)
==12972==    by 0x9E9C455: OGRGeoPackageTableLayer::CreateField(OGRFieldDefn const*, int) (ogr/ogrsf_frmts/gpkg/ogrgeopackagetablelayer.cpp:1855)
==12972==    by 0x9FC327C: OGR_L_CreateField (ogr/ogrsf_frmts/generic/ogrlayer.cpp:970)
==12972==    by 0xCE65B15: _wrap_Layer_CreateField (in /home/even/gdal/gdal/build_fedora_rawhide/swig/python/osgeo/_ogr.cpython-313-x86_64-linux-gnu.so)
==12972==    by 0x49D0493: ??? (in /usr/lib64/libpython3.13.so.1.0)
==12972==    by 0x4A88385: ??? (in /usr/lib64/libpython3.13.so.1.0)
==12972==    by 0x49B331C: _PyEval_EvalFrameDefault (in /usr/lib64/libpython3.13.so.1.0)

@rouault rouault added this to the 3.11.0 milestone Jan 17, 2025
@rouault rouault added the blocker Bug that should be addressed (category reserved for usage of the maintainers of the library) label Jan 17, 2025
@elpaso
Copy link
Collaborator

elpaso commented Jan 17, 2025 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocker Bug that should be addressed (category reserved for usage of the maintainers of the library)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants