mull icon indicating copy to clipboard operation
mull copied to clipboard

Mull corrupted LLVM module

Open JaroslavHavrda opened this issue 2 years ago • 11 comments

I tried using mull against our codebase and got this error:

[error] Uh oh! Mull corrupted LLVM module. 28/56: matrixmultiply, anyhow, proc-macro2, wide, num-traits(build), typenum, cxx(build.rs), link-cplusplus(build.rs) Please, report the following error message here https://github.com/mull-project/mull/issues Underlying error message: Instruction does not dominate all uses! %157 = call zeroext i1 @ZN19kr2rc_api_internals5Timex8soonerEqERK8timespecS3(%struct.timespec* nonnull align 8 dereferenceable(16) %8, %struct.timespec* nonnull align 8 dereferenceable(16) %20), !dbg !17016 %160 = phi i1 [ %157, %158 ], [ %157, %150 ], !dbg !17017

The module was corrupted by 'cxx_logical_and_to_or' mutator. To disable it, add the following: ignoreMutators:

  • cxx_logical_and_to_or

build command was: catkin_make -DCMAKE_CXX_FLAGS="-O0 -fexperimental-new-pass-manager -fpass-plugin=/usr/lib/mull-ir-frontend-12 -g -grecord-command-line -fprofile-instr-generate -fcoverage-mapping" install

JaroslavHavrda avatar Jun 16 '22 11:06 JaroslavHavrda

Hi @JaroslavHavrda, I guess this is a private codebase from which I cannot get a small reproducer to fix the underlying issue? 😄

AlexDenisov avatar Jun 16 '22 17:06 AlexDenisov

Hi @AlexDenisov Yes, it is private codebase. I will try to create a reproducer, but please be patient with me. I am a bit overloaded right now.

JaroslavHavrda avatar Jun 21 '22 07:06 JaroslavHavrda

reproducer.zip

Command to build: cmake -DCMAKE_CXX_FLAGS="-O0 -fexperimental-new-pass-manager -fpass-plugin=/usr/lib/mull-ir-frontend-12 -g -grecord-command-line -fprofile-instr-generate -fcoverage-mapping" .. make

JaroslavHavrda avatar Jun 21 '22 12:06 JaroslavHavrda

Hi @JaroslavHavrda, thank you so much for creating the reproducer, though the archive appears to be empty? 😅

AlexDenisov avatar Jun 22 '22 06:06 AlexDenisov

kr2_rc_api.zip Sorry this was my fuckup with using zip command in linux. I created the zipfile on windows and now it is not empty. I hope it is good now,

JaroslavHavrda avatar Jun 22 '22 10:06 JaroslavHavrda

If not, I will just copy source files here.

JaroslavHavrda avatar Jun 22 '22 10:06 JaroslavHavrda

@JaroslavHavrda I can see it now, thanks! 🎉

AlexDenisov avatar Jun 22 '22 10:06 AlexDenisov

Oddly, I cannot reproduce it on macOS 😞

AlexDenisov avatar Jul 24 '22 09:07 AlexDenisov

Hmm. The reproducer works fine right now, whole codebase does not. There is something more I need to dig into.

JaroslavHavrda avatar Jul 25 '22 12:07 JaroslavHavrda

@JaroslavHavrda please, keep in mind that this mutator is experimental and is not recommended for production usage (yes, the documentation on this one should be improved and we should probably issue a warning in such cases).

AlexDenisov avatar Jul 25 '22 14:07 AlexDenisov

I found some pointer -- seems that the problem disappeared when switching between vanilla cmake and catkin_make (http://wiki.ros.org/catkin/commands/catkin_make). We are moving away from catkin_make to vanilla cmake anyway, so I this is no issue for me. I am not sure is troubleshooting build system that is being phased away -- even ROS is switching build system -- is valuable, so I am ok with closing this issue. But if you want to troubleshoot it, I will prepare catkin_make reproducer for you.

P.S. I am not using mull in production. I am just checking what the framework can give me.

JaroslavHavrda avatar Jul 27 '22 08:07 JaroslavHavrda

I added a warning to prevent enabling of experimental features unintentionally https://github.com/mull-project/mull/pull/1008.

AlexDenisov avatar Aug 27 '22 21:08 AlexDenisov