Re: bug in ghci module loading post 9.12.4?

Tom Smeding <[email protected]> Tue, 30 Jun 2026 16:27:20 +0100
Newsgroups gmane.comp.lang.haskell.cafe
Message-ID <[email protected]>
This is a multi-part message in MIME format.
--===============5021918542784521416==
Content-Type: multipart/alternative;
 boundary="------------fLPEs0GbqppTKYMq1IKOYTRm"
Content-Language: en-GB

This is a multi-part message in MIME format.
--------------fLPEs0GbqppTKYMq1IKOYTRm
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

An essential component of the reproducer is that you close ghci after 
the first :load (which serves only to generate the .o files) and reopen 
it without -fobject-code, so that the reload of BugA turns it into an 
interpreted module.

On 30/06/2026 13:53, George Colpitts wrote:
> fwiw I can't duplicate on MacOS 26.5.2 and ghc 9.12.5 rc2:
>
>  ghci -fobject-code
> Loaded package environment from 
> /Users/gcolpitts/.ghc/aarch64-darwin-9.12.4.20260614/environments/default
> GHCi, version 9.12.4.20260614: https://www.haskell.org/ghc/  :? for help
> Loaded GHCi configuration from /Users/gcolpitts/.ghci
> λ> :load BugC
> [1 of 3] Compiling BugA             ( BugA.hs, BugA.o )
> [2 of 3] Compiling BugB             ( BugB.hs, BugB.o )
> [3 of 3] Compiling BugC             ( BugC.hs, BugC.o )
> Ok, three modules loaded.
> (0.41 secs,)
> λ> bug
> ld: warning: duplicate -rpath 
> '/opt/homebrew/Cellar/gcc/15.2.0_1/lib/gcc/current/gcc/aarch64-apple-darwin25/15' 
> ignored
> ld: warning: -U option is redundant when using -undefined dynamic_lookup
> 13
> it :: ()
> (3.58 secs, 70,664 bytes)
> λ> :r
> [1 of 3] Compiling BugA             ( BugA.hs, BugA.o ) [Source file 
> changed]
> Ok, three modules reloaded.
> λ> bug
> ld: warning: duplicate -rpath 
> '/opt/homebrew/Cellar/gcc/15.2.0_1/lib/gcc/current/gcc/aarch64-apple-darwin25/15' 
> ignored
> ld: warning: -U option is redundant when using -undefined dynamic_lookup
> 14
> it :: ()
> (0.34 secs, 67,952 bytes)
>
> On Tue, Jun 30, 2026 at 4:31 AM Evan Laforge <[email protected]> wrote:
>
>     On Tue, Jun 23, 2026 at 10:48 AM Evan Laforge <[email protected]>
>     wrote:
>     >
>     > On Tue, Jun 23, 2026 at 6:44 AM Zubin Duggal
>     <[email protected]> wrote:
>     > > Which platform/OS are you building on and how did you obtain
>     > > GHC?
>     >
>     > Oh I should have mentioned, it's OSX, 26.5.1.  Obtained via
>     ghcup, and
>     > using the "ghcup" channel rather than vanilla.
>     >
>     > However, I just tested this with linux on a GCP VM and ghc
>     9.10.3 and
>     > I still see the issue.  One thing, I see in your
>     non-reproduction that
>     > it says "[1 of 3] Compiling BugA             ( BugA.hs, BugA.o )",
>     > which implies -fobject-code is still on.  The bug only seems to
>     happen
>     > when you are in bytecode mode, but there are .o files available to
>     > load, so you'd have to restart ghci without -fobject-code.
>
>     Hate to nag but... has anyone managed to reproduce it?  I can make it
>     happen on linux and OSX, and I can verify that it doesn't happen in
>     9.2.8, and that it starts happening at 9.4.  I believe this is when
>     ghc got a new recompilation avoidance mechanism that was supposed to
>     use hashes instead of mtimes, so that's my guess about what introduced
>     it.
>
>     I guess I can go ahead and file a bug on gitlab now.  I'm pretty sure
>     now it's a bug so I guess I don't need to wait for someone else to
>     repro but it would be nice to verify...
>
>     Since permanently leaving on -fobject-code seems to be a workaround
>     and processors are so fast now, I may just leave that flag on now.
>     I'm surprised more people haven't run into this problem in the years
>     since 9.4.
>     _______________________________________________
>     Haskell-Cafe mailing list -- [email protected]
>     To (un)subscribe, modify options or view archives go to:
>     Only members subscribed via the mailman list are allowed to post.
>
>
> _______________________________________________
> Haskell-Cafe mailing list [email protected]
> To (un)subscribe, modify options or view archives go to:
> Only members subscribed via the mailman list are allowed to post.

--------------fLPEs0GbqppTKYMq1IKOYTRm
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 8bit

<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    An essential component of the reproducer is that you close ghci
    after the first :load (which serves only to generate the .o files)
    and reopen it without -fobject-code, so that the reload of BugA
    turns it into an interpreted module.<br>
    <br>
    <div class="moz-cite-prefix">On 30/06/2026 13:53, George Colpitts
      wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAB-d4A4mH+S6qE-JiRfY8qc_0kXFouhjGdpQ14gF59_is40_tQ@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr">
        <div class="gmail_default"
          style="font-family:times new roman,serif;font-size:large">fwiw
          I can't duplicate on MacOS 26.5.2 and ghc 9.12.5 rc2:<br>
          <br>
           ghci -fobject-code <br>
          Loaded package environment from
/Users/gcolpitts/.ghc/aarch64-darwin-9.12.4.20260614/environments/default<br>
          GHCi, version 9.12.4.20260614: <a
            href="https://www.haskell.org/ghc/" moz-do-not-send="true"
            class="moz-txt-link-freetext">https://www.haskell.org/ghc/</a>
           :? for help<br>
          Loaded GHCi configuration from /Users/gcolpitts/.ghci<br>
          λ&gt; :load BugC<br>
          [1 of 3] Compiling BugA             ( BugA.hs, BugA.o )<br>
          [2 of 3] Compiling BugB             ( BugB.hs, BugB.o )<br>
          [3 of 3] Compiling BugC             ( BugC.hs, BugC.o )<br>
          Ok, three modules loaded.<br>
          (0.41 secs,)<br>
          λ&gt; bug<br>
          ld: warning: duplicate -rpath
'/opt/homebrew/Cellar/gcc/15.2.0_1/lib/gcc/current/gcc/aarch64-apple-darwin25/15'
          ignored<br>
          ld: warning: -U option is redundant when using -undefined
          dynamic_lookup<br>
          13<br>
          it :: ()<br>
          (3.58 secs, 70,664 bytes)<br>
          λ&gt; :r<br>
          [1 of 3] Compiling BugA             ( BugA.hs, BugA.o )
          [Source file changed]<br>
          Ok, three modules reloaded.<br>
          λ&gt; bug<br>
          ld: warning: duplicate -rpath
'/opt/homebrew/Cellar/gcc/15.2.0_1/lib/gcc/current/gcc/aarch64-apple-darwin25/15'
          ignored<br>
          ld: warning: -U option is redundant when using -undefined
          dynamic_lookup<br>
          14<br>
          it :: ()<br>
          (0.34 secs, 67,952 bytes)</div>
      </div>
      <br>
      <div class="gmail_quote gmail_quote_container">
        <div dir="ltr" class="gmail_attr">On Tue, Jun 30, 2026 at
          4:31 AM Evan Laforge &lt;<a href="mailto:[email protected]"
            moz-do-not-send="true" class="moz-txt-link-freetext">[email protected]</a>&gt;
          wrote:<br>
        </div>
        <blockquote class="gmail_quote"
style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On
          Tue, Jun 23, 2026 at 10:48 AM Evan Laforge &lt;<a
            href="mailto:[email protected]" target="_blank"
            moz-do-not-send="true" class="moz-txt-link-freetext">[email protected]</a>&gt;
          wrote:<br>
          &gt;<br>
          &gt; On Tue, Jun 23, 2026 at 6:44 AM Zubin Duggal &lt;<a
            href="mailto:[email protected]" target="_blank"
            moz-do-not-send="true" class="moz-txt-link-freetext">[email protected]</a>&gt;
          wrote:<br>
          &gt; &gt; Which platform/OS are you building on and how did
          you obtain<br>
          &gt; &gt; GHC?<br>
          &gt;<br>
          &gt; Oh I should have mentioned, it's OSX, 26.5.1.  Obtained
          via ghcup, and<br>
          &gt; using the "ghcup" channel rather than vanilla.<br>
          &gt;<br>
          &gt; However, I just tested this with linux on a GCP VM and
          ghc 9.10.3 and<br>
          &gt; I still see the issue.  One thing, I see in your
          non-reproduction that<br>
          &gt; it says "[1 of 3] Compiling BugA             ( BugA.hs,
          BugA.o )",<br>
          &gt; which implies -fobject-code is still on.  The bug only
          seems to happen<br>
          &gt; when you are in bytecode mode, but there are .o files
          available to<br>
          &gt; load, so you'd have to restart ghci without
          -fobject-code.<br>
          <br>
          Hate to nag but... has anyone managed to reproduce it?  I can
          make it<br>
          happen on linux and OSX, and I can verify that it doesn't
          happen in<br>
          9.2.8, and that it starts happening at 9.4.  I believe this is
          when<br>
          ghc got a new recompilation avoidance mechanism that was
          supposed to<br>
          use hashes instead of mtimes, so that's my guess about what
          introduced<br>
          it.<br>
          <br>
          I guess I can go ahead and file a bug on gitlab now.  I'm
          pretty sure<br>
          now it's a bug so I guess I don't need to wait for someone
          else to<br>
          repro but it would be nice to verify...<br>
          <br>
          Since permanently leaving on -fobject-code seems to be a
          workaround<br>
          and processors are so fast now, I may just leave that flag on
          now.<br>
          I'm surprised more people haven't run into this problem in the
          years<br>
          since 9.4.<br>
          _______________________________________________<br>
          Haskell-Cafe mailing list -- <a
            href="mailto:[email protected]" target="_blank"
            moz-do-not-send="true" class="moz-txt-link-freetext">[email protected]</a><br>
          To (un)subscribe, modify options or view archives go to:<br>
          Only members subscribed via the mailman list are allowed to
          post.</blockquote>
      </div>
      <br>
      <fieldset class="moz-mime-attachment-header"></fieldset>
      <pre wrap="" class="moz-quote-pre">_______________________________________________
Haskell-Cafe mailing list -- <a class="moz-txt-link-abbreviated" href="mailto:[email protected]">[email protected]</a>
To (un)subscribe, modify options or view archives go to:
Only members subscribed via the mailman list are allowed to post.</pre>
    </blockquote>
    <br>
  </body>
</html>

--------------fLPEs0GbqppTKYMq1IKOYTRm--

--===============5021918542784521416==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Haskell-Cafe mailing list -- [email protected]
To (un)subscribe, modify options or view archives go to:
Only members subscribed via the mailman list are allowed to post.
--===============5021918542784521416==--