unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* [PATCH, v2] Fix build on platforms where the stack grows upwards
@ 2020-02-04 12:11 John Paul Adrian Glaubitz
  2020-02-08 14:07 ` Ludovic Courtès
  2020-07-22 21:54 ` John Paul Adrian Glaubitz
  0 siblings, 2 replies; 6+ messages in thread
From: John Paul Adrian Glaubitz @ 2020-02-04 12:11 UTC (permalink / raw)
  To: guile-devel; +Cc: wingo, deller, dave.anglin, John Paul Adrian Glaubitz

 * libguile/continuations.c (scm_dynthrow): Fix missing mra
   parameter to grow_stack for SCM_STACK_GROWS_UP.
---
 libguile/continuations.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

 v2:
 - Improved grammar in commit message

diff --git a/libguile/continuations.c b/libguile/continuations.c
index 3f86c6bd4..67a47d38c 100644
--- a/libguile/continuations.c
+++ b/libguile/continuations.c
@@ -323,7 +323,7 @@ scm_dynthrow (SCM cont, uint8_t *mra)
 
 #if SCM_STACK_GROWS_UP
   if (dst + continuation->num_stack_items >= &stack_top_element)
-    grow_stack (cont);
+    grow_stack (cont, mra);
 #else
   dst -= continuation->num_stack_items;
   if (dst <= &stack_top_element)
-- 
2.25.0




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH, v2] Fix build on platforms where the stack grows upwards
  2020-02-04 12:11 [PATCH, v2] Fix build on platforms where the stack grows upwards John Paul Adrian Glaubitz
@ 2020-02-08 14:07 ` Ludovic Courtès
  2020-03-10 22:58   ` John David Anglin
  2020-07-22 21:54 ` John Paul Adrian Glaubitz
  1 sibling, 1 reply; 6+ messages in thread
From: Ludovic Courtès @ 2020-02-08 14:07 UTC (permalink / raw)
  To: John Paul Adrian Glaubitz
  Cc: wingo, deller, dave.anglin, guile-devel, John Paul Adrian Glaubitz

Hi,

John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de> skribis:

>  * libguile/continuations.c (scm_dynthrow): Fix missing mra
>    parameter to grow_stack for SCM_STACK_GROWS_UP.

Applied, thanks!

Ludo'.



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH, v2] Fix build on platforms where the stack grows upwards
  2020-02-08 14:07 ` Ludovic Courtès
@ 2020-03-10 22:58   ` John David Anglin
  2020-03-13 16:29     ` Andy Wingo
  0 siblings, 1 reply; 6+ messages in thread
From: John David Anglin @ 2020-03-10 22:58 UTC (permalink / raw)
  To: Ludovic Courtès, John Paul Adrian Glaubitz
  Cc: wingo, deller, guile-devel

Hi,

On 2020-02-08 9:07 a.m., Ludovic Courtès wrote:
> John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de> skribis:
>
>>  * libguile/continuations.c (scm_dynthrow): Fix missing mra
>>    parameter to grow_stack for SCM_STACK_GROWS_UP.
> Applied, thanks!
I believe that this change was also applied to the 2.2 stable branch (v2.2.7).  There is no mra
parameter on 2.2.

Dave

-- 
John David Anglin  dave.anglin@bell.net




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH, v2] Fix build on platforms where the stack grows upwards
  2020-03-10 22:58   ` John David Anglin
@ 2020-03-13 16:29     ` Andy Wingo
  2020-03-13 17:17       ` John David Anglin
  0 siblings, 1 reply; 6+ messages in thread
From: Andy Wingo @ 2020-03-13 16:29 UTC (permalink / raw)
  To: John David Anglin
  Cc: Ludovic Courtès, deller, guile-devel, John Paul Adrian Glaubitz

On Tue 10 Mar 2020 23:58, John David Anglin <dave.anglin@bell.net> writes:

> On 2020-02-08 9:07 a.m., Ludovic Courtès wrote:
>> John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de> skribis:
>>
>>>  * libguile/continuations.c (scm_dynthrow): Fix missing mra
>>>    parameter to grow_stack for SCM_STACK_GROWS_UP.
>> Applied, thanks!
> I believe that this change was also applied to the 2.2 stable branch (v2.2.7).  There is no mra
> parameter on 2.2.

Indeed; fixed.  Thanks for the fix and the note, and thanks Ludo for
getting the fix into 3.0.1 :)

Andy



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH, v2] Fix build on platforms where the stack grows upwards
  2020-03-13 16:29     ` Andy Wingo
@ 2020-03-13 17:17       ` John David Anglin
  0 siblings, 0 replies; 6+ messages in thread
From: John David Anglin @ 2020-03-13 17:17 UTC (permalink / raw)
  To: Andy Wingo
  Cc: Ludovic Courtès, deller, guile-devel, John Paul Adrian Glaubitz

On 2020-03-13 12:29 p.m., Andy Wingo wrote:
> On Tue 10 Mar 2020 23:58, John David Anglin <dave.anglin@bell.net> writes:
>
>> On 2020-02-08 9:07 a.m., Ludovic Courtès wrote:
>>> John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de> skribis:
>>>
>>>>  * libguile/continuations.c (scm_dynthrow): Fix missing mra
>>>>    parameter to grow_stack for SCM_STACK_GROWS_UP.
>>> Applied, thanks!
>> I believe that this change was also applied to the 2.2 stable branch (v2.2.7).  There is no mra
>> parameter on 2.2.
> Indeed; fixed.  Thanks for the fix and the note, and thanks Ludo for
> getting the fix into 3.0.1 :)
guile-3.0 3.0.0+1-2 built successfully on debian linux:
https://buildd.debian.org/status/fetch.php?pkg=guile-3.0&arch=hppa&ver=3.0.0%2B1-2&stamp=1583969036&raw=0

On hpux, there are problems with the 2.2 and 3.0 branches.

2.0.14 builds okay on hppa2.0w-hp-hpux11.11 with gcc 8.4.1, but I had to upgrade intprops.h to a newer version.

Version 2.2.6 segfaults in vm_regular_engine:

     11378 Segmentation fault      (core dumped) | GUILE_AUTO_COMPILE=0 ../meta/build-env guild snarf-check-and-output-texi > guile-procedures.texi
make[3]: *** [Makefile:4281: guile-procedures.texi] Error 1

(gdb) bt
#0  vm_regular_engine (thread=0x7ad69e60, vp=0x7ad28f78, registers=0x7eff22d0,
    resume=0) at ../../libguile/vm-engine.c:573
#1  0xc2b540fc in scm_call_n (proc=0x7ad4fbc0, argv=0x0, nargs=0)
    at ../../libguile/vm.c:1260
#2  0xc29e5710 in scm_call_0 (proc=0x7ad4fbc0) at ../../libguile/eval.c:479
#3  0xc2a44e58 in scm_primitive_load_path (args=0x7ad50ff0)
    at ../../libguile/load.c:1251
#4  0xc2a1f0a0 in scm_apply_subr (sp=0x7acd7f30, nslots=2)
    at ../../libguile/gsubr.c:305
#5  0xc2b2f22c in vm_regular_engine (thread=0x7ad69e60, vp=0x7ad28f78,
    registers=0x7eff11d0, resume=0) at ../../libguile/vm-engine.c:786
#6  0xc2b540fc in scm_call_n (proc=0x7ad375c8, argv=0x0, nargs=0)
    at ../../libguile/vm.c:1260
#7  0xc29e5710 in scm_call_0 (proc=0x7ad375c8) at ../../libguile/eval.c:479
#8  0xc2a44e58 in scm_primitive_load_path (args=0x7ad38b20)
    at ../../libguile/load.c:1251
#9  0xc2a44f7c in scm_c_primitive_load_path (
    filename=0x7adce1ec <s_scm_nl_langinfo+676> "ice-9/boot-9")
    at ../../libguile/load.c:1267
#10 0xc2a31e8c in scm_load_startup_files () at ../../libguile/init.c:250
#11 0xc2a33864 in scm_i_init_guile (base=0x7eff0dd8)
    at ../../libguile/init.c:535
#12 0xc2b1ca80 in scm_i_init_thread_for_guile (base=0x7eff0dd8,
---Type <return> to continue, or q <return> to quit---
    dynamic_state=0x0) at ../../libguile/threads.c:586
#13 0xc2b1cdc0 in with_guile (base=0x7eff0dd8, data=0x7eff0d58)
    at ../../libguile/threads.c:654
#14 0xc11fc530 in GC_call_with_stack_base (fn=0x4, arg=0x7ad4fd08)
    at ../src/extra/../misc.c:2130
#15 0xc2b1d01c in scm_i_with_guile (
    func=@0x7adc477a: 0xc2a32000 <invoke_main_func>, data=0x7eff0c9c,
    dynamic_state=0x0) at ../../libguile/threads.c:704
#16 0xc2b1d0ac in scm_with_guile (
    func=@0x7adc477a: 0xc2a32000 <invoke_main_func>, data=0x7eff0c9c)
    at ../../libguile/threads.c:710
#17 0xc2a31fcc in scm_boot_guile (argc=6, argv=0x7eff0a84,
    main_func=@0x40001a7a: 0x3838 <inner_main>, closure=0x0)
    at ../../libguile/init.c:324
#18 0x00003b6c in main (argc=6, argv=0x7eff0a84) at ../../libguile/guile.c:101
(gdb) disass $pc-16,$pc+16
Dump of assembler code from 0xc2b2e99c to 0xc2b2e9bc:
   0xc2b2e99c <vm_regular_engine+1100>: addil L%-4800,r19,r1
   0xc2b2e9a0 <vm_regular_engine+1104>: copy r1,ret0
   0xc2b2e9a4 <vm_regular_engine+1108>: ldw e8(ret0),ret0
   0xc2b2e9a8 <vm_regular_engine+1112>: copy ret0,r6
=> 0xc2b2e9ac <vm_regular_engine+1116>: ldw 0(r6),r4
   0xc2b2e9b0 <vm_regular_engine+1120>: extrw,u r4,31,8,ret0
   0xc2b2e9b4 <vm_regular_engine+1124>: depw,z ret0,29,30,ret0
   0xc2b2e9b8 <vm_regular_engine+1128>: add,l r9,ret0,ret0
End of assembler dump.
(gdb) p/x $r6
$1 = 0xf4f25378
(gdb) p/x ip
$2 = 0xf4f25378
(gdb) x/x 0xf4f25378
0xf4f25378:     Cannot access memory at address 0xf4f25378

The above fault doesn't depend  on compiler optimization level.

I've tried to find the change that introduced the above using git bisect but it isn't easy.  There
are multiple places on the trunk where the build breaks.  In some places, stack overflows occur
due to excessive iteration.  Stack size is 16384 kbytes.

If you have any thoughts on the above, let me know.  Aside from the OS differences, the code generated
should be quite similar for both hpux and linux.

Dave

-- 
John David Anglin  dave.anglin@bell.net





^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH, v2] Fix build on platforms where the stack grows upwards
  2020-02-04 12:11 [PATCH, v2] Fix build on platforms where the stack grows upwards John Paul Adrian Glaubitz
  2020-02-08 14:07 ` Ludovic Courtès
@ 2020-07-22 21:54 ` John Paul Adrian Glaubitz
  1 sibling, 0 replies; 6+ messages in thread
From: John Paul Adrian Glaubitz @ 2020-07-22 21:54 UTC (permalink / raw)
  To: guile-devel; +Cc: wingo, deller, dave.anglin

Hello!

On 2/4/20 1:11 PM, John Paul Adrian Glaubitz wrote:
> diff --git a/libguile/continuations.c b/libguile/continuations.c
> index 3f86c6bd4..67a47d38c 100644
> --- a/libguile/continuations.c
> +++ b/libguile/continuations.c
> @@ -323,7 +323,7 @@ scm_dynthrow (SCM cont, uint8_t *mra)
>  
>  #if SCM_STACK_GROWS_UP
>    if (dst + continuation->num_stack_items >= &stack_top_element)
> -    grow_stack (cont);
> +    grow_stack (cont, mra);
>  #else
>    dst -= continuation->num_stack_items;
>    if (dst <= &stack_top_element)

Looks like this was just broken again in 2.2.7 on hppa [1]:

continuations.c: In function 'scm_dynthrow':
continuations.c:305:23: error: 'mra' undeclared (first use in this function)
  305 |     grow_stack (cont, mra);
      |                       ^~~
continuations.c:305:23: note: each undeclared identifier is reported only once for each function it appears in
continuations.c:305:5: error: too many arguments to function 'grow_stack'
  305 |     grow_stack (cont, mra);
      |     ^~~~~~~~~~
continuations.c:237:1: note: declared here
  237 | grow_stack (SCM cont)
      | ^~~~~~~~~~
make[4]: *** [Makefile:2844: libguile_2.2_la-continuations.lo] Error 1
make[4]: *** Waiting for unfinished jobs....

I just saw it was already fixed for 2.2.8 but that hasn't been released yet [2] :(.

Adrian

> [1] https://buildd.debian.org/status/fetch.php?pkg=guile-2.2&arch=hppa&ver=2.2.7%2B1-1&stamp=1584637426&raw=0
> [2] http://git.savannah.gnu.org/cgit/guile.git/commit/?h=stable-2.2&id=7839dc444b94568579c510737bc358fa6f4470ee

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - glaubitz@debian.org
`. `'   Freie Universitaet Berlin - glaubitz@physik.fu-berlin.de
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-07-22 21:54 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-04 12:11 [PATCH, v2] Fix build on platforms where the stack grows upwards John Paul Adrian Glaubitz
2020-02-08 14:07 ` Ludovic Courtès
2020-03-10 22:58   ` John David Anglin
2020-03-13 16:29     ` Andy Wingo
2020-03-13 17:17       ` John David Anglin
2020-07-22 21:54 ` John Paul Adrian Glaubitz

unofficial mirror of guile-devel@gnu.org 

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://yhetil.org/guile-devel/0 guile-devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 guile-devel guile-devel/ https://yhetil.org/guile-devel \
		guile-devel@gnu.org
	public-inbox-index guile-devel

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.yhetil.org/yhetil.lisp.guile.devel
	nntp://news.gmane.io/gmane.lisp.guile.devel


AGPL code for this site: git clone http://ou63pmih66umazou.onion/public-inbox.git