UWCubeSat / lost

Lost: Open-source Star Tracker
37 stars 5 forks source link

Add dependency groff to macOS prerequisites #123

Closed AlnisS closed 10 months ago

AlnisS commented 10 months ago

Got an error about not having groff, and installing it fixed that error.

markasoftware commented 10 months ago

Nice!

Was this the only thing that didn't work according to instructions on macOS?

AlnisS commented 10 months ago

I also had issues with ASAN — worked after:

make clean
make LOST_DISABLE_ASAN=1

I also had some issues with installing eigen and cairo (homebrew failed partway through) but that was resolved by just re-running the brew install commands. I'll pin it on my computer's network security software going on the fritz.

Beyond that, it's working!

We may want to add the ASAN info to the general building instructions since it seems like it would affect all platforms. Should I add it to this branch/PR?

markasoftware commented 10 months ago

it should be possible to get asan to work somehow, and we do describe how to disable at already if necessary in the linux section.

markasoftware commented 10 months ago

But let's add a note about how to disable asan to the macOS section for now since it doesn't look like there's a libasan package in homebrew.

(I will note that, on my m2 mac though, compiling with the built-in Clang that comes as part of the xcode tools the ASAN works out of the box!)

AlnisS commented 10 months ago

I got the following error when running it — is this missing ASAN, or an issue detected by ASAN? To me, it looks like it might be the latter, but I'm not 100% sure (I am not a C++ dev!):

alnis-personal@ASMIDCHENS0ML2 lost % ./lost pipeline \
  --generate 1 \
  --plot-raw-input raw-input.png \
  --plot-input input.png
=================================================================
==42527==ERROR: AddressSanitizer: container-overflow on address 0x00011082dea0 at pc 0x00010d8ea8d1 bp 0x7ff7b272d230 sp 0x7ff7b272d228
READ of size 4 at 0x00011082dea0 thread T0
    #0 0x10d8ea8d0 in lost::Vec3::operator-(lost::Vec3 const&) const attitude-utils.cpp:225
    #1 0x10d9369ed in lost::CatalogRead() io.cpp:105
    #2 0x10d945e4f in lost::GetGeneratedPipelineInput(lost::PipelineOptions const&) io.cpp:766
    #3 0x10d946e86 in lost::GetPipelineInput(lost::PipelineOptions const&) io.cpp:806
    #4 0x10d9de748 in lost::PipelineRun(lost::PipelineOptions const&) main.cpp:44
    #5 0x10d9ddab8 in lost::LostMain(int, char**) main.cpp:231
    #6 0x10d9d4381 in main main.cpp:243
    #7 0x7ff80d38b41e in start+0x76e (dyld:x86_64+0xfffffffffff6e41e) (BuildId: 3df96f32b9c93566a6b74daebc6d656332000000200000000100000000060d00)
0x00011082dea0 is located 181920 bytes inside of 327680-byte region [0x000110801800,0x000110851800)
allocated by thread T0 here:
    #0 0x10e5cfd5d in wrap__Znwm+0x7d (libclang_rt.asan_osx_dynamic.dylib:x86_64h+0x57d5d) (BuildId: 756bb7515781379f84412f22c4274ffd2400000010000000000a0a0000030d00)
    #1 0x10d8f7184 in void* std::__1::__libcpp_operator_new[abi:v15006]<unsigned long>(unsigned long) new:246
    #2 0x10d8f7168 in std::__1::__libcpp_allocate[abi:v15006](unsigned long, unsigned long) new:272
    #3 0x10d98f639 in std::__1::allocator<lost::CatalogStar>::allocate[abi:v15006](unsigned long) allocator.h:112
    #4 0x10d98f47a in std::__1::__allocation_result<std::__1::allocator_traits<std::__1::allocator<lost::CatalogStar>>::pointer> std::__1::__allocate_at_least[abi:v15006]<std::__1::allocator<lost::CatalogStar>>(std::__1::allocator<lost::CatalogStar>&, unsigned long) allocate_at_least.h:54
    #5 0x10d98f0c3 in std::__1::__split_buffer<lost::CatalogStar, std::__1::allocator<lost::CatalogStar>&>::__split_buffer(unsigned long, unsigned long, std::__1::allocator<lost::CatalogStar>&) __split_buffer:316
    #6 0x10d98e4dc in std::__1::__split_buffer<lost::CatalogStar, std::__1::allocator<lost::CatalogStar>&>::__split_buffer(unsigned long, unsigned long, std::__1::allocator<lost::CatalogStar>&) __split_buffer:312
    #7 0x10d98d997 in void std::__1::vector<lost::CatalogStar, std::__1::allocator<lost::CatalogStar>>::__push_back_slow_path<lost::CatalogStar>(lost::CatalogStar&&) vector:1535
    #8 0x10d936441 in std::__1::vector<lost::CatalogStar, std::__1::allocator<lost::CatalogStar>>::push_back[abi:v15006](lost::CatalogStar&&) vector:1567
    #9 0x10d9360bb in lost::BscParse(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>) io.cpp:75
    #10 0x10d9367db in lost::CatalogRead() io.cpp:98
    #11 0x10d945e4f in lost::GetGeneratedPipelineInput(lost::PipelineOptions const&) io.cpp:766
    #12 0x10d946e86 in lost::GetPipelineInput(lost::PipelineOptions const&) io.cpp:806
    #13 0x10d9de748 in lost::PipelineRun(lost::PipelineOptions const&) main.cpp:44
    #14 0x10d9ddab8 in lost::LostMain(int, char**) main.cpp:231
    #15 0x10d9d4381 in main main.cpp:243
    #16 0x7ff80d38b41e in start+0x76e (dyld:x86_64+0xfffffffffff6e41e) (BuildId: 3df96f32b9c93566a6b74daebc6d656332000000200000000100000000060d00)
HINT: if you don't care about these errors you may set ASAN_OPTIONS=detect_container_overflow=0.
If you suspect a false positive see also: https://github.com/google/sanitizers/wiki/AddressSanitizerContainerOverflow.
SUMMARY: AddressSanitizer: container-overflow attitude-utils.cpp:225 in lost::Vec3::operator-(lost::Vec3 const&) const
Shadow bytes around the buggy address:
  0x100022105b80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x100022105b90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x100022105ba0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x100022105bb0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x100022105bc0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x100022105bd0: 00 00 00 00[fc]fc fc fc fc fc fc fc fc fc fc fc
  0x100022105be0: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
  0x100022105bf0: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
  0x100022105c00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
  0x100022105c10: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
  0x100022105c20: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07 
  Heap left redzone:       fa
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Container overflow:      fc
  Array cookie:            ac
  Intra object redzone:    bb
  ASan internal:           fe
  Left alloca redzone:     ca
  Right alloca redzone:    cb
==42527==ABORTING
zsh: abort      ./lost pipeline --generate 1 --plot-raw-input raw-input.png --plot-input
markasoftware commented 10 months ago

That error message actually is a legitimate error found by ASAN, as you suspected -- edward's last pr was supposed to fix that (but it's not merged yet)

AlnisS commented 10 months ago

Great, thank you!