EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  <20202021  2022  2023  2024  Index 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  <20202021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: [Bug 1858467] [NEW] dbExpand.pl outputs records in non-deterministic order
From: Ben Franksen via Core-talk <[email protected]>
To: [email protected]
Date: Mon, 06 Jan 2020 17:44:12 -0000
Public bug reported:

This concerns only the 7.0 branch since in 3.15 there is no dbExpand.pl.

The observed non-determinism makes it hard to compare (diff) generated
db files if DB_OPT has been set in a Makefile.

The solution is simple, at the cost of making the procedure slightly
less efficient:

diff --git a/modules/database/src/tools/DBD/Output.pm b/modules/database/src/tools/DBD/Output.pm
index 869b485..55051df 100644
--- a/modules/database/src/tools/DBD/Output.pm
+++ b/modules/database/src/tools/DBD/Output.pm
@@ -118,8 +118,7 @@ sub OutputBreaktables {
 
 sub OutputRecords {
     my ($out, $records) = @_;
-    foreach my $name (sort(keys %$records)) {
-        my $rec = $records->{$name};
+    while (my ($name, $rec) = each %{$records}) {
         next if $name ne $rec->name; # Alias
         printf $out "record(%s, \"%s\") {\n", $rec->recordtype->name, $name;
         printf $out "    alias(\"%s\")\n", $_

Note: other output routines inside this module are similarly non-
deterministic in their output, but they are not used by dbExpand.pl.

** Affects: epics-base
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of EPICS
Core Developers, which is subscribed to EPICS Base.
Matching subscriptions: epics-core-list-subscription
https://bugs.launchpad.net/bugs/1858467

Title:
  dbExpand.pl outputs records in non-deterministic order

Status in EPICS Base:
  New

Bug description:
  This concerns only the 7.0 branch since in 3.15 there is no
  dbExpand.pl.

  The observed non-determinism makes it hard to compare (diff) generated
  db files if DB_OPT has been set in a Makefile.

  The solution is simple, at the cost of making the procedure slightly
  less efficient:

  diff --git a/modules/database/src/tools/DBD/Output.pm b/modules/database/src/tools/DBD/Output.pm
  index 869b485..55051df 100644
  --- a/modules/database/src/tools/DBD/Output.pm
  +++ b/modules/database/src/tools/DBD/Output.pm
  @@ -118,8 +118,7 @@ sub OutputBreaktables {
   
   sub OutputRecords {
       my ($out, $records) = @_;
  -    foreach my $name (sort(keys %$records)) {
  -        my $rec = $records->{$name};
  +    while (my ($name, $rec) = each %{$records}) {
           next if $name ne $rec->name; # Alias
           printf $out "record(%s, \"%s\") {\n", $rec->recordtype->name, $name;
           printf $out "    alias(\"%s\")\n", $_

  Note: other output routines inside this module are similarly non-
  deterministic in their output, but they are not used by dbExpand.pl.

To manage notifications about this bug go to:
https://bugs.launchpad.net/epics-base/+bug/1858467/+subscriptions

Replies:
[Bug 1858467] Re: dbExpand.pl outputs records in non-deterministic order mdavidsaver via Core-talk

Navigate by Date:
Prev: Build failed: epics-base base-integration-385 AppVeyor via Core-talk
Next: Build failed: EPICS Base base-7.0-511 AppVeyor via Core-talk
Index: 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  <20202021  2022  2023  2024 
Navigate by Thread:
Prev: Build failed: epics-base base-integration-385 AppVeyor via Core-talk
Next: Re: [Bug 1858467] Re: dbExpand.pl outputs records in non-deterministic order Ben Franksen via Core-talk
Index: 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  <20202021  2022  2023  2024 
ANJ, 24 May 2020 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·