JIT crashing when compiling source code with Clang and -mretpoline flag

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

JIT crashing when compiling source code with Clang and -mretpoline flag

Nathan Ridge via cfe-dev

Heyho both Mailinglists,

 

I'm not sure if I encountered a bug or if I'm doing something wrong. I compiled a "Hello World"-function with Clang to LLVM-IR code, while passing the "-mretpoline" flag.

 

I tried jitting and calling that function with the KaleidoscopeJIT code, but when calling "lookup" for that function the application crashed.

I also tried that file in an old MCJIT implementation I had - there the application crashed when calling the function (but it does find the address for the function first).

 

If I recompile my code without the "-mretpoline" flag, everything works fine again.

I compiled Clang and the LLVM files from the LLVM8 source files, I run them under Windows7 64bit. Any ideas what might went wrong?

 

Kind greetings

Björn

Als GmbH eingetragen im Handelsregister Bad Homburg v.d.H. HRB 9816, USt.ID-Nr. DE 114 165 789 Geschäftsführer: Dr. Hiroshi Nakamura, Dr. Robert Plank, Markus Bode, Heiko Lampert, Takashi Nagano, Takeshi Fukushima. Junichi Tajika
_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: JIT crashing when compiling source code with Clang and -mretpoline flag

Nathan Ridge via cfe-dev

No experiences, opinions or thoughts on this? :c

 

 

From: cfe-dev <[hidden email]> On Behalf Of Gaier, Bjoern via cfe-dev
Sent: Freitag, 28. Juni 2019 07:52
To: llvm-dev <[hidden email]>; [hidden email]
Subject: [cfe-dev] JIT crashing when compiling source code with Clang and -mretpoline flag

 

Heyho both Mailinglists,

 

I'm not sure if I encountered a bug or if I'm doing something wrong. I compiled a "Hello World"-function with Clang to LLVM-IR code, while passing the "-mretpoline" flag.

 

I tried jitting and calling that function with the KaleidoscopeJIT code, but when calling "lookup" for that function the application crashed.

I also tried that file in an old MCJIT implementation I had - there the application crashed when calling the function (but it does find the address for the function first).

 

If I recompile my code without the "-mretpoline" flag, everything works fine again.

I compiled Clang and the LLVM files from the LLVM8 source files, I run them under Windows7 64bit. Any ideas what might went wrong?

 

Kind greetings

Björn

 

Als GmbH eingetragen im Handelsregister Bad Homburg v.d.H. HRB 9816, USt.ID-Nr. DE 114 165 789 Geschäftsführer: Dr. Hiroshi Nakamura, Dr. Robert Plank, Markus Bode, Heiko Lampert, Takashi Nagano, Takeshi Fukushima. Junichi Tajika

Als GmbH eingetragen im Handelsregister Bad Homburg v.d.H. HRB 9816, USt.ID-Nr. DE 114 165 789 Geschäftsführer: Dr. Hiroshi Nakamura, Dr. Robert Plank, Markus Bode, Heiko Lampert, Takashi Nagano, Takeshi Fukushima. Junichi Tajika
_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: JIT crashing when compiling source code with Clang and -mretpoline flag

Nathan Ridge via cfe-dev
You are also doing two things that are novel:
- using retpoline on JITed code (I think)
- doing it on Windows

So far as I know, you are the first person to do either of those things, so no one is going to have any experience to share. I believe retpoline has primarily been used in the kernel space, mainly for Linux, which uses ELF.

Finally, you haven't provided much info beyond "the application crashed", so even if someone was generous enough to try to diagnose the problem remotely over email, there are no clues to analyze. I think you'll have to debug things much further to get a useful response.

On Mon, Jul 15, 2019 at 1:48 AM Gaier, Bjoern via cfe-dev <[hidden email]> wrote:

No experiences, opinions or thoughts on this? :c

 

 

From: cfe-dev <[hidden email]> On Behalf Of Gaier, Bjoern via cfe-dev
Sent: Freitag, 28. Juni 2019 07:52
To: llvm-dev <[hidden email]>; [hidden email]
Subject: [cfe-dev] JIT crashing when compiling source code with Clang and -mretpoline flag

 

Heyho both Mailinglists,

 

I'm not sure if I encountered a bug or if I'm doing something wrong. I compiled a "Hello World"-function with Clang to LLVM-IR code, while passing the "-mretpoline" flag.

 

I tried jitting and calling that function with the KaleidoscopeJIT code, but when calling "lookup" for that function the application crashed.

I also tried that file in an old MCJIT implementation I had - there the application crashed when calling the function (but it does find the address for the function first).

 

If I recompile my code without the "-mretpoline" flag, everything works fine again.

I compiled Clang and the LLVM files from the LLVM8 source files, I run them under Windows7 64bit. Any ideas what might went wrong?

 

Kind greetings

Björn

 

Als GmbH eingetragen im Handelsregister Bad Homburg v.d.H. HRB 9816, USt.ID-Nr. DE 114 165 789 Geschäftsführer: Dr. Hiroshi Nakamura, Dr. Robert Plank, Markus Bode, Heiko Lampert, Takashi Nagano, Takeshi Fukushima. Junichi Tajika

Als GmbH eingetragen im Handelsregister Bad Homburg v.d.H. HRB 9816, USt.ID-Nr. DE 114 165 789 Geschäftsführer: Dr. Hiroshi Nakamura, Dr. Robert Plank, Markus Bode, Heiko Lampert, Takashi Nagano, Takeshi Fukushima. Junichi Tajika
_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev

_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev