Re: posix_spawn

"Kirill A. Korinsky" <[email protected]>
Newsgroups gmane.lisp.gcl.devel
Message-ID <[email protected]>
Sorry, I've missed the local root: 01ed2e0b2f540031171d2258ddccb951735827e7

--
wbr, Kirill

> On 23. Dec 2023, at 19:52, Kirill A. Korinsky <[email protected]> wrote:
> 
> This build was made with local root
> 
> It contains patches in addition to posix_spawn which allows to build it on macOS 13 arm64 under rosetta:
> 
> --- unixport/makefile
> +++ unixport/makefile
> @@ -68,7 +68,7 @@ $(LSPDIR)/auto_new.lsp: $(LSPDIR)/auto.lsp
>  		echo "(AUTOLOAD 'init-readline '|readline|)" >>$@
> 
>  libboot.so: ../o/boot.o
> -	$(CC) -shared -Wl,-undefined -Wl,dynamic_lookup $< -o $@
> +	$(CC) $(CFLAGS) -shared -Wl,-undefined -Wl,dynamic_lookup $< -o $@
> 
>  init_raw.lsp: init_raw.lsp.in
> 
> @@ -84,7 +84,7 @@ boot.h: boot.ini
>  	rm $*.c
> 
>  $(DPP):	../bin/dpp.c
> -	${CC} ${DEFS} -o $@ $<
> +	${CC} ${CFLAGS} ${DEFS} -o $@ $<
> 
>  new_init.c: ${INI_FILES}
>  	echo '#include "make-init.h"' > $@
> 
> Can you consider to add it to the upstream?
> 
> Thus, additionaly I've added patch below to catch the real place where it crashes:
> 
> --- o/main.c
> +++ o/main.c
> @@ -665,10 +665,10 @@ main(int argc, char **argv, char **envp) {
>  /* catch certain signals */
>  void install_segmentation_catcher(void)
>  {
> -  unblock_signals(SIGSEGV,SIGSEGV);
> -  unblock_signals(SIGBUS,SIGBUS);
> -  (void) gcl_signal(SIGSEGV,segmentation_catcher);
> -  (void) gcl_signal(SIGBUS,segmentation_catcher);
> +/*   unblock_signals(SIGSEGV,SIGSEGV); */
> +/*   unblock_signals(SIGBUS,SIGBUS); */
> +/*   (void) gcl_signal(SIGSEGV,segmentation_catcher); */
> +/*   (void) gcl_signal(SIGBUS,segmentation_catcher); */
>  }
> 
>  void
> 
> 
> --
> wbr, Kirill
> 
>> On 23. Dec 2023, at 19:24, Camm Maguire <[email protected] <mailto:[email protected]>> wrote:
>> 
>> Just checking my understanding : 'gcl-devel' crashes in a different
>> place, and both of these are only with the posix_spawn patch, right?
>> 
>> Take care,
>> 
>> "Kirill A. Korinsky" <[email protected] <mailto:[email protected]>> writes:
>> 
>>> I did a bit more wired things. I add to each line inside siLheap_report a printf like this:
>>> 
>>> static void
>>> FFN(siLheap_report)(void) {
>>> 
>>>  int i;
>>> 
>>>  check_arg(0);
>>>  printf("1\n");fflush(stdout);
>>> 
>>>  vs_check_push(make_fixnum(sizeof(fixnum)*CHAR_SIZE));
>>>  printf("2\n");fflush(stdout);
>>>  vs_push(make_fixnum(PAGESIZE));
>>>  printf("3\n");fflush(stdout);
>>>  vs_push(make_fixnum((ufixnum)data_start));
>>>  printf("4\n");fflush(stdout);
>>>  vs_push(make_fixnum((ufixnum)data_start+(real_maxpage<<PAGEWIDTH)));
>>>  printf("5\n");fflush(stdout);
>>>  vs_push(make_fixnum(0));/*SHARED_LIB_HEAP_CEILING*/
>>>  printf("6\n");fflush(stdout);
>>>  i=sizeof(fixnum)*CHAR_SIZE-2;
>>>  printf("7\n");fflush(stdout);
>>>  i=1<<i;
>>>  printf("8\n");fflush(stdout);
>>>  vs_push(make_fixnum(((unsigned long)cs_base+i-1)&-i));
>>>  printf("9\n");fflush(stdout);
>>>  vs_push(make_fixnum(labs(cs_base-cs_org)));
>>>  printf("10\n");fflush(stdout);
>>>  vs_push(make_fixnum((CSTACK_DIRECTION+1)>>1));
>>>  printf("11\n");fflush(stdout);
>>>  vs_push(make_fixnum(CSTACK_ALIGNMENT));
>>>  printf("12\n");fflush(stdout);
>>>  vs_push(make_fixnum(labs(cs_limit-cs_org)));/*CSSIZE*/
>>>  printf("13\n");fflush(stdout);
>>>  vs_push(make_fixnum(phys_pages));
>>> ...
>>> 
>>> and it fails at the end like this.
>>> 
>>> SYSTEM>(init-system)
>>> loading /opt/local/var/macports/build/_opt_local_var_macports_sources_github.com_catap_macports-ports_lang_gcl/gcl-devel/work/01ed2e0b2f540031171d2258ddccb951735827e7/gcl/unixport/../lsp/gcl_s.lsp
>>> loading /opt/local/var/macports/build/_opt_local_var_macports_sources_github.com_catap_macports-ports_lang_gcl/gcl-devel/work/01ed2e0b2f540031171d2258ddccb951735827e7/gcl/unixport/../lsp/gcl_sf.lsp
>>> loading /opt/local/var/macports/build/_opt_local_var_macports_sources_github.com_catap_macports-ports_lang_gcl/gcl-devel/work/01ed2e0b2f540031171d2258ddccb951735827e7/gcl/unixport/../lsp/gcl_rm.lsp
>>> loading /opt/local/var/macports/build/_opt_local_var_macports_sources_github.com_catap_macports-ports_lang_gcl/gcl-devel/work/01ed2e0b2f540031171d2258ddccb951735827e7/gcl/unixport/../lsp/gcl_dl.lsp
>>> loading /opt/local/var/macports/build/_opt_local_var_macports_sources_github.com_catap_macports-ports_lang_gcl/gcl-devel/work/01ed2e0b2f540031171d2258ddccb951735827e7/gcl/unixport/../lsp/gcl_fle.lsp
>>> loading /opt/local/var/macports/build/_opt_local_var_macports_sources_github.com_catap_macports-ports_lang_gcl/gcl-devel/work/01ed2e0b2f540031171d2258ddccb951735827e7/gcl/unixport/../lsp/gcl_defmacro.lsp
>>> loading /opt/local/var/macports/build/_opt_local_var_macports_sources_github.com_catap_macports-ports_lang_gcl/gcl-devel/work/01ed2e0b2f540031171d2258ddccb951735827e7/gcl/unixport/../lsp/gcl_hash.lsp
>>> loading /opt/local/var/macports/build/_opt_local_var_macports_sources_github.com_catap_macports-ports_lang_gcl/gcl-devel/work/01ed2e0b2f540031171d2258ddccb951735827e7/gcl/unixport/../lsp/gcl_evalmacros.lsp
>>> loading /opt/local/var/macports/build/_opt_local_var_macports_sources_github.com_catap_macports-ports_lang_gcl/gcl-devel/work/01ed2e0b2f540031171d2258ddccb951735827e7/gcl/unixport/../lsp/gcl_module.lsp
>>> loading /opt/local/var/macports/build/_opt_local_var_macports_sources_github.com_catap_macports-ports_lang_gcl/gcl-devel/work/01ed2e0b2f540031171d2258ddccb951735827e7/gcl/unixport/../lsp/gcl_predlib.lsp
>>> 1
>>> 2
>>> 3
>>> 4
>>> 5
>>> 6
>>> 7
>>> 8
>>> zsh: illegal hardware instruction  ./raw_pre_gcl
>>> catap@Kirills-mini-m1 unixport %
>>> 
>>> So, it seems clear which line triggers an issue O:-)
>>> 
>>> Thus, I've changed the problem line to
>>> 
>>>  printf("8\n");fflush(stdout);
>>>  make_fixnum(((unsigned long)cs_base+i-1)&-i);
>>>  printf("9\n");fflush(stdout);
>>> 
>>> and it crashes the same way.
>> 
>> --
>> Camm Maguire			     		    [email protected] <mailto:[email protected]>
>> ==========================================================================
>> "The earth is but one country, and mankind its citizens."  --  Baha'u'llah
>
signature.asc (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEE3/KLNtcfWfLw7JxqmNjZhndZIm4FAmWHOqMACgkQmNjZhndZ
Im4CGg/9Ezi71fJ2cbJLAfhkVmSmAekKPA9evDpuJwJSMVWyBrvAoACD97gXzVnS
7ah3YAccEJifFSDTBx6+qmY9cWsMPOTyq1YAvt0WwpJls+6cJNt3gW22JNG3810P
xBjVvlkBVsknzREwSwRd16djt7mbn+vgdewooIq1WcC6HGw1ajPgr+pgWzPW9h1V
LdZpKD7vQo+VnSb5J1a9eGasTL6sGRswas23b2KuwrlFXyy8i0q1FImsMF4WilQv
H3YZcPb4BjQkU76hA0nztnB3qrKc7zSJop9qs9BrBjm4C+kj7EiqpG409xt0lzZC
BuoHK6/hN6FVGaBA853GThCQu0FJLUKJ+n69XzSotGYtdMpE7z4knOa5GjVb/JT+
F7CHK6W+BRQYMsz5+mKShMOBOhmUKPT1FAX7A1ppRUVMpb3lPM6t3jEwC3zGufj8
RUYJ9ASHbprBp2zQDeYqWQ1BPdxUtThChBMn3Y4nQMlmhIdC3Y09jIbiPTVHHo4u
ZnKWjo5gzdCMYxnL0wSwoFGF+VSMntYfleXg6rMd0/I+RYuo229lOcfvZ+XOaSYJ
UdFVJ2HUEeOJ6ctkqeN9ejgjNkUkykhYD3BIerznqNkm5bB4jDzQSfsZS/pp2xQh
YIFl2T9Ykt+LZbATo2rp+PQwYLsWlCZsrkIOJlT6SrQk9QAmy+0=
=u51K
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.