[m-users.] aarch64 runtime reports "caught segmentation violation"

Van Ly van.ly at sdf.org
Thu May 26 17:39:23 AEST 2022


Thankyou Julien for those suggestions.

Rebuilding Mercury with Mmake.params "EXTRA_CFLAGS = -O0" after

   $ ./configure --prefix=path/to/mercury --disable-csharp-grade 
--disable-java-grade --enable-nogc-grades --enable-hlc-prof-grades 
--enable-hlc-low-level-debug-grades --with-cc="path/to/gcc"

I was seeing progress lines like

   mmc --compile-to-c --grade asm_fast    --mercury-linkage shared ...

but I was able to get through the "Hello, World" example using

   $ mmc --mercury-linkage static hello

which was failing before the "-O0" rebuild.

I should have exhausted my options in the FAQ before bugging the 
list.

   https://mercurylang.org/information/doc-release/mercury_faq/index.html

Will the configure option '--with-default-grade=reg' install and use a
high-level C grade?

On Tue, 17 May 2022, Julien Fischer wrote:

>
> Hi,
>
> On Tue, 17 May 2022, Van Ly wrote:

   ...

>> $ ./hello
>> 
>> *** Mercury runtime: caught segmentation violation ***
>> cause: address not mapped to object

   ...

> The first question would be: what compilation grade is being used to
> compile hello.m?  (Based on the above runtime error message and the
> platform, I guess it would be asm_fast.gc.)
>
> Some things to try:
>
> 1. Is this is an issue related to the use of shared Mercury libraries
> on that system?  You can check by compiling with:
>
>   $ mmc --mercury-linkage static hello
>
> and see if that then works.
>
> 2. Is it some issue with the C compiler on that system?  Forcing -O0 in
> the C compiler when building and installing Mercury and also compiling
> your program would be the way to check that.
>
> The former can be done by placing a file named Mmake.params at the
> top-level of the Mercury source tree containing the following:
>
>    EXTRA_CFLAGS = -O0
>
> The latter can be done by:
>
>    $ mmc --cflags "-O0" hello
>
> 3. If the compilation grade you are using (see above) is asm_fast.gc,
> then you may want to install and use a high-level C grade (e.g. hlc.gc)
> instead.  They are generally a bit more forgiving of portability issues.
>
> Julien.

-- 
vl



More information about the users mailing list