1. 02 Apr, 2020 1 commit
  2. 30 Mar, 2020 1 commit
  3. 27 Mar, 2020 2 commits
  4. 26 Mar, 2020 2 commits
    • Aleksy Barcz's avatar
      fix "Conditional jump or move depends on uninitialised value" · 0d7002ac
      Aleksy Barcz authored
      + as reported by valgrind at lines draw.cpp:317 and draw.cpp:781, caused by creation of an uninitialized struct at database.cpp:400
      + fixed==false and ok==false seem like good defaults for this uninitialized struct
      0d7002ac
    • Aleksy Barcz's avatar
      draw3: use shared ptrs for DatabaseQuery everywhere · 54429849
      Aleksy Barcz authored
      + raw pointers were bug-prone, especially as there was no standard approach as to where delete them (see: database.cpp)
      + now all pointers to DatabaseQuery are shared_ptrs
      + added reset() in all places where we free a part of query anyway, so that the caller can at least check if the pointer passed to callee is still valid after return
      + added missing base_handler include to dbinquirer and fixed base_handler's includes
      54429849
  5. 24 Mar, 2020 3 commits
  6. 10 Mar, 2020 2 commits
  7. 09 Mar, 2020 2 commits
  8. 06 Mar, 2020 1 commit
  9. 05 Mar, 2020 1 commit
    • Aleksy Barcz's avatar
      better searching for SZARP configurations · e835f0b4
      Aleksy Barcz authored
      + stem() would transform /opt/szarp/szarp/foo.bar to foo, which would lead to a segfault e.g. in ekstraktor3 if we had both foo and foo.bak directories (configuration foo would be read twice, leading to some memory issues)
      + filename() is the way to go with boost::filesystem::path, it returns the last component of a path (stem() is based on filename() btw)
      e835f0b4
  10. 04 Mar, 2020 3 commits
    • Aleksy Barcz's avatar
      Revert "i2smo: add brackets as invalid chars for name" · fe839c6d
      Aleksy Barcz authored
      This reverts commit 013445da.
      
      + parentheses in param names break RPN formulas, so if we don't use a param in a RPN formula, we should be fine
      + if we use a param name containing parentheses in a RPN formula in <defined> or <drawdefinable> section, i2smo will emit and error anyway, as ipk2szarp will fail on parsing formula
      + it's not practical to enforce this rule on existing configurations as lots of params exist on existing SZARP sites and i2smo prints lots of confusing errors then
      fe839c6d
    • Aleksy Barcz's avatar
      compile with -fno-strict-aliasing · ddc92d09
      Aleksy Barcz authored
      + with -O2, -fstrict-aliasing is enabled by default, which may cause undefined behavior (since C2011) when we dereference e.g. uint16_t[4] as a double
      + avoid undefined behavior by disabling this optimisation
      + in the future it would be probably better to use standard-supported methods for conversions (to be determined)
      ddc92d09
    • Aleksy Barcz's avatar
      round instead of nearbyint · a3dd7e00
      Aleksy Barcz authored
      + more intuitive rounding mode
      a3dd7e00
  11. 18 Feb, 2020 1 commit
    • Aleksy Barcz's avatar
      draw3: don't Destroy widgets that have a parent set · 46538ec3
      Aleksy Barcz authored
      + parent should destroy the widgets
      + left calling Destroy on widgets that set their parent to NULL (setting / not setting the parent doesn't seem to follow any rule)
      + Destroy'ing led to segfault on wxUninitialize (wxAppBase::CleanUp)
      46538ec3
  12. 17 Feb, 2020 1 commit
  13. 13 Feb, 2020 1 commit
  14. 10 Feb, 2020 1 commit
    • Aleksy Barcz's avatar
      workaround for unitialized memory read on import set · 936b3617
      Aleksy Barcz authored
      + if we import a set in draw3 (from .xsd file), defcfg won't set _configId in imported params, leaving it uninitialized and leading to strange errors
      + initialize _configId to invalid value, so at worst it will fail in a more comprehensible way
      + we cannot throw from GetConfigId because of the "Caught unhandled unknown exception; terminating" wx behaviour which hides the place in code from which an exception is thrown. Overriding OnUnhandledException and OnExceptionInMainLoop in szapp (and e.g. calling abort, terminate from there) has no effect.
      + introduced a workaround in a completely different part of code than importing set, as the bug in importing set would be hard to find
      936b3617
  15. 04 Feb, 2020 2 commits
    • Aleksy Barcz's avatar
      launch query executor after all configs are loaded · 3f3418cc
      Aleksy Barcz authored
      + launch query executor as the last step of OnInit
      + this fixes a segfault when QueryExecutor tries to SetProberAddress while OnInit didn't finish loading configurations
      + probably this worked previously only because configurations loaded fast enough
      3f3418cc
    • Aleksy Barcz's avatar
      deadlock in UDIC/UDIM fix continuation · ec8d2a29
      Aleksy Barcz authored
      + follow-up of "fixed deadlock in defined initialization"
      + previous fix fixed the deadlock in one case, but not in the general case, as unfortunately there are other call-traces that lead to the deadlock
      + this fixes a sequence, where thread 1 calls UDIM::AddUserDef (acquires mutex), which calls UDIC::AddUserDef (acquires m_lock); while thread 2 calls PCIC::GetConfig (acquires m_lock), which calls UDIC::AddConfig, which calls UDIM::PopConfig (acquires mutex)
      + the general design flaw is that UDIM can call UDIC and vice versa. This is wrong and especially bug-prone when using locks.
      + this fix should fix the general case. The design flaw remains to be fixed, but now whenever UDIM calls UDIC, it does so without holding mutex (fixed both places in code where I found such a situation). So both locks are held only on the path from UDIC to UDIM and not vice versa.
      ec8d2a29
  16. 28 Jan, 2020 3 commits
  17. 22 Jan, 2020 2 commits
    • Aleksy Barcz's avatar
      libparnt: lock everything · 9ce9aa92
      Aleksy Barcz authored
      + there is a lock introduced in "Add global parser synchronous access mutex", but still draw3 segfaults on init
      + segfaults are not reproducible using valgrind, and happen in AddPar, where curr points to a badly initialized structure
      + altogether this looks very much like a multithreading issue
      + so introduce a recursive_lock, locking every single function in libparnt
      + this is extremely ugly, but it works and it doesn't slow down program start remarkably
      + a proper fix would be removing all the libparnt code and writing a new, simple, parser for szarp.cfg
      9ce9aa92
    • Aleksy Barcz's avatar
      Removed signal handlers from draw3 · 2275b41d
      Aleksy Barcz authored
      + caused deadlocks on program exit, as functions called from signal handler were not async-signal-safe (see: man signal-safety). Amongst others, malloc and pthread_join are not safe.
      + OS will cleanup our threads and db queue anyway
      + saving defined user params on exit is no longer necessary as we save them on every edit action
      + because of all the above, we can safely leave signal handling and cleanup to standard OS behavior on Linux
      2275b41d
  18. 28 Dec, 2019 1 commit
  19. 15 Dec, 2019 2 commits
  20. 11 Dec, 2019 1 commit
    • Aleksy Barcz's avatar
      ddedmn fixed build · 9a3c543f
      Aleksy Barcz authored
      + removed ifdef, which was hiding the fact that ddedmn wasn't properly built
      + fixed linking libraries
      9a3c543f
  21. 01 Dec, 2019 2 commits
  22. 19 Nov, 2019 2 commits
  23. 15 Nov, 2019 1 commit
  24. 13 Nov, 2019 1 commit
  25. 12 Nov, 2019 1 commit