]> granicus.if.org Git - graphviz/log
graphviz
2 years agogrowops: squash a -Wsign-conversion warning
Matthew Fernandez [Tue, 28 Jun 2022 01:44:18 +0000 (18:44 -0700)]
growops: squash a -Wsign-conversion warning

By construction, `newopn` can only ever be non-negative here. Though in the long
term a more sweeping change should be done to count items in `size_t` variables
pervasively.

2 years agoreallyroutespline: squash a -Wsign-conversion warning
Matthew Fernandez [Tue, 28 Jun 2022 01:42:29 +0000 (18:42 -0700)]
reallyroutespline: squash a -Wsign-conversion warning

By construction, `inpn` can only ever be non-negative here. Though in the long
term a more sweeping change should be done to count items in `size_t` variables
pervasively.

2 years agoProutespline: remove exception-style control flow
Matthew Fernandez [Tue, 28 Jun 2022 01:40:07 +0000 (18:40 -0700)]
Proutespline: remove exception-style control flow

Memory allocation failures now result in a conventional return, propagated up
through the call stack.

Github: #1801

2 years agoreallyroutespline: fix unchecked failures on recursion
Matthew Fernandez [Tue, 28 Jun 2022 01:20:24 +0000 (18:20 -0700)]
reallyroutespline: fix unchecked failures on recursion

2 years agoMerge branch 'smattr/5c305fc5-c55f-4cb9-a061-007ed0d2be2a' into 'main'
Matthew Fernandez [Sat, 2 Jul 2022 02:18:56 +0000 (02:18 +0000)]
Merge branch 'smattr/5c305fc5-c55f-4cb9-a061-007ed0d2be2a' into 'main'

use a string view abstraction to simplify plugin parsing code

See merge request graphviz/graphviz!2729

2 years agogvplugin_graph: fix unchecked allocation failures
Matthew Fernandez [Sun, 26 Jun 2022 20:28:20 +0000 (13:28 -0700)]
gvplugin_graph: fix unchecked allocation failures

The substring construction in `gvplugin_graph` unfortunately cannot be easily
converted to `strview_t` because it passes pointers to `agxset` which expects a
`'\0'` terminated string. We can at least fix previously unnoticed allocation
failures though.

2 years agogvPluginList: fix: manage 'q' as a 'strview_t'
Matthew Fernandez [Sun, 26 Jun 2022 20:22:57 +0000 (13:22 -0700)]
gvPluginList: fix: manage 'q' as a 'strview_t'

This fixes a memory leak that would occur when duplicate items were encountered.
The conditional block in this loop would not be entered and the memory that `q`
pointed to would be lost in the next iteration of the loop when `q` was set to a
new string.

2 years agogvPluginList: fix unchecked allocation failure
Matthew Fernandez [Sun, 26 Jun 2022 20:18:46 +0000 (13:18 -0700)]
gvPluginList: fix unchecked allocation failure

When `strdup` failed to allocate memory, this would go unnoticed, leading to a
crash.

2 years agogvPluginList: use a 'strview_t' for 'typestr_last'
Matthew Fernandez [Sun, 26 Jun 2022 20:16:34 +0000 (13:16 -0700)]
gvPluginList: use a 'strview_t' for 'typestr_last'

This has no immediate effect, but will simply the next commit.

2 years agogvPluginList: squash -Wunused-parameter warning
Matthew Fernandez [Sun, 26 Jun 2022 20:09:17 +0000 (13:09 -0700)]
gvPluginList: squash -Wunused-parameter warning

As described in the leading comment, this is intentionally unused for now.

2 years agogvplugin_list: use a 'strview_t' for 'type' in second loop
Matthew Fernandez [Sun, 26 Jun 2022 20:08:05 +0000 (13:08 -0700)]
gvplugin_list: use a 'strview_t' for 'type' in second loop

Slightly more readable and less error prone than doing this inline.

2 years agogvplugin_list: use a 'strview_t' for 'type_last'
Matthew Fernandez [Sun, 26 Jun 2022 20:03:21 +0000 (13:03 -0700)]
gvplugin_list: use a 'strview_t' for 'type_last'

Slightly more readable and less error prone than doing this inline.

2 years agogvplugin_list: use a 'strview_t' for handling prefix of 'str'
Matthew Fernandez [Sun, 26 Jun 2022 19:58:01 +0000 (12:58 -0700)]
gvplugin_list: use a 'strview_t' for handling prefix of 'str'

Slightly more readable and less error prone than doing this inline.

2 years agogvplugin_list: use a 'strview_t' for 'type' in first loop
Matthew Fernandez [Sun, 26 Jun 2022 19:47:04 +0000 (12:47 -0700)]
gvplugin_list: use a 'strview_t' for 'type' in first loop

Slightly more readable and less error prone than doing this inline.

2 years agogvplugin_load: use a 'strview_t' for 'reqtyp'
Matthew Fernandez [Sun, 26 Jun 2022 19:41:02 +0000 (12:41 -0700)]
gvplugin_load: use a 'strview_t' for 'reqtyp'

Slightly more readable and less error prone than doing this inline.

2 years agogvplugin_load: use a 'strview_t' for 'typ'
Matthew Fernandez [Sun, 26 Jun 2022 19:02:15 +0000 (12:02 -0700)]
gvplugin_load: use a 'strview_t' for 'typ'

Slightly more readable and less error prone than doing this inline.

2 years agogvplugin_load: use a 'strview_t' for 'reqdep'
Matthew Fernandez [Sun, 26 Jun 2022 18:58:06 +0000 (11:58 -0700)]
gvplugin_load: use a 'strview_t' for 'reqdep'

Slightly more readable and less error prone than doing this inline.

2 years agogvplugin_load: use a 'strview_t' for 'dep'
Matthew Fernandez [Sun, 26 Jun 2022 19:19:25 +0000 (12:19 -0700)]
gvplugin_load: use a 'strview_t' for 'dep'

Similar to the previous commit, this string is either `NULL` or terminated by a
`'\0'`, so there is little advantage in using a `strview_t` over a
`const char*`. But this will make it more consistent with surrounding code after
upcoming changes.

2 years agogvplugin_load: use a 'strview_t' for 'reqpkg'
Matthew Fernandez [Sun, 26 Jun 2022 19:10:34 +0000 (12:10 -0700)]
gvplugin_load: use a 'strview_t' for 'reqpkg'

This string is always terminated by `'\0'`, not `':'`, so there is little
advantage in using a `strview_t` over a `const char*`. But upcoming changes will
refactor the surrounding code to use `strview_t`, so it will be more readable to
use `strview_t` consistently here.

2 years agogvplugin_install: use 'strview_t' to simplify second type string comparison loop
Matthew Fernandez [Sun, 26 Jun 2022 18:46:16 +0000 (11:46 -0700)]
gvplugin_install: use 'strview_t' to simplify second type string comparison loop

2 years agogvplugin_install: use 'strview_t' to simplify type string comparison loop
Matthew Fernandez [Sun, 26 Jun 2022 18:40:13 +0000 (11:40 -0700)]
gvplugin_install: use 'strview_t' to simplify type string comparison loop

2 years agogvplugin_install: refactor 'typestr' end locating logic to use a 'strview_t'
Matthew Fernandez [Sun, 26 Jun 2022 18:24:17 +0000 (11:24 -0700)]
gvplugin_install: refactor 'typestr' end locating logic to use a 'strview_t'

Slightly more readable and less error prone than doing this inline.

2 years agoadd an abstraction for string references
Matthew Fernandez [Sun, 26 Jun 2022 18:01:38 +0000 (11:01 -0700)]
add an abstraction for string references

2 years agoMerge branch 'smattr/4C27B32D-9DA4-4AE8-846A-42EC6F6422C4' into 'main'
Matthew Fernandez [Sat, 2 Jul 2022 00:12:24 +0000 (00:12 +0000)]
Merge branch 'smattr/4C27B32D-9DA4-4AE8-846A-42EC6F6422C4' into 'main'

compiler warning squashing

See merge request graphviz/graphviz!2730

2 years agorecordlintrsx: remove unused 'xlp' parameter
Matthew Fernandez [Sun, 26 Jun 2022 22:54:39 +0000 (15:54 -0700)]
recordlintrsx: remove unused 'xlp' parameter

2 years agorecordointrsx: remove unused 'xlp' parameter
Matthew Fernandez [Sun, 26 Jun 2022 22:53:00 +0000 (15:53 -0700)]
recordointrsx: remove unused 'xlp' parameter

2 years agostress_majorization_with_hierarchy: remove unused 'nedges_graph' parameter
Matthew Fernandez [Sun, 26 Jun 2022 22:48:38 +0000 (15:48 -0700)]
stress_majorization_with_hierarchy: remove unused 'nedges_graph' parameter

2 years agostress_majorization_kD_mkernel: remove unused 'nedges_graph' parameter
Matthew Fernandez [Sun, 26 Jun 2022 22:43:35 +0000 (15:43 -0700)]
stress_majorization_kD_mkernel: remove unused 'nedges_graph' parameter

2 years agosparse_stress_subspace_majorization_kD: remove unused 'nedges_graph' parameter
Matthew Fernandez [Sun, 26 Jun 2022 22:39:04 +0000 (15:39 -0700)]
sparse_stress_subspace_majorization_kD: remove unused 'nedges_graph' parameter

2 years agoprototype 'makeTetrix', squashing a '-Wmissing-prototypes' warning
Matthew Fernandez [Sat, 25 Jun 2022 05:05:31 +0000 (22:05 -0700)]
prototype 'makeTetrix', squashing a '-Wmissing-prototypes' warning

The missing prototype appears to have two causes:

  1. 265eeb66ea0dbb4f7cdeb75dcc5f802d948b40a9 added `makeTetrix` without a
     prototype.

  2. b4947d67a4ebd48ca0105d44f92e47f044e51600 appears to have applied some
     Coverity suggestions without investigating the underlying history that led
     to the Coverity warnings.

2 years agoMerge branch 'smattr/gitlab-121' into 'main'
Matthew Fernandez [Sun, 26 Jun 2022 22:32:00 +0000 (22:32 +0000)]
Merge branch 'smattr/gitlab-121' into 'main'

fix 'merge_chain' assertion failure

Closes #121

See merge request graphviz/graphviz!2724

2 years agofix 'merge_chain' assertion failure
Matthew Fernandez [Tue, 21 Jun 2022 03:09:05 +0000 (20:09 -0700)]
fix 'merge_chain' assertion failure

When calling `merge_chain` from `interclexp`, this code apparently did not
anticipate that both the condition `ND_rank(agtail(e)) == ND_rank(aghead(e))`
and `ED_to_virt(prev) != NULL` could be true at once. In this case, the merge
can happen but the `.to_virt` member of `e` needs to be overwritten; it is not
`NULL` on entry to `merge_chain`.

This issue appears to have existed since the first revision of Graphviz.

These is a lot of uncertainty around what the expected behavior of this code is
and whether this fix is correct. So here is some of my background thoughts:¹

  `merge_chain` has a leading `assert(ED_to_virt(e) == NULL)`, presumably trying
  to express the assumption that it is not overwriting an existing back pointer.
  But the code here in `interclexp` seems to be deliberately trying to overwrite
  this pointer. There seemed to me two possible local fixes:

    1. Remove the assertion
    2. Write `NULL` to `ED_to_virt(e)` in advance

  The first possibility seemed more risky. This would allow other functions to
  accidentally call into merge_chain with a non-null `ED_to_virt(e)` and for
  this to go undetected.

  On the other hand, it's possible my change here is mistaken and what the
  original author intended was for the true case of the branch on line 181 to
  continue after updating `ED_to_virt(e) = prev`, making the call to
  `merge_chain` not reached in this scenario. It certainly looks pretty weird
  for the code after my changes to set `ED_to_virt(e)` on lines 181-184 and then
  subsequently overwrite this value on line 187. But I was guessing the initial
  write is relevant for the case where we continue.

  As you can tell, all of this is (barely) educated guess work. I find the
  intent of this code very hard to determine.

Gitlab: fixes #121

¹ Quoted from discussion on
  https://gitlab.com/graphviz/graphviz/-/merge_requests/2724#note_1005393861.

2 years agoadd a test case for #121
Matthew Fernandez [Tue, 21 Jun 2022 02:49:12 +0000 (19:49 -0700)]
add a test case for #121

2 years agoMerge branch 'smattr/6888df1f-aa29-4ebf-8fd1-824cdf74cbee' into 'main'
Matthew Fernandez [Sun, 26 Jun 2022 19:01:07 +0000 (19:01 +0000)]
Merge branch 'smattr/6888df1f-aa29-4ebf-8fd1-824cdf74cbee' into 'main'

fix: select DEB CPack back end on Debian

See merge request graphviz/graphviz!2728

2 years agofix: select DEB CPack back end on Debian
Matthew Fernandez [Sat, 25 Jun 2022 20:54:18 +0000 (13:54 -0700)]
fix: select DEB CPack back end on Debian

Debian’s /etc/os-release does not include the field `ID_LIKE`, which is perhaps
reasonable as it is a base distribution not derived from another. A side effect
of this was that CPack picked the RPM back end when generating a Graphviz
package. This change teaches it that Debian should also get the DEB back end.

2 years agoMerge branch 'smattr/14413CBC-E9B9-4119-B46C-D234278D8A87' into 'main'
Matthew Fernandez [Sun, 26 Jun 2022 00:12:04 +0000 (00:12 +0000)]
Merge branch 'smattr/14413CBC-E9B9-4119-B46C-D234278D8A87' into 'main'

gvplugin_list: remove dynamic allocations

See merge request graphviz/graphviz!2727

2 years agogvplugin_list: remove a second unnecessary duplication of 'typestr'
Matthew Fernandez [Sat, 25 Jun 2022 02:55:12 +0000 (19:55 -0700)]
gvplugin_list: remove a second unnecessary duplication of 'typestr'

By managing an extent into the original string, we can avoid a dynamic
allocation in this code. This is similar in spirit to
5a13ab3f08b2066a795ea152f9594f6719d3aaa6.

2 years agogvplugin_list: remove unnecessary duplication of 'typestr'
Matthew Fernandez [Sat, 25 Jun 2022 02:32:42 +0000 (19:32 -0700)]
gvplugin_list: remove unnecessary duplication of 'typestr'

By managing an extent into the original string, we can avoid a dynamic
allocation in this code. This is similar in spirit to
5a13ab3f08b2066a795ea152f9594f6719d3aaa6.

The code here actually looks wrong. It tries to pull out colon-separated
entries, but then uses the full string (`pnext->typestr`) in the call to
`agxbprint`. But this commit leaves this as-is for now.

2 years agogvplugin_list: remove unnecessary duplication of 'str'
Matthew Fernandez [Fri, 24 Jun 2022 14:20:09 +0000 (07:20 -0700)]
gvplugin_list: remove unnecessary duplication of 'str'

By managing an extent into the original string, we can avoid a dynamic
allocation in this code. This is similar in spirit to
5a13ab3f08b2066a795ea152f9594f6719d3aaa6.

2 years agogvplugin_package_record: replace unchecked 'strdup' with alloc wrapper
Matthew Fernandez [Fri, 24 Jun 2022 14:13:41 +0000 (07:13 -0700)]
gvplugin_package_record: replace unchecked 'strdup' with alloc wrapper

This turns what was previously a crash on out-of-memory into a graceful exit.

2 years agopango_free_layout: remove unnecessary cast
Matthew Fernandez [Fri, 24 Jun 2022 13:52:59 +0000 (06:52 -0700)]
pango_free_layout: remove unnecessary cast

2 years agoMerge branch 'smattr/gitlab-2093' into 'main'
Matthew Fernandez [Sat, 25 Jun 2022 22:30:54 +0000 (22:30 +0000)]
Merge branch 'smattr/gitlab-2093' into 'main'

gxl2gv: fix: anticipate elements with missing ID

Closes #2093

See merge request graphviz/graphviz!2726

2 years agogxl2gv: fix: anticipate elements with missing ID
Matthew Fernandez [Thu, 23 Jun 2022 04:52:47 +0000 (21:52 -0700)]
gxl2gv: fix: anticipate elements with missing ID

This fixes a previous out-of-bounds pointer dereference that occurred in
`startElementHandler`.

Gitlab: fixes #2093

2 years agoadd a test case for #2093
Matthew Fernandez [Thu, 23 Jun 2022 04:38:08 +0000 (21:38 -0700)]
add a test case for #2093

2 years agoMerge branch 'smattr/AA253658-5B4E-4DDA-AD36-EB16ABD0699A' into 'main'
Matthew Fernandez [Sat, 25 Jun 2022 20:46:39 +0000 (20:46 +0000)]
Merge branch 'smattr/AA253658-5B4E-4DDA-AD36-EB16ABD0699A' into 'main'

ortho: use 'UNUSED' to suppress warnings about debug functions

See merge request graphviz/graphviz!2688

2 years agoortho: use 'UNUSED' to suppress warnings about debug functions
Matthew Fernandez [Sun, 22 May 2022 00:36:50 +0000 (17:36 -0700)]
ortho: use 'UNUSED' to suppress warnings about debug functions

As an alternative to hiding these functions by guarding them with `DEBUG`, this
allows the compiler to see and parse these functions even when not building in
debug mode. This means we can catch syntax errors that slip into this code even
when it is not being emitted into the final binary.

This has little effect right now as debugging is forced on in this file, but
this may be a nice extra safe guard in future.

2 years agocgraph: add an abstraction for squashing unused symbol warnings
Matthew Fernandez [Sun, 22 May 2022 00:27:12 +0000 (17:27 -0700)]
cgraph: add an abstraction for squashing unused symbol warnings

2 years agoMerge branch 'smattr/gitlab-2227' into 'main'
Matthew Fernandez [Sat, 25 Jun 2022 19:33:20 +0000 (19:33 +0000)]
Merge branch 'smattr/gitlab-2227' into 'main'

CI: install librsvg on macOS

See merge request graphviz/graphviz!2723

2 years agoCI: install librsvg on macOS
Matthew Fernandez [Tue, 21 Jun 2022 00:50:58 +0000 (17:50 -0700)]
CI: install librsvg on macOS

This is a dependency of the rsvg plugin.

Gitlab: #2227

2 years agoMerge branch 'smattr/gitlab-1624' into 'main'
Matthew Fernandez [Sat, 25 Jun 2022 17:51:45 +0000 (17:51 +0000)]
Merge branch 'smattr/gitlab-1624' into 'main'

test case for #1624 and warning squashing

See merge request graphviz/graphviz!2725

2 years agonameOf: remove unnecessary cast
Matthew Fernandez [Wed, 22 Jun 2022 03:40:00 +0000 (20:40 -0700)]
nameOf: remove unnecessary cast

2 years agoremove unnecessary 'dtlink' casts
Matthew Fernandez [Wed, 22 Jun 2022 03:39:44 +0000 (20:39 -0700)]
remove unnecessary 'dtlink' casts

2 years agocommon: remove some unnecessary parens
Matthew Fernandez [Wed, 22 Jun 2022 03:32:16 +0000 (20:32 -0700)]
common: remove some unnecessary parens

2 years agouse_library: squash -Wsign-conversion warning
Matthew Fernandez [Wed, 22 Jun 2022 03:05:00 +0000 (20:05 -0700)]
use_library: squash -Wsign-conversion warning

2 years agoglobal_def: squash a -Wsign-conversion
Matthew Fernandez [Wed, 22 Jun 2022 03:00:58 +0000 (20:00 -0700)]
global_def: squash a -Wsign-conversion

`p` is guaranteed to be greater than or equal to `dcl` here.

2 years agoadd a test case for #1624
Matthew Fernandez [Wed, 22 Jun 2022 02:38:30 +0000 (19:38 -0700)]
add a test case for #1624

2 years agoMerge branch 'update-how-to-make-a-release-in-DEVELOPERS.md' into 'main'
Magnus Jacobsson [Sat, 25 Jun 2022 13:32:04 +0000 (13:32 +0000)]
Merge branch 'update-how-to-make-a-release-in-DEVELOPERS.md' into 'main'

Update how to make a release in DEVELOPERS.md

See merge request graphviz/graphviz!2711

2 years agoupdate "Updating the website" in DEVELOPERS.md
Magnus Jacobsson [Sun, 29 May 2022 11:07:10 +0000 (13:07 +0200)]
update "Updating the website" in DEVELOPERS.md

2 years agoupdate "Starting development of the next version" in DEVELOPERS.md
Magnus Jacobsson [Sun, 29 May 2022 09:04:49 +0000 (11:04 +0200)]
update "Starting development of the next version" in DEVELOPERS.md

The "returning to the development series" wording was a remnant from
when stable releases had even minor versions and development versions
had odd minor versions. There no longer are different stable and
development series so there's nothing to return to. We always go
forward. The development versions have the same version number as the
tentative next stable release version, with a ~dev suffix.

2 years agoMerge branch 'smattr/gitlab-2200' into 'main'
Matthew Fernandez [Sat, 25 Jun 2022 04:02:52 +0000 (04:02 +0000)]
Merge branch 'smattr/gitlab-2200' into 'main'

CI: make UBSan errors fatal in sanitizer job

Closes #2200

See merge request graphviz/graphviz!2722

2 years agoRevert "Add use_santizers option to CMake build"
Matthew Fernandez [Sun, 19 Jun 2022 21:52:00 +0000 (14:52 -0700)]
Revert "Add use_santizers option to CMake build"

This reverts commit 05cbff4882df91d1b05a498b3b664061aefd3fce. Given this CMake
option does not work on all platforms (e.g. it adds compiler options that will
error out when using MSVC) and has inconsistent effects on supported platforms
(e.g. it enables leak detection on Linux, but not on macOS), it seems safer to
admit we cannot abstract over this feature and remove it from the build system.
Users who want to enable sanitizers can still do this selectively and with
greater control by exporting `CFLAGS` and `CXXFLAGS` or by using the
`CMAKE_C_FLAGS` and `CMAKE_CXX_FLAGS` to add toolchain-specific options.

Gitlab: #2200

2 years agoCI: make UBSan errors fatal in sanitizer job
Matthew Fernandez [Sun, 19 Jun 2022 16:15:55 +0000 (09:15 -0700)]
CI: make UBSan errors fatal in sanitizer job

When enabling ASan and UBSan, ASan defaults to aborting execution on a detected
error while UBSan defaults to a warning and then continuing. The effect of this
is that any UBSan issues go unnoticed in CI when no one is monitoring stderr.
This change makes UBSan issues also have abort behavior.

Gitlab: fixes #2200

2 years agoexit when rectangle area computation overflows
Matthew Fernandez [Sun, 19 Jun 2022 21:42:07 +0000 (14:42 -0700)]
exit when rectangle area computation overflows

Continuing in the face of an overflow when calculating rectangle area was sort
of pointless. The test case for #1906 is an example of this, that runs for many
minutes _repeatedly_ detecting overflows in this code before finally erroring
out when trying to do follow on layout with values that make no sense. It is
simpler and cheaper to just error out immediately when this happens.

Gitlab: #1906

2 years agofix integer overflow in ordering function
Matthew Fernandez [Sun, 19 Jun 2022 21:38:37 +0000 (14:38 -0700)]
fix integer overflow in ordering function

The test case for #1906 triggers an overflow in this function, viewable with
UBSan:

  $ dot -Kirco -Tgv -o /dev/null tests/graphs/root.gv
  /builds/graphviz/graphviz/lib/label/xlabels.c:35:15: runtime error: signed
    integer overflow: -1884993080 - 1219985688 cannot be represented in type
    'int'

Gitlab: #1906

2 years agoCI: include a stack trace on UBSan failures
Matthew Fernandez [Sun, 19 Jun 2022 21:14:54 +0000 (14:14 -0700)]
CI: include a stack trace on UBSan failures

2 years agoCI: manage ASan, UBSan enabling through env instead of 'use_sanitizers'
Matthew Fernandez [Sun, 19 Jun 2022 05:00:09 +0000 (22:00 -0700)]
CI: manage ASan, UBSan enabling through env instead of 'use_sanitizers'

This will allow us more precise control over compiler flags. Managing these
through CMake settings is challenging when enabling these is toolchain dependent
(e.g. the existing `use_sanitizers` option does not work with MSVC) and
operating system dependent (e.g. ASan leak detection is enabled by default on
Linux but not on macOS).

Gitlab: #2200

2 years agoMerge branch 'smattr/gitlab-827' into 'main'
Matthew Fernandez [Thu, 23 Jun 2022 04:59:21 +0000 (04:59 +0000)]
Merge branch 'smattr/gitlab-827' into 'main'

fix: anticipate non-normal edges during path construction

Closes #827

See merge request graphviz/graphviz!2719

2 years agofix: anticipate non-normal edges during path construction
Matthew Fernandez [Sat, 18 Jun 2022 22:23:41 +0000 (15:23 -0700)]
fix: anticipate non-normal edges during path construction

When constructing a path, the `beginpath` and `endpath` functions assumed they
could follow a chain of `.to_orig` back pointers to eventually reach a normal
edge. However this is not necessarily true, a situation exemplified by
tests/graphs/b15.gv that caused these traversal loops to eventually reach the
start of this linked list and then dereference a null pointer.

The fix in this commit is to simply treat the head of the list as the original
edge if we have not encountered a normal edge before then. Whether this is
correct or not seems unimportant, as a graph that causes this scenario is
incorrect. This change turns a crash during path construction into a graceful
exit later when the lack of normal edges is discovered.

This fix has similarities with 84e468e775e1d1b293624f1c8e70c226eb4a6e41. Perhaps
the code base should be audited for all such traversal loops, which seem to have
been written prior to a time when constructing a non-normal-edge-containing list
became possible.

Gitlab: fixes #827

2 years agobeginpath: remove an unnecessary cast
Matthew Fernandez [Sat, 18 Jun 2022 22:22:52 +0000 (15:22 -0700)]
beginpath: remove an unnecessary cast

2 years agoendpath: remove parens and dereferences of function pointer
Matthew Fernandez [Sat, 18 Jun 2022 22:22:01 +0000 (15:22 -0700)]
endpath: remove parens and dereferences of function pointer

The compiler knows how to do this without needing to be explicitly told.

2 years agobeginpath: remove parens and dereferences of function pointer
Matthew Fernandez [Sat, 18 Jun 2022 22:21:26 +0000 (15:21 -0700)]
beginpath: remove parens and dereferences of function pointer

The compiler knows how to do this without needing to be explicitly told.

2 years agomake_regular_edge: remove some unnecessary parens
Matthew Fernandez [Sat, 18 Jun 2022 22:21:01 +0000 (15:21 -0700)]
make_regular_edge: remove some unnecessary parens

2 years agoadd a test case for b15.gv crash
Matthew Fernandez [Sat, 18 Jun 2022 22:05:05 +0000 (15:05 -0700)]
add a test case for b15.gv crash

Unfortunately the xfail in this commit cannot be marked `strict=True` because
the ASan CI job turns the deterministic crash of this test case into a
`exit(1)`.

Gitlab: #827

2 years agoMerge branch 'smattr/gitlab-1285' into 'main'
Matthew Fernandez [Wed, 22 Jun 2022 04:40:47 +0000 (04:40 +0000)]
Merge branch 'smattr/gitlab-1285' into 'main'

fix: use '-module -avoid-version' when compiling TCL packages

Closes #1285

See merge request graphviz/graphviz!2718

2 years agofix: use '-module -avoid-version' when compiling TCL packages
Matthew Fernandez [Fri, 17 Jun 2022 03:36:56 +0000 (20:36 -0700)]
fix: use '-module -avoid-version' when compiling TCL packages

Quoting from #1285:

  They are runtime loadable (dlopen, or equivalent, from tcl program, via
  'load') rather than shared libraries for dynamic linking by others. On OS X,
  these two concepts have different extensions (.so vs .dylib). It's confusing
  when a runtime-loadable module has a dynamic-linker extension. In commit
  40123aedcd2761e98d8c9917be6040ea6187c97f, the -module flag was added to
  LDFLAGS in tclpkg/gv/Makefile.am, which fixes libgv_tcl.
  Could the same change be applied to the other tclpkg/*/Makefile.am LDFLAGS?

Gitlab: fixes #1285
Suggested-by: Daniel Macks
2 years agoMerge branch 'smattr/gitlab-146' into 'main'
Matthew Fernandez [Wed, 22 Jun 2022 03:03:08 +0000 (03:03 +0000)]
Merge branch 'smattr/gitlab-146' into 'main'

fix: in SVG output, set opacity 0 for text with 0 alpha value

Closes #146

See merge request graphviz/graphviz!2717

2 years agofix: in SVG output, set opacity 0 for text with 0 alpha value
Matthew Fernandez [Fri, 17 Jun 2022 00:32:08 +0000 (17:32 -0700)]
fix: in SVG output, set opacity 0 for text with 0 alpha value

Gitlab: fixes #146

2 years agoadd a test case for lacking transparency in SVG text
Matthew Fernandez [Fri, 17 Jun 2022 00:20:10 +0000 (17:20 -0700)]
add a test case for lacking transparency in SVG text

Gitlab: #146

2 years agoMerge branch 'smattr/gitlab-1979' into 'main'
Matthew Fernandez [Wed, 22 Jun 2022 01:51:24 +0000 (01:51 +0000)]
Merge branch 'smattr/gitlab-1979' into 'main'

fix: include Windows links in deployment-produced JSON

Closes #1979

See merge request graphviz/graphviz!2720

2 years agofix: include Windows links in deployment-produced JSON
Matthew Fernandez [Sun, 19 Jun 2022 04:06:23 +0000 (21:06 -0700)]
fix: include Windows links in deployment-produced JSON

This is a second attempt at 6117abe680037824d134149b0de42f589fb24466. It seems
the previous attempt did not account for the fact that the source path of an
artifact has not yet been safely escaped into a filename and contains directory
separators (`/`). This change was made by studying the last deploy.py execution
logs and making a best guess. There is no easy way to test this other than
running the release deployment process, so we should do one soon to validate
this.

Gitlab: fixes #1979 (I hope)

2 years agoCI: abbreviate chmod during deployment
Matthew Fernandez [Sun, 19 Jun 2022 03:58:17 +0000 (20:58 -0700)]
CI: abbreviate chmod during deployment

2 years agoMerge branch 'smattr/3e19ec8a-a29e-485f-b185-64f7fb406302' into 'main'
Matthew Fernandez [Wed, 22 Jun 2022 00:52:41 +0000 (00:52 +0000)]
Merge branch 'smattr/3e19ec8a-a29e-485f-b185-64f7fb406302' into 'main'

avoid dynamic allocation of token buffer during style parsing

See merge request graphviz/graphviz!2721

2 years agodefault_pencolor: use 'size_t' when representing the length of strings
Matthew Fernandez [Sun, 19 Jun 2022 17:32:52 +0000 (10:32 -0700)]
default_pencolor: use 'size_t' when representing the length of strings

Squashes 3 -Wconversion compiler warnings.

2 years agodefault_pencolor: fix comment typo
Matthew Fernandez [Sun, 19 Jun 2022 17:30:01 +0000 (10:30 -0700)]
default_pencolor: fix comment typo

2 years agoemit_xdot: squash a -Wswitch-default warning
Matthew Fernandez [Sun, 19 Jun 2022 17:28:16 +0000 (10:28 -0700)]
emit_xdot: squash a -Wswitch-default warning

This switch is exhaustive.

2 years agoselectedLayer: rephrase a switch into if-else
Matthew Fernandez [Sun, 19 Jun 2022 17:24:19 +0000 (10:24 -0700)]
selectedLayer: rephrase a switch into if-else

This is easier to understand, less code, and squashes a -Wswitch-default
compiler warning.

2 years agocommon: squash 2 -Wundef compiler warnings
Matthew Fernandez [Sun, 19 Jun 2022 17:08:54 +0000 (10:08 -0700)]
common: squash 2 -Wundef compiler warnings

2 years agoavoid dynamic allocation of token buffer during style parsing
Matthew Fernandez [Sun, 19 Jun 2022 16:54:29 +0000 (09:54 -0700)]
avoid dynamic allocation of token buffer during style parsing

The style parsing code repeatedly calls `style_token` to tokenize input. It was
extracting the token into a dynamic buffer, `xb`. However, this is unnecessary.
Instead we can yield tokens as base and offset into the original input string,
avoiding heap allocation altogether.

It is possible this approach could be pushed “outwards,” applying the same
optimization to construction of the style itself that is returned by
`parse_style`. This would remove what the leading comment describes as “one of
the worst internal designs in graphviz.” However, this would be an API break,
and a pretty subtle one. The style buffer of `'\0'` separated strings is
available to plugins and applications in the GVC `.rawstyle` field. Altering
how this field represents the style could lead to uncaught and confusing
downstream problems. If this kind of change is done in future, I would recommend
renaming the field entirely to make any external uses break loudly at
compilation time.

2 years agoMerge branch 'smattr/20D1B54B-E878-4154-B54F-D1EC764E5FEF' into 'main'
Magnus Jacobsson [Sat, 18 Jun 2022 15:40:19 +0000 (15:40 +0000)]
Merge branch 'smattr/20D1B54B-E878-4154-B54F-D1EC764E5FEF' into 'main'

label: dead code clean up

See merge request graphviz/graphviz!2708

2 years agolabel: remove unused 'METHODS'
Matthew Fernandez [Sat, 7 May 2022 18:17:33 +0000 (11:17 -0700)]
label: remove unused 'METHODS'

2 years agolabel: remove unused 'ListNode_t'
Matthew Fernandez [Sat, 7 May 2022 18:15:11 +0000 (11:15 -0700)]
label: remove unused 'ListNode_t'

2 years agolabel: remove unused 'RTree' timing members
Matthew Fernandez [Sat, 7 May 2022 18:13:56 +0000 (11:13 -0700)]
label: remove unused 'RTree' timing members

2 years agolabel: remove unused 'rtp' parameter to 'RTreeNewIndex'
Matthew Fernandez [Sat, 28 May 2022 17:31:54 +0000 (10:31 -0700)]
label: remove unused 'rtp' parameter to 'RTreeNewIndex'

2 years agolabel: remove unused 'rtp' parameter to 'RTreeNewNode'
Matthew Fernandez [Sat, 28 May 2022 17:30:24 +0000 (10:30 -0700)]
label: remove unused 'rtp' parameter to 'RTreeNewNode'

2 years agolabel: remove unused 'RTree' statistics
Matthew Fernandez [Sat, 7 May 2022 18:11:55 +0000 (11:11 -0700)]
label: remove unused 'RTree' statistics

The documentation for this was also inaccurate; `SeTouchCount` was manipulated
even when `StatFlag` was unsett.

2 years agolabel: remove unused 'RTree.Deleting'
Matthew Fernandez [Sat, 7 May 2022 18:06:02 +0000 (11:06 -0700)]
label: remove unused 'RTree.Deleting'

2 years agolabel: remove unused 'RTree.*LeafCount' tracking
Matthew Fernandez [Sat, 7 May 2022 18:03:16 +0000 (11:03 -0700)]
label: remove unused 'RTree.*LeafCount' tracking

2 years agolabel: remove now unused 'RTreeFreeNode'
Matthew Fernandez [Sat, 7 May 2022 18:01:41 +0000 (11:01 -0700)]
label: remove now unused 'RTreeFreeNode'

2 years agolabel: remove unused 'RTreeDelete'
Matthew Fernandez [Sat, 7 May 2022 17:59:40 +0000 (10:59 -0700)]
label: remove unused 'RTreeDelete'

2 years agoMerge branch 'smattr/159E7054-9634-48DB-B9A0-C3F5FBCD8382' into 'main'
Matthew Fernandez [Thu, 16 Jun 2022 15:51:04 +0000 (15:51 +0000)]
Merge branch 'smattr/159E7054-9634-48DB-B9A0-C3F5FBCD8382' into 'main'

CI: remove Fedora 34 jobs

See merge request graphviz/graphviz!2716