loda-lang / loda-cpp

Runtime and miner for the LODA language written in C++
https://loda-lang.org/
Apache License 2.0
21 stars 1 forks source link

Process hangs #257

Closed ckrause closed 1 year ago

ckrause commented 1 year ago
loda-cpp$ lldb -- ./loda mine -H 2
(lldb) target create "./loda"
Current executable set to '/Users/me/git/loda-cpp/loda' (x86_64).
(lldb) settings set -- target.run-args  "mine" "-H" "2"
(lldb) run
Process 41329 launched: '/Users/me/git/loda-cpp/loda' (x86_64)
warning: libobjc.A.dylib is being read from process memory. This indicates that LLDB could not read from the host's in-memory shared cache. This will likely reduce debugging performance.

2023-06-03 09:10:03|INFO |Starting LODA developer version. See https://loda-lang.org/
2023-06-03 09:10:03|INFO |Using LODA home directory "/Users/d060111/loda/"
2023-06-03 09:10:04|INFO |Loading sequences from the OEIS index
2023-06-03 09:10:08|INFO |Loaded 350757/363068 sequences in 3.63s
2023-06-03 09:10:11|INFO |Initialized 5 matchers (ignoring 149568 sequences)
2023-06-03 09:10:11|INFO |Initialized 1 generators (profile: mutate, overwrite: none)
2023-06-03 09:10:11|INFO |Mining programs in client mode (extended validation mode)
2023-06-03 09:10:42|INFO |Processed 6208 programs, 0.5%
2023-06-03 09:28:23|INFO |Processed 3545 programs, 15.3%
2023-06-03 09:28:59|INFO |Processed 1320190 programs, 15.8%
2023-06-03 09:29:35|INFO |Processed 878663 programs, 16.3%
2023-06-03 09:30:11|INFO |Processed 144439 programs, 16.8%
2023-06-03 09:31:00|INFO |Processed 57849 programs, 17.4%
2023-06-03 09:31:36|INFO |Processed 29193 programs, 17.9%
2023-06-03 11:10:29|INFO |Initiating shutdown
Process 41329 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGSTOP
    frame #0: 0x0000000100053404 loda`Number::operator%=(this=0x000000030424e358, n=0x000000030424e410) at number.cpp:300:7 [opt]
   297      return *this;
   298    }
   299    // One of the operands big?
-> 300    if (big) {
   301      if (n.big) {
   302        (*big) %= (*n.big);
   303        checkInfBig();
Target 0: (loda) stopped.
warning: loda was compiled with optimization - stepping may behave oddly; variables may not be available.
(lldb) bt
* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGSTOP
  * frame #0: 0x0000000100053404 loda`Number::operator%=(this=0x000000030424e358, n=0x000000030424e410) at number.cpp:300:7 [opt]
    frame #1: 0x0000000100061bc6 loda`Semantics::getPowerOf(Number, Number const&) [inlined] Semantics::mod(a=0x000000030424e3a0, b=0x000000030424e410) at semantics.cpp:46:5 [opt]
    frame #2: 0x0000000100061baf loda`Semantics::getPowerOf(value=Number @ 0x000000030424e3a0, base=0x000000030424e410) at semantics.cpp:193:10 [opt]
    frame #3: 0x0000000100050f20 loda`Minimizer::getPowerOf(v=0x000000012b00e658) at minimizer.cpp:149:19 [opt]
    frame #4: 0x0000000100070005 loda`hasBadGcd(p=0x000000030424e6a0) at finder.cpp:260:10 [opt]
    frame #5: 0x00000001000700ef loda`isSimpler(existing=0x000000030424e6a0, optimized=0x000000030424e6c0) at finder.cpp:281:7 [opt]
    frame #6: 0x000000010006f024 loda`Finder::isOptimizedBetter(this=0x000000010900b210, existing=Program @ 0x000000030424e6a0, optimized=Program @ 0x000000030424e6c0, seq=0x000000030424e628, full_check=false, num_usages=0) at finder.cpp:379:7 [opt]
    frame #7: 0x000000010006ebe2 loda`Finder::checkProgramExtended(this=0x000000010900b210, program=<unavailable>, existing=Program @ 0x000000030424e980, is_new=<unavailable>, seq=<unavailable>, full_check=<unavailable>, num_usages=0) at finder.cpp:198:20 [opt]
    frame #8: 0x00000001000a836c loda`OeisManager::updateProgram(this=0x000000010900ae00, id=<unavailable>, p=<unavailable>, validation_mode=<unavailable>) at oeis_manager.cpp:808:24 [opt]
    frame #9: 0x000000010008ab76 loda`Miner::runMineLoop(this=0x000000030424ed80) at miner.cpp:225:22 [opt]
    frame #10: 0x0000000100089b9f loda`Miner::mine(this=0x000000030424ed80) at miner.cpp:85:7 [opt]
    frame #11: 0x000000010000dbf1 loda`Commands::mine(this=0x000000030424ef80) at commands.cpp:269:9 [opt]
    frame #12: 0x00000001000122f7 loda`dispatch(settings=Settings @ 0x000000030424f030, args=size=1) at main.cpp:157:16 [opt]
    frame #13: 0x0000000100013225 loda`main(argc=4, argv=0x000000030424f398) at main.cpp:245:3 [opt]
    frame #14: 0x000000020015641f dyld`start + 1903
(lldb) 
ckrause commented 1 year ago
(lldb) p n.value
(const int64_t) $0 = 2
(lldb) p this->value
(int64_t) $1 = 0
(lldb) 
ckrause commented 1 year ago
(lldb) p this->big
(BigNumber *) $2 = nullptr
(lldb) p n.big
(BigNumber *const) $3 = nullptr