jarro2783 / cxxopts

Lightweight C++ command line option parser
MIT License
4.16k stars 582 forks source link

options test fails with SIGTRAP on macOS / arm64 #431

Open barracuda156 opened 3 months ago

barracuda156 commented 3 months ago
Running tests...
/opt/local/bin/ctest --force-new-ctest-process 
Test project /opt/local/var/macports/build/_opt_svacchanda_SonomaPorts_devel_cxxopts/cxxopts/work/build
    Start 1: options
1/3 Test #1: options ..........................SIGTRAP***Exception:   0.30 sec
    Start 2: find-package-test
2/3 Test #2: find-package-test ................   Passed    1.37 sec
    Start 3: add-subdirectory-test
3/3 Test #3: add-subdirectory-test ............   Passed    1.34 sec

67% tests passed, 1 tests failed out of 3

Total Test time (real) =   3.02 sec
jarro2783 commented 3 months ago

Can you tell me what platform and architecture? Can you run it with gdb and get a stack trace?

barracuda156 commented 3 months ago

Can you tell me what platform and architecture? Can you run it with gdb and get a stack trace?

This is on macOS 14.5 arm64.

I am not sure gdb is working on arm64 now, but I can do it on PowerPC.

jarro2783 commented 3 months ago

I don't have the ability to debug on that platform, so any extra info you can give me will help. I can try address sanitizer and see if it comes up with anything.

barracuda156 commented 3 months ago

Has it been confirmed to work on any non-x86 platform?

barracuda156 commented 3 months ago

@jarro2783 Looks like the problem is specific to arm64 or Sonoma. At least on 10.6 powerpc everything works fine, both for 3.2.1 and 59656709c0c58fcd0ed18b38e02938dbe05284c5 (current master):

--->  Testing cxxopts
Executing:  cd "/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_cxxopts/cxxopts/work/build" && /usr/bin/make test 
Running tests...
/opt/local/bin/ctest --force-new-ctest-process 
Test project /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_cxxopts/cxxopts/work/build
    Start 1: options
1/3 Test #1: options ..........................   Passed    0.04 sec
    Start 2: find-package-test
2/3 Test #2: find-package-test ................   Passed   26.79 sec
    Start 3: add-subdirectory-test
3/3 Test #3: add-subdirectory-test ............   Passed   26.74 sec

100% tests passed, 0 tests failed out of 3

Total Test time (real) =  53.59 sec
jarro2783 commented 3 months ago

The UB sanitizer found an potential integer overflow. I don't know if arm aborts on that. If you can get a stack trace that would be great.