You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 4953 Reporter: NCommander Assigned to:@xavierleroy Status: closed (set by @xavierleroy on 2010-01-08T10:34:05Z) Resolution: fixed Priority: normal Severity: major Version: 3.11.1 Fixed in version: 3.11.2+dev Category: ~DO NOT USE (was: OCaml general)
Bug description
When building for Thumb2 on Ubuntu lucid, ocaml failed to build from source with ocamlrun segfaulting while running make world. The issue was tracked down to an issue when specifying specific registers on Thumb. Here's the output from GDB:
nc@arm:~/src/ocaml-3.11.1$ gdb boot/ocamlrun
GNU gdb (GDB) 7.0.1-ubuntu
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "arm-linux-gnueabi".
For bug reporting instructions, please see: http://www.gnu.org/software/gdb/bugs/...
Reading symbols from /home/nc/src/ocaml-3.11.1/boot/ocamlrun...done.
(gdb) r boot/ocamlc
Starting program: /home/nc/src/ocaml-3.11.1/boot/ocamlrun boot/ocamlc
[Thread debugging using libthread_db enabled]
Program received signal SIGSEGV, Segmentation fault.
0x00026bda in caml_interprete (prog=Cannot access memory at address 0x5
) at interp.c:526
526 int nvars = *pc++;
(gdb) l
521 }
522 Next;
523 }
524
525 Instruct(CLOSURE): {
526 int nvars = *pc++;
527 int i;
528 if (nvars > 0) *--sp = accu;
529 Alloc_small(accu, 1 + nvars, Closure_tag);
530 Code_val(accu) = pc + *pc;
(gdb) bt
#0 0x00026bda in caml_interprete (prog=Cannot access memory at address 0x5
) at interp.c:526
Cannot access memory at address 0x2cd
(gdb) info registers
r0 0x0 0
r1 0x0 0
r2 0x0 0
r3 0x40286f8c 1076391820
r4 0x0 0
r5 0x0 0
r6 0x0 0
r7 0x1 1
r8 0x46928 289064
r9 0x40286f8c 1076391820
r10 0x4001e000 1073864704
r11 0x0 0
r12 0x401210e1 1074925793
sp 0xbebae340 0xbebae340
lr 0x26197 156055
pc 0x26bda 0x26bda <caml_interprete+2810>
fps 0x0 0
cpsr 0x60000030 1610612784
(gdb)
I'm willing to help test any patches or provide any debugging information necessary.
Additional information
The following patch works around the issue by dropping the per-register assignments when compiling for Thumb:
Index: ocaml-3.11.1/byterun/interp.c
--- ocaml-3.11.1.orig/byterun/interp.c 2010-01-04 10:20:26.387208256 -0500
+++ ocaml-3.11.1/byterun/interp.c 2010-01-04 10:25:41.727191496 -0500
@@ -157,7 +157,8 @@
#define SP_REG asm("a4")
#define ACCU_REG asm("d7")
#endif
-#ifdef arm
+/* specifying a specific register breaks when compiling for thumb mode */
+#if defined (arm) && !defined(thumb)
#define PC_REG asm("r9")
#define SP_REG asm("r8")
#define ACCU_REG asm("r7")
The text was updated successfully, but these errors were encountered:
Original bug ID: 4953
Reporter: NCommander
Assigned to: @xavierleroy
Status: closed (set by @xavierleroy on 2010-01-08T10:34:05Z)
Resolution: fixed
Priority: normal
Severity: major
Version: 3.11.1
Fixed in version: 3.11.2+dev
Category: ~DO NOT USE (was: OCaml general)
Bug description
When building for Thumb2 on Ubuntu lucid, ocaml failed to build from source with ocamlrun segfaulting while running make world. The issue was tracked down to an issue when specifying specific registers on Thumb. Here's the output from GDB:
nc@arm:~/src/ocaml-3.11.1$ gdb boot/ocamlrun
GNU gdb (GDB) 7.0.1-ubuntu
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "arm-linux-gnueabi".
For bug reporting instructions, please see:
http://www.gnu.org/software/gdb/bugs/...
Reading symbols from /home/nc/src/ocaml-3.11.1/boot/ocamlrun...done.
(gdb) r boot/ocamlc
Starting program: /home/nc/src/ocaml-3.11.1/boot/ocamlrun boot/ocamlc
[Thread debugging using libthread_db enabled]
Program received signal SIGSEGV, Segmentation fault.
0x00026bda in caml_interprete (prog=Cannot access memory at address 0x5
) at interp.c:526
526 int nvars = *pc++;
(gdb) l
521 }
522 Next;
523 }
524
525 Instruct(CLOSURE): {
526 int nvars = *pc++;
527 int i;
528 if (nvars > 0) *--sp = accu;
529 Alloc_small(accu, 1 + nvars, Closure_tag);
530 Code_val(accu) = pc + *pc;
(gdb) bt
#0 0x00026bda in caml_interprete (prog=Cannot access memory at address 0x5
) at interp.c:526
Cannot access memory at address 0x2cd
(gdb) info registers
r0 0x0 0
r1 0x0 0
r2 0x0 0
r3 0x40286f8c 1076391820
r4 0x0 0
r5 0x0 0
r6 0x0 0
r7 0x1 1
r8 0x46928 289064
r9 0x40286f8c 1076391820
r10 0x4001e000 1073864704
r11 0x0 0
r12 0x401210e1 1074925793
sp 0xbebae340 0xbebae340
lr 0x26197 156055
pc 0x26bda 0x26bda <caml_interprete+2810>
fps 0x0 0
cpsr 0x60000030 1610612784
(gdb)
I'm willing to help test any patches or provide any debugging information necessary.
Additional information
The following patch works around the issue by dropping the per-register assignments when compiling for Thumb:
Index: ocaml-3.11.1/byterun/interp.c
--- ocaml-3.11.1.orig/byterun/interp.c 2010-01-04 10:20:26.387208256 -0500
+++ ocaml-3.11.1/byterun/interp.c 2010-01-04 10:25:41.727191496 -0500
@@ -157,7 +157,8 @@
#define SP_REG asm("a4")
#define ACCU_REG asm("d7")
#endif
-#ifdef arm
+/* specifying a specific register breaks when compiling for thumb mode */
+#if defined (arm) && !defined(thumb)
#define PC_REG asm("r9")
#define SP_REG asm("r8")
#define ACCU_REG asm("r7")
The text was updated successfully, but these errors were encountered: