WFransen

WFransen

Hello,

Perhaps a little bit more of a fundamental debugging question, but is there a reason why consecutive IEx.pry’s in a recursive context are being skipped after 2 times?

system information output:

System information
> $ elixir -v        
Erlang/OTP 23 [erts-11.0.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [hipe]

Elixir 1.10.3 (compiled with Erlang/OTP 21)

> $ cat /etc/os-release
NAME="Ubuntu"
VERSION="18.04.4 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.4 LTS"
VERSION_ID="18.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic
Example code:
defmodule Example do
  require IEx

  def recursive_hi(0), do: IO.puts("hi0")

  def recursive_hi(n) do
    IEx.pry()
    IO.puts("hi#{n}")
    recursive_hi(n - 1)
  end
end
Output when trying to debug with iex -S mix run (compiled module in mix project):
iex(1)> recompile;
Compiling 1 file (.ex)
:ok
iex(2)> Example.recursive_hi 5
Break reached: Example.recursive_hi/1 (lib/ex_gherkin/example/example.ex:7) 

    5: 
    6:   def recursive_hi(n) do
    7:     IEx.pry()
    8:     IO.puts("hi#{n}")
    9:     recursive_hi(n - 1)

pry(1)> n
5
pry(2)> continue
hi5
Break reached: Example.recursive_hi/1 (lib/ex_gherkin/example/example.ex:7) 

    5: 
    6:   def recursive_hi(n) do
    7:     IEx.pry()
    8:     IO.puts("hi#{n}")
    9:     recursive_hi(n - 1)

pry(1)> n
4
pry(2)> continue
hi4
Break reached: Example.recursive_hi/1 (lib/ex_gherkin/example/example.ex:7) 

    5: 
    6:   def recursive_hi(n) do
    7:     IEx.pry()
    8:     IO.puts("hi#{n}")
    9:     recursive_hi(n - 1)

hi3
Break reached: Example.recursive_hi/1 (lib/ex_gherkin/example/example.ex:7) 

    5: 
    6:   def recursive_hi(n) do
    7:     IEx.pry()
    8:     IO.puts("hi#{n}")
    9:     recursive_hi(n - 1)

hi2     
Break reached: Example.recursive_hi/1 (lib/ex_gherkin/example/example.ex:7) 

    5: 
    6:   def recursive_hi(n) do
    7:     IEx.pry()
    8:     IO.puts("hi#{n}")
    9:     recursive_hi(n - 1)

hi1     
hi0     
:ok     

As you can see in the last “output” section, it is possible to pry into it the first 2 times, but after that it just keeps executing without “freezing”. Am I understanding some fundamentals wrong here or?

Right now I’m using the Erlang debugger (:debugger.start / :int.break(__ MODULE __, line) / etc…) to work around this “issue”.

Thank you in advance.

Showing Posts 1 to 6

pdgonzalez872

pdgonzalez872

Do you have an example project that reproduces this error that you could share here?

If you are able to reproduce, then it may be a bug that was re-introduced somehow and it is worth opening up an issue on Elixir (share the reproducible project in the issue as well). For more context: Consecutive calls to IEx.pry/0 don't pause the execution as expected · Issue #7255 · elixir-lang/elixir · GitHub

WFransen

WFransen OP

Generating a sample project with instructions in the readme. One moment please. I’ll post the link here when its pushed.

WFransen

WFransen OP

Here is the example repository: https://github.com/WannesFransen1994/consecutive_pries .

Curious whether this issue is due to my setup or it is an actual bug!

pdgonzalez872

pdgonzalez872

I agree. Was able to reproduce it.

Here is the system info:

Erlang/OTP 22 [erts-10.6.4] [source] [64-bit] [smp:12:12] [ds:12:12:10] [async-threads:1] [hipe]

Elixir 1.10.1 (compiled with Erlang/OTP 22)

I’d open an issue, it is not the expected behavior with the above. Last time, Jose knew exactly what the issue was an had a fix within 10 mins.

WFransen

WFransen OP

Wonderful. Well, not wonderful that there’s a bug but that you were able to reproduce it!

Thank you for taking the time to test this. Opening an issue now and I’ll post the github issue link here later on.

WFransen

WFransen OP

For future readers: opened an issue.

— All posts loaded —

Where Next? Top

Trending in Questions Top

RSP87
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
nseaSeb
Hello, I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
brecabral
Documentation While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
RemyXRenard
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
velrest
So my question is quite simple and i have found no conclusive answer on forum, google or AI. Should we use :erlang.float for Integer to ...
New
samoloth
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New
asweet-confluent
I recently noticed that Elixir’s Logger defaults its primary log level to :debug when no :logger, :level application configuration is pre...
New

Other Trending Topics Top

JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
New
mhanberg
Hi everyone! The first release candidate for the Expert language server project is now available! We’ve published a press release detai...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Dmk
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New

Latest on Elixir Forum

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews