[m-users.] Crash in improved ODBC library when compiled in hlc.par.gc grade

Julien Fischer jfischer at opturion.com
Thu Oct 22 12:17:17 AEDT 2026


Hi,

On Thu, 22 Oct 2026 at 00:35, Volker Wysk <post at volker-wysk.de> wrote:

> Am Donnerstag, dem 22.10.2026 um 00:08 +1100 schrieb Julien Fischer:
>
>
> On Thu, 22 Oct 2026 at 00:03, Volker Wysk <post at volker-wysk.de> wrote:
>
> I was happy too early. I just remembered that hlc grades don't support
> debugging...
>
> The compiler doesn't reject "--grade=hlc.gc --debug", like it should.
>
>
> Yes it does.
>
>    $ mmc --grade hlc.gc --debug hello
>    Debugging is available only in low level C grades.
>
>
> I've tried. It looks like it does so only when the "--debug" option comes
> after the "--grade" option:
>
> vw at desktop:~/src/odbc-bug$ mmc --grade=hlc.gc --debug hello
> mmc:
> Debugging is available only in low level C grades.
>
> vw at desktop:~/src/odbc-bug$ mmc --debug --grade=hlc.gc hello
> mercury_compile: cannot find source for module `hello' in directories `.'
>

The explanation is that the --debug option does not do what you expect.
What it does is *add* the ".debug" grade component to the currently
selected grade.  If you haven't explicitly selected a grade, the compiler
will use whatever default grade it was configured with.)
The other thing to understand is that the --grade option overwrites
all previously set grade options.  The order that the options
appear on the command line is significant.

In the case where the command line option are --grade=hlc.gc --debug,
what you are saying is:

1. Change the currently selected grade to hlc.gc.
2. Add the "debug" grade component to that grade, yielding "hlc.gc.debug".
3. The compiler detects the use of the incompatible components "hlc" and
"debug"
    in the selected grade and reports the above error.

In the case where the command line options are --debug --grade hlc.gc, what
you are saying is:

1. Add the --debug component to the default grade, which will (probably)
yield
   "asm_fast.gc.debug".
2. Overwrite the selected grade with "hlc.gc".
3. There are no incompatible components in "hlc.gc", so there is no error.

(We are aware that the way the grade selection options operate is rather
confusing
and there are plans to change them.)

Julien.

>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurylang.org/archives/users/attachments/20261022/e065abf8/attachment.html>


More information about the users mailing list