Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stack traces in arm64 code are not displayed in gdb #6490

Closed
vicuna opened this issue Jul 16, 2014 · 2 comments

Comments

Projects
None yet
2 participants
@vicuna
Copy link

commented Jul 16, 2014

Original bug ID: 6490
Reporter: Richard Jones
Assigned to: @mshinwell
Status: closed (set by @xavierleroy on 2016-12-07T10:49:14Z)
Resolution: fixed
Priority: normal
Severity: minor
Version: 4.02.0+beta1 / +rc1
Target version: 4.02.2+dev / +rc1
Fixed in version: 4.02.2+dev / +rc1
Category: back end (clambda to assembly)

Bug description

I ran ocamlopt.opt (compiled with -g) under gdb and placed a breakpoint in a random OCaml function. As you can see the stack trace is wrong after the first frame:

(gdb) break camlBtype__save_desc_1660
Breakpoint 5 at 0x4b2f34: file typing/btype.ml, line 402.
(gdb) cont
Continuing.

Breakpoint 5, 0x00000000004b2f34 in camlBtype__save_desc_1660 ()
at typing/btype.ml:402
402 let save_desc ty desc =
(gdb) bt
#0 0x00000000004b2f34 in camlBtype__save_desc_1660 () at typing/btype.ml:402
#1 0x00000000004b98e8 in camlSubst__typexp_1250 () at typing/subst.ml:116
#2 0x00000000004b98e8 in camlSubst__typexp_1250 () at typing/subst.ml:116
#3 0x00000000004b98e8 in camlSubst__typexp_1250 () at typing/subst.ml:116
#4 0x00000000004b98e8 in camlSubst__typexp_1250 () at typing/subst.ml:116
#5 0x00000000004b98e8 in camlSubst__typexp_1250 () at typing/subst.ml:116
#6 0x00000000004b98e8 in camlSubst__typexp_1250 () at typing/subst.ml:116
#7 0x00000000004b98e8 in camlSubst__typexp_1250 () at typing/subst.ml:116
#8 0x00000000004b98e8 in camlSubst__typexp_1250 () at typing/subst.ml:116
#9 0x00000000004b98e8 in camlSubst__typexp_1250 () at typing/subst.ml:116
[continues forever]

Steps to reproduce

Compile ocamlopt.opt with debugging enabled. This also applies to any OCaml program.

Place a breakpoint anywhere and run it.

Use gdb `bt' command to display the stack trace.

Stack traces are normal for C code, but consist of a repeated function for OCaml code.

@vicuna

This comment has been minimized.

Copy link
Author

commented May 6, 2015

Comment author: @mshinwell

It turns out that the same problem could be seen on 32-bit ARM platforms.

I've committed a fix to the 4.02 branch that I tested on a 32-bit ARM machine. I have also made a fix to the AArch64 backend that I think will solve the problem, but we should test on real hardware. I will ask the OP to check, and re-open this issue if needs be.

@vicuna

This comment has been minimized.

Copy link
Author

commented May 6, 2015

Comment author: @mshinwell

It has been confirmed that this appears to fix the problem on AArch64 hardware.

@vicuna vicuna closed this Dec 7, 2016

@vicuna vicuna added the back-end label Mar 14, 2019

@vicuna vicuna added this to the 4.02.2 milestone Mar 14, 2019

@vicuna vicuna added the bug label Mar 20, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.