ykjit / yk

yk packages
https://ykjit.github.io/yk/
Other
31 stars 7 forks source link

Bug in compressed return logic? #874

Open vext01 opened 1 year ago

vext01 commented 1 year ago

On one occasion we saw:

19:44:38 ---- lang_tests::unroll_safe_implies_noinline.c stderr ----
19:44:38 
19:44:38 Pattern (error at line 2):
19:44:38    |...
19:44:38 >> |--- Begin aot ---
19:44:38    |...
19:44:38    |call void @never_aot_inline(i32 noundef ...
19:44:38    |...
19:44:38    ...
19:44:38 
19:44:38 Text (error at line 4):
19:44:38    |thread '<unnamed>' panicked at hwtracer/src/pt/ykpt/mod.rs:453:13:
19:44:38    |assertion failed: taken
19:44:38    |note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
19:44:38 >> |fatal runtime error: failed to initiate panic, error 5
19:44:38 
19:44:38 ---- lang_tests::unroll_safe_implies_noinline.c stdout ----

Suggest we expected a compressed return, but the chip did not?

ltratt commented 1 year ago

I've now seen this happen in the call_args test:

---- lang_tests::call_args.c stderr ----                                        

Pattern (error at line 4):                                                      
   |jit-state: start-tracing                                                    
   |3: 5                                                                        
   |jit-state: stop-tracing                                                     
>> |--- Begin jit-pre-opt ---                                                   
   |...                                                                         
   |%{{res}} = add nsw i32...                                                   
   |...                                                                         
   ...                                                                          

Text (error at line 4):
   |jit-state: start-tracing
   |3: 5
   |jit-state: stop-tracing
>> |thread '<unnamed>' panicked at hwtracer/src/pt/ykpt/mod.rs:449:13:
   |assertion failed: taken
   |stack backtrace: 
   |   0:     0x7f4aaf593a8c - std::backtrace_rs::backtrace::libunwind::trace::h
9181ffa9c3d4a750
   ...

So there is definitely something going on here. [I was doing a long-running try_repeat for something else, which is why I stumbled on this.]

vext01 commented 12 months ago

This was erroneously closed.

vext01 commented 12 months ago

For the benefit of future me, Just wanted to link a relevant conversation I had with Markus:

https://github.com/intel/libipt/issues/104

vext01 commented 11 months ago

This was erroneously closed.

vext01 commented 9 months ago

Oddly enough, the assertion failure mentioned above has been seen in the wild when compressed returns are disabled! https://github.com/ykjit/yk/pull/954#issuecomment-1926892063

I wonder if the bug is elsewhere, but only manifests sometimes when we are looking at a later TNT packet...