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

Segmentation fault in morph::GridVisual::initializeVerticesRectsInterpolated when running grid_image example #182

Closed
SeverinDenisenko opened this issue Apr 24, 2024 · 3 comments · Fixed by #184
Assignees
Labels
bug Something isn't working

Comments

@SeverinDenisenko
Copy link
Contributor

SeverinDenisenko commented Apr 24, 2024

There is probably something wrong with indexes.

morph::Visual<glver=4.1> version 3.0 running on OpenGL Version 4.6 (Core Profile) Mesa 23.3.6
Image dims: (256,65)

Thread 1 "grid_image" received signal SIGSEGV, Segmentation fault.
0x0000000000521426 in morph::GridVisual<float, unsigned int, float, 262145>::initializeVerticesRectsInterpolated (this=0x61a0002a7280)
    at morphologica/morph/GridVisual.h:273
273                     datumNN =  this->grid->has_nn(ri)  ? dcopy[this->grid->index_nn(ri)] : datumC;
(gdb) bt
#0  0x0000000000521426 in morph::GridVisual<float, unsigned int, float, 262145>::initializeVerticesRectsInterpolated (this=0x61a0002a7280)
    at morphologica/morph/GridVisual.h:273
#1  0x0000000000529285 in morph::GridVisual<float, unsigned int, float, 262145>::initializeVertices (this=<optimized out>) at morphologica/morph/GridVisual.h:77
#2  0x000000000040b763 in morph::VisualModel<262145>::finalize (this=0x61a0002a7280) at morphologica/morph/VisualModel.h:234
#3  main () at morphologica/examples/grid_image.cpp:67

With ASAN:

morph::Visual<glver=4.1> version 3.0 running on OpenGL Version 4.6 (Core Profile) Mesa 23.3.6
Image dims: (256,65)
AddressSanitizer:DEADLYSIGNAL
=================================================================
==62817==ERROR: AddressSanitizer: SEGV on unknown address 0x631400244400 (pc 0x000000521426 bp 0x7ffd664c49d0 sp 0x7ffd664c4030 T0)
==62817==The signal is caused by a READ memory access.
    #0 0x521426 in morph::GridVisual<float, unsigned int, float, 262145>::initializeVerticesRectsInterpolated() morphologica/morph/GridVisual.h:273
    #1 0x529284 in morph::GridVisual<float, unsigned int, float, 262145>::initializeVertices() morphologica/morph/GridVisual.h:77
    #2 0x40b762 in morph::VisualModel<262145>::finalize() morphologica/morph/VisualModel.h:236
    #3 0x40b762 in main morphologica/examples/grid_image.cpp:67
    #4 0x7f9518965149 in __libc_start_call_main (/lib64/libc.so.6+0x28149) (BuildId: 7ea8d85df0e89b90c63ac7ed2b3578b2e7728756)
    #5 0x7f951896520a in __libc_start_main_impl (/lib64/libc.so.6+0x2820a) (BuildId: 7ea8d85df0e89b90c63ac7ed2b3578b2e7728756)
    #6 0x40cb54 in _start (morphologica/build/examples/grid_image+0x40cb54) (BuildId: 85b89c3aa6d2f950289596e37e767f29e1c3c3a4)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV morphologica/morph/GridVisual.h:273 in morph::GridVisual<float, unsigned int, float, 262145>::initializeVerticesRectsInterpolated()
==62817==ABORTING

Found on last main branch.

@sebjameswml
Copy link
Collaborator

Confirmed, I get this bug too.

@sebjameswml
Copy link
Collaborator

The bug is in morph/Grid.h. I'll get it fixed soon.

@sebjameswml sebjameswml added the bug Something isn't working label Apr 24, 2024
@sebjameswml sebjameswml self-assigned this Apr 24, 2024
@sebjameswml sebjameswml linked a pull request Apr 25, 2024 that will close this issue
@sebjameswml
Copy link
Collaborator

This should be resolved with the associated pull request. I'll close once it has passed its CI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants