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

Handle nil return code #299

Merged
merged 2 commits into from
Oct 18, 2024
Merged

Handle nil return code #299

merged 2 commits into from
Oct 18, 2024

Conversation

TApplencourt
Copy link
Collaborator

@TApplencourt TApplencourt commented Oct 11, 2024

Fix the

/home/videau/opt/thapi/0.0.7/bin/iprof:884:in `exit': no implicit conversion from nil to integer (TypeError)

  exit(XprofExitCode.get)
       ^^^^^^^^^^^^^^^^^
	from /home/videau/opt/thapi/0.0.7/bin/iprof:884:in `<main>'

Now return:

applenco@x4307c2s4b0n0:~/THAPI/build> ./ici/bin/iprof ./a.out
E, [2024-10-11T22:13:11.385479 #181857] ERROR -- : ./a.out returned with a nil exit code (most probably due to a segault
THAPI: Trace location: /home/applenco/thapi-traces/thapi_aggreg--2024-10-11T22:13:12+00:00
[...]

The clean way should be that PTY print the segfault. But I don't know how to do it... It print std err nornaly, but not the segfault message :(

#include <stdio.h>
int main ()
{
  printf ("%s", 'a');
}

Simple segfaulting binary if one want to reproduce.

xprof/xprof.rb.in Outdated Show resolved Hide resolved
@TApplencourt TApplencourt merged commit 1cdaf03 into master Oct 18, 2024
16 checks passed
@Kerilk Kerilk deleted the handle_apps_segfaulting branch October 18, 2024 20:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants