Subject: bug#48368: closed (thanks)

From: [email-masked] (GNU bug Tracking System)
Date: Mon, 24 May 2021 12:20:02 +0000

Your bug report

#48368: eq? problem at -O2 since Guile 3.0.5

which was filed against the guile package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
48368: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=48368
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: thanks
From: Andy Wingo <[email-masked]>
To: [email-masked]
Date: Mon, 24 May 2021 14:19:22 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Fixed in 17aab66e75136cf23c7f0d4942b61d6947f98f9b.  Thanks for the
report :)

Subject: eq? problem at -O2 since Guile 3.0.5
From: Marius Bakke <[email-masked]>
To: [email-masked]
Date: Tue, 11 May 2021 22:49:19 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Hi!

I haven't been able to make a reproducer for this, but for illustrative
purposes, here is a code snippet that fails with -O2 on Guile 3.0.5 and
later (excerpt from GNU Shepherd):

  (define (run-command socket-file action service args)
    "Perform ACTION with ARGS on SERVICE, and display the result.  Connect to
  the daemon via SOCKET-FILE."
    (with-system-error-handling
     (let ((sock    (open-connection socket-file))
           (action* (if (and (eq? action 'detailed-status)
                             (memq service '(root shepherd)))
                        'status
                        action)))
       ;; Send the command.
       (write-command (shepherd-command action* service #:arguments args)
                      sock)

https://git.savannah.gnu.org/cgit/shepherd.git/tree/modules/shepherd/scripts/herd.scm#n124

At -O2, (eq? action 'detailed-status) evaluates to true no matter what
symbol ACTION holds.

Interestingly, adding (pk action*) between LET and WRITE-COMMAND gives
the expected result and mitigates the problem(!).

There are other issues that can be observed by running the Shepherd test
suite (i.e. make -j4 check).  With -O1 all pass.