From: Emery Hemingway <ehmry@posteo.net>
To: Xiao-Yong Jin <meta.jxy@gmail.com>
Cc: <9front@9front.org>, Adrian Siekierka <asiekierka@gmail.com>
Subject: Re: [9front] Nim lang, C alignment support
Date: Sun, 08 Aug 2021 14:54:09 +0000 [thread overview]
Message-ID: <0e33e60b-911a-4743-8d3e-e6bf85643157@posteo.net> (raw)
In-Reply-To: <14C92255-A517-4EBA-A944-9FBAC3B1D728@gmail.com>
Hello Jin,
On Saturday 7 August 2021 00:25:58 CEST, Xiao-Yong Jin wrote:
> What exactly happens when the executables run? Do you have the Nim
> compiler bootstrapped on 9front? Or do you just try to compile the
> C code generated from other host OS?
Nim executables seem to run until memory starts being freed. It's a
double-free panic in pool.c or else I get a stack-trace leading to
gc.nim. Simple programs are usable, I have the compiler bootstrapped
enough to print it's version and usage message to stdout, but with any
load it will dealloc and break.
> Did you try to turn off all the extra checks and just use malloc, like,
>
> -d:danger --panics:on --gc:arc -d:useMalloc
I've tried these and --gc:orc but things seem to break in the same way.
> If I understand correctly, the only place that relies on the alignment
> is Nim's allocator, for whatever reason, and it did not appear until
> late 2019 as an optimization and safety guarantees for dynamic libraries.
> If you can figure out where it actually "goes to shit", you might be
> able to avoid using alignment at all.
I think you are right, it may be possible to disable some optimizations,
I'll see what I can do. If anyone is curious I've documented the
bootstrapping process.
https://github.com/ehmry/Nim/tree/plan9#readme
Thanks for the encouragement,
Emery
prev parent reply other threads:[~2021-08-09 9:14 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-06 10:52 Emery
2021-08-06 11:11 ` Adrian Siekierka
2021-08-06 13:37 ` Emery Hemingway
2021-08-06 22:25 ` Xiao-Yong Jin
2021-08-08 14:54 ` Emery Hemingway [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=0e33e60b-911a-4743-8d3e-e6bf85643157@posteo.net \
--to=ehmry@posteo.net \
--cc=9front@9front.org \
--cc=asiekierka@gmail.com \
--cc=meta.jxy@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).