Rust program quits without any info

I am working with an app that uses rust lib. I've modified that lib that it causes crash.
I know what I did and it is quite easy for me to fix that problem without seeing any output. But if I was working with somebody's else program that crashed without any output I would have really hard time to find the bug.
How to force the output?
I cannot start debugging the app. Debugging app starts only after attaching it to a running process. Process crashes during the startup phase so I cannot attach to it.

Thank you

This needs more details. Did you use a Rust lib in another language? How were you using it? How did you modify it?

This lib is written in rust. I was using it by including it in cargo.toml in dependencies section. I've modified it by making changes to its source code.

Find out how to start debugger for startup. Why should there be output in all cases?

You know, if you want to get help, you should actually answer the question and provide details, rather than make flippant remarks.

4 Likes

I know how to start debugger. Unfortunately debugging apps that use the cursive library is not that straightforward and you need to attach to them really.

What kind of output are you referring to? The panic message and backtrace printed to the standard error stream? And how is this hypothetical program suppressing the output?

That exactly.
I don't now how that program is suppressing the output. Program is not hypothetical. I'm working on it.

i wanna say running ulimit -c unlimited prior to running your program if you run on linux, to enable core dump save to file for after crash debugging... but not sure if it fits your scenario... (or i understood the problem correctly)

A post before OP mentioned cursive, which does exactly that (not sure how, however).

Ah, that's because it's using ncurses, which hijacks the terminal as part of its functionality, and can't fix it up before Rust attempts to print the panic info. @bart2, can you redirect the stderr stream to a file, as suggested in a relevant GitHub issue?

2 Likes

@LegionMammal978
That looks promising. Let me check and will let you know how it worked for me.

Big thanks!
And thank you to all people who tried to help me with that issue. Thank you!

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.