Why this seg fault

With this pass, I am able to get topic of message_arrived on a demo cpp file,


bool CPSTracker::runOnModule(Module &M) {
	
	LLVMContext &context = M.getContext();
        // Defining the printf function
	Type *intType = Type::getInt32Ty(context);
        std::vector<Type *> printfArgsTypes({Type::getInt8PtrTy(context)});
        FunctionType *printfType = FunctionType::get(intType, printfArgsTypes, true);
        auto printfFunc = M.getOrInsertFunction("printf", printfType);

	for (auto &F:M){
		int i=0;
		std::vector<std::string> arg_strings;
		std::vector<Value*> arg_values; // used to store functions argument values
		std::string s;
                raw_string_ostream rso(s);
		rso << F.getName() << " ";
		arg_strings.push_back(rso.str());
		// Marking how many values a function has 
		for(auto i = F.arg_begin();i!=F.arg_end();++i){
			rso << *i <<"\n";
			arg_strings.push_back(rso.str());
			arg_values.push_back(i);
		}
	
		//if(F.getName().contains("message_arrived") || F.getName().contains("publish") || F.getName().contains("connection_lost") || F.getName().contains("delivery_complete")){
		//if(F.getName().contains("message_arrived")){
		//if(F.getName() == "_ZN4mqtt8callback15message_arrivedESt10shared_ptrIKNS_7messageEE"){ // worked
		if(F.getName() == "_ZN8callback15message_arrivedESt10shared_ptrIKN4mqtt7messageEE"){
			// If a function is declared then it will not have basic blocks in them. So, if a function is not delcared then it will have basic block, which I need to insert printf
			if(!F.isDeclaration()){
				auto &BB = F.getEntryBlock();        
				std::vector<std::string> arguments; // This vector will be used to store functions arguments name
				BasicBlock::iterator IP = BB.getFirstInsertionPt();
				IRBuilder<> builder(&(*IP));
				
				{
					// using the format specifier for printing the values
					std::string format("arg_values: ");
					for (size_t i = 0; i < arg_values.size(); ++i) {
						format += "%s\n";
					}
					Value *str = builder.CreateGlobalStringPtr(format, "");
					std::vector<Value *> argsV({str});

					outs()<<"\nFunction name:"<<F.getName()<<"\n";
				
					for (auto &v : arg_values) {
						outs()<<"Just v:"<< *v <<"\n";
						if(v->getType()->isPointerTy()){
							outs()<<"Pointer type:"<< *v->getType() <<"\n";
							auto containedType = v->getType()->getContainedType(0);
							outs()<<"Contained type(0): "<<*v->getType()->getContainedType(0)<<"\n";
							outs()<<"Contained type is struct type: "<<containedType->isStructTy()<<"\n";
							outs()<<"Contained contained type: "<<*containedType->getContainedType(0)<<"\n";
							outs()<<"Contained contained type struct: "<<containedType->getContainedType(0)->isStructTy()<<"\n";
							if (containedType->getStructName().startswith("class.std::shared_ptr")) {
								// This part checks if v is an actual object, not necessarily required here, but yet given to ensure the type of v
								outs()<<"Contained Pointer Struct name: "<<containedType->getContainedType(0)->getStructName()<<"\n";
								// trying to print the pointer shared pointer is pointing to 
								assert(containedType->getContainedType(0));
								// Now getting the contained types and it's shared pointers like following,
								// Contained Pointer Type:%"class.std::__shared_ptr.113" = type { %"class.mqtt::delivery_token"*, %"class.std::__shared_count" }
								Type *containedPointerType = containedType->getContainedType(0);
								outs()<< "Contained Pointer Type:" << *containedPointerType <<"\n";
								assert(containedPointerType->isStructTy());
								outs()<<"First type: "<< *containedPointerType->getContainedType(0)<<"\n";
								// So, the 1st type of 1st pointer is extracted, looks like -  %"class.mqtt::delivery_token"*
								Type *firstType = containedPointerType->getContainedType(0);
								assert(firstType->isPointerTy());

								// Now, getting the pointer to the %"class.mqtt::message"*
								outs()<<"v type to pointerElement type:"<<*v->getType()->getPointerElementType()<<"\n";
								outs()<<"firstType pointer element type: "<<*firstType->getPointerElementType()<<"\n";
								//auto* sharedPtrAccessType = StructType::getTypeByName(context, "class.std::__shared_ptr_access.14");
                                                                // For testbed shared pointer is "class.std::__shared_ptr_access.43"
                                                                auto* sharedPtrAccessType = StructType::getTypeByName(context,"class.std::__shared_ptr_access.43");
								if(sharedPtrAccessType){
									//if(sharedPtrAccessPointerType != null){  // CHECK IF IT'S NULL
									outs()<<"sharedPtrAccessType: "<<*sharedPtrAccessType<<"\n";
									auto* sharedPtrAccessPointerType = PointerType::getUnqual(sharedPtrAccessType);
									outs()<<"sharedPtrAccessPointerType: "<<*sharedPtrAccessPointerType<<"\n";
									//auto* sharedPtrAccessPointerType = PointerType::getUnqual("class.std::__shared_ptr_access.14");
									if(sharedPtrAccessPointerType){
										auto* bitcast = builder.CreateBitCast(v, sharedPtrAccessPointerType, "bitcast");
										
										// JUST CALLING SAME FUNCTIONS LIKE MQTT DOES
										llvm::Function* mqttMsgFn = F.getParent()->getFunction("_ZNKSt19__shared_ptr_accessIKN4mqtt7messageELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv");
										if(mqttMsgFn){
											assert(mqttMsgFn);
											Value *msgClass = builder.CreateCall(mqttMsgFn, bitcast);
											//argsV.push_back(msgClass);
											outs()<<"msgClass: "<< *msgClass <<"\n";

											llvm::Function* getTopicFn = F.getParent()->getFunction("_ZNK4mqtt7message9get_topicB5cxx11Ev");
											Value *topicStrPtr = builder.CreateCall(getTopicFn, msgClass);
											outs()<<"topic from msg:"<< *topicStrPtr <<"\n";
											//auto* topicStr = builder.CreatePointerCast(topicStrPtr, Type::getInt8PtrTy(context));
											//argsV.push_back(topicStrPtr);
											
											// Calling the present c_str()
											llvm::Function* c_str = F.getParent()->getFunction("_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv");
											if(c_str != nullptr){
												Value *topicStr = builder.CreateCall(c_str, topicStrPtr);
												if(topicStr)
													argsV.push_back(topicStr);
												i++;
											}

										}
									}
								}
							}
							else{
								//llvm::Value *loadedValue = builder.CreateLoad(v->getType()->getPointerElementType(),v);
								//outs()<<"loadedValue: "<<*loadedValue<<"\n";
					                	//argsV.push_back(loadedValue);
								argsV.push_back(builder.CreateGlobalStringPtr("This is msg part 1", ""));
							}
							continue;
							outs()<<"continuing\n";
					        }
						//argsV.push_back(v);
						argsV.push_back(builder.CreateGlobalStringPtr("not inserting v this time", ""));
					}
					builder.CreateCall(printfFunc, argsV, "calltmp"); 
					outs()<<"called printf\n";
					outs()<<"i: "<<i<<"\n";
					if(i>=1)break;
				}
			}
		}
	}
    	return true;
}

Only the structType was different StructType::getTypeByName(context,"class.std::__shared_ptr_access.43");

But whenever I am trying to compile a source code with the pass: txt_training_factory/main.cpp at 27526cc803ebfcecd1163de31f0e3c6d25f65ca8 · fischertechnik/txt_training_factory · GitHub

I am getting this error,

Function name:_ZN8callback15message_arrivedESt10shared_ptrIKN4mqtt7messageEE
Just v:%class.callback* %0
Pointer type:%class.callback*
Contained type(0): %class.callback = type { %"class.mqtt::callback", %"class.ft::TxtMqttFactoryClient"*, %"class.ft::TxtHighBayWarehouse"* }
Contained type is struct type: 1
Contained contained type: %"class.mqtt::callback" = type { i32 (...)** }
Contained contained type struct: 1
Just v:%"class.std::shared_ptr.41"* %1
Pointer type:%"class.std::shared_ptr.41"*
Contained type(0): %"class.std::shared_ptr.41" = type { %"class.std::__shared_ptr.42" }
Contained type is struct type: 1
Contained contained type: %"class.std::__shared_ptr.42" = type { %"class.mqtt::message"*, %"class.std::__shared_count" }
Contained contained type struct: 1
Contained Pointer Struct name: class.std::__shared_ptr.42
Contained Pointer Type:%"class.std::__shared_ptr.42" = type { %"class.mqtt::message"*, %"class.std::__shared_count" }
First type: %"class.mqtt::message"*
v type to pointerElement type:%"class.std::shared_ptr.41" = type { %"class.std::__shared_ptr.42" }
firstType pointer element type: %"class.mqtt::message" = type { %struct.MQTTAsync_message, %"class.mqtt::buffer_ref", %"class.mqtt::buffer_ref" }
sharedPtrAccessType: %"class.std::__shared_ptr_access.43" = type { i8 }
sharedPtrAccessPointerType: %"class.std::__shared_ptr_access.43"*
msgClass:   %4 = call %"class.mqtt::message"* @_ZNKSt19__shared_ptr_accessIKN4mqtt7messageELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(%"class.std::__shared_ptr_access.43"* %3)
topic from msg:  %5 = call %"class.std::__cxx11::basic_string"* @_ZNK4mqtt7message9get_topicB5cxx11Ev(%"class.mqtt::message"* %4)
c_str(): ; Function Attrs: mustprogress nounwind
define available_externally noundef i8* @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(%"class.std::__cxx11::basic_string"* noundef nonnull align 4 dereferenceable(24) %0) #10 align 2 !dbg !29244 {
  call void @llvm.dbg.value(metadata %"class.std::__cxx11::basic_string"* %0, metadata !29246, metadata !DIExpression()), !dbg !29247
  %2 = call noundef i8* @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE7_M_dataEv(%"class.std::__cxx11::basic_string"* noundef nonnull align 4 dereferenceable(24) %0), !dbg !29248
  ret i8* %2, !dbg !29249
}

called printf
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0.	Program arguments: clang++-14 --target=arm-linux-gnueabihf -flegacy-pass-manager -g -Xclang -load -Xclang /home/u18new/LLVM_PASSES/LogPasses-new/messagePublishFunc/TopicExtraction/mqtt/instrument.so -std=gnu++0x -std=c++0x -DENDIAN_LITTLE -ITxtSmartFactoryLib/include -ITxtSmartFactoryLib/libs -Ideps/include -O3 -Wall -c -fmessage-length=0 -Wno-psabi -DCLIENT_HBW -fPIC -MMD -MP -MFbin/TxtFactoryHBW -MTTxtFactoryClient/HBW_Release/src/main.d -o TxtFactoryClient/HBW_Release/src/main.o TxtFactoryClient/src/main.cpp
1.	<eof> parser at end of file
2.	Code generation
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
/usr/lib/x86_64-linux-gnu/libLLVM-14.so.1(_ZN4llvm3sys15PrintStackTraceERNS_11raw_ostreamEi+0x31)[0x7f21603a66a1]
/usr/lib/x86_64-linux-gnu/libLLVM-14.so.1(_ZN4llvm3sys17RunSignalHandlersEv+0xee)[0x7f21603a43ee]
/usr/lib/x86_64-linux-gnu/libLLVM-14.so.1(_ZN4llvm3sys15CleanupOnSignalEm+0x100)[0x7f21603a5a60]
/usr/lib/x86_64-linux-gnu/libLLVM-14.so.1(+0xd7a1bf)[0x7f21602d21bf]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x12980)[0x7f216967c980]
/usr/lib/x86_64-linux-gnu/libLLVM-14.so.1(_ZNK4llvm3DIE10getUnitDieEv+0x10)[0x7f2160c3d610]
/usr/lib/x86_64-linux-gnu/libLLVM-14.so.1(_ZN4llvm10DwarfDebug18finalizeModuleInfoEv+0xcc)[0x7f2160c52bac]
/usr/lib/x86_64-linux-gnu/libLLVM-14.so.1(_ZN4llvm10DwarfDebug9endModuleEv+0x146)[0x7f2160c53376]
/usr/lib/x86_64-linux-gnu/libLLVM-14.so.1(_ZN4llvm10AsmPrinter14doFinalizationERNS_6ModuleE+0x788)[0x7f2160c25c48]
/usr/lib/x86_64-linux-gnu/libLLVM-14.so.1(_ZN4llvm13FPPassManager14doFinalizationERNS_6ModuleE+0x31)[0x7f21604e82d1]
/usr/lib/x86_64-linux-gnu/libLLVM-14.so.1(_ZN4llvm6legacy15PassManagerImpl3runERNS_6ModuleE+0x1491)[0x7f21604e2311]
/usr/lib/x86_64-linux-gnu/libclang-cpp.so.14(_ZN5clang17EmitBackendOutputERNS_17DiagnosticsEngineERKNS_19HeaderSearchOptionsERKNS_14CodeGenOptionsERKNS_13TargetOptionsERKNS_11LangOptionsEN4llvm9StringRefEPNSE_6ModuleENS_13BackendActionESt10unique_ptrINSE_17raw_pwrite_streamESt14default_deleteISK_EE+0x3489)[0x7f21676d7719]
/usr/lib/x86_64-linux-gnu/libclang-cpp.so.14(+0x1b89c01)[0x7f21679fbc01]
/usr/lib/x86_64-linux-gnu/libclang-cpp.so.14(_ZN5clang8ParseASTERNS_4SemaEbb+0x244)[0x7f2166877054]
/usr/lib/x86_64-linux-gnu/libclang-cpp.so.14(_ZN5clang13CodeGenAction13ExecuteActionEv+0xb1)[0x7f21679f7f51]
/usr/lib/x86_64-linux-gnu/libclang-cpp.so.14(_ZN5clang14FrontendAction7ExecuteEv+0x67)[0x7f2168399727]
/usr/lib/x86_64-linux-gnu/libclang-cpp.so.14(_ZN5clang16CompilerInstance13ExecuteActionERNS_14FrontendActionE+0x336)[0x7f21682f0d86]
/usr/lib/x86_64-linux-gnu/libclang-cpp.so.14(_ZN5clang25ExecuteCompilerInvocationEPNS_16CompilerInstanceE+0x29b)[0x7f2168412e8b]
clang++-14(_Z8cc1_mainN4llvm8ArrayRefIPKcEES2_Pv+0x98f)[0x41329f]
clang++-14[0x4114dc]
/usr/lib/x86_64-linux-gnu/libclang-cpp.so.14(+0x20fc392)[0x7f2167f6e392]
/usr/lib/x86_64-linux-gnu/libLLVM-14.so.1(_ZN4llvm20CrashRecoveryContext9RunSafelyENS_12function_refIFvvEEE+0xdd)[0x7f21602d1f2d]
/usr/lib/x86_64-linux-gnu/libclang-cpp.so.14(_ZNK5clang6driver10CC1Command7ExecuteEN4llvm8ArrayRefINS2_8OptionalINS2_9StringRefEEEEEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPb+0x140)[0x7f2167f6de80]
/usr/lib/x86_64-linux-gnu/libclang-cpp.so.14(_ZNK5clang6driver11Compilation14ExecuteCommandERKNS0_7CommandERPS3_+0x3f3)[0x7f2167f35693]
/usr/lib/x86_64-linux-gnu/libclang-cpp.so.14(_ZNK5clang6driver11Compilation11ExecuteJobsERKNS0_7JobListERN4llvm15SmallVectorImplISt4pairIiPKNS0_7CommandEEEE+0x8a)[0x7f2167f3591a]
/usr/lib/x86_64-linux-gnu/libclang-cpp.so.14(_ZN5clang6driver6Driver18ExecuteCompilationERNS0_11CompilationERN4llvm15SmallVectorImplISt4pairIiPKNS0_7CommandEEEE+0x1a7)[0x7f2167f4f407]
clang++-14(main+0x2816)[0x410f46]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xe7)[0x7f215e7c5c87]
clang++-14(_start+0x2a)[0x40e3da]
clang: error: clang frontend command failed with exit code 139 (use -v to see invocation)
Ubuntu clang version 14.0.6
Target: arm-unknown-linux-gnueabihf
Thread model: posix
InstalledDir: /usr/bin
clang: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang: note: diagnostic msg: /tmp/main-8aa263.cpp
clang: note: diagnostic msg: /tmp/main-8aa263.sh
clang: note: diagnostic msg: 

********************
Makefile:191: recipe for target 'bin/TxtFactoryHBW' failed
make: *** [bin/TxtFactoryHBW] Error 139

Gettting the error at this line: txt_training_factory/Makefile at master · fischertechnik/txt_training_factory · GitHub

Compiled the IR with the pass,

$ clang++-14 --target=arm-linux-gnueabihf $COMPILER_FLAGS_RELEASE -D"CLIENT_HBW" -fPIC -MMD -MP -o "TxtFactoryClient/HBW_Release/src/main.ll" -S -emit-llvm TxtFactoryClient/src/main.cpp
TxtFactoryClient/src/main.cpp:54:28: warning: private field 'cli_' is not used [-Wunused-private-field]
        ft::TxtMqttFactoryClient& cli_;
                                  ^
1 warning generated.

And got this,

$ llc-14 TxtFactoryClient/HBW_Release/src/main-with_pass.ll 
!dbg attachment points at wrong subprogram for function
!86022 = distinct !DISubprogram(name: "message_arrived", linkageName: "_ZN8callback15message_arrivedESt10shared_ptrIKN4mqtt7messageEE", scope: !21987, file: !771, line: 83, type: !22164, scopeLine: 83, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !770, declaration: !22163, retainedNodes: !86023)
void (%class.callback*, %"class.std::shared_ptr.41"*)* @_ZN8callback15message_arrivedESt10shared_ptrIKN4mqtt7messageEE
  %6 = getelementptr %"class.std::shared_ptr.41", %"class.std::shared_ptr.41"* %1, i32 0, i32 0, i32 0, !dbg !86059
!86059 = !DILocation(line: 1258, column: 16, scope: !86060, inlinedAt: !86063)
!86069 = distinct !DISubprogram(name: "operator->", linkageName: "_ZNKSt19__shared_ptr_accessIKN4mqtt7messageELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv", scope: !20731, file: !17969, line: 966, type: !20744, scopeLine: 967, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !770, declaration: !20743, retainedNodes: !86070)
!86069 = distinct !DISubprogram(name: "operator->", linkageName: "_ZNKSt19__shared_ptr_accessIKN4mqtt7messageELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv", scope: !20731, file: !17969, line: 966, type: !20744, scopeLine: 967, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !770, declaration: !20743, retainedNodes: !86070)
conflicting debug info for argument
  call void @llvm.dbg.value(metadata %"class.mqtt::message"* %7, metadata !86077, metadata !DIExpression()), !dbg !86085
!86071 = !DILocalVariable(name: "this", arg: 1, scope: !86069, type: !86067, flags: DIFlagArtificial | DIFlagObjectPointer)
!86077 = !DILocalVariable(name: "this", arg: 1, scope: !86078, type: !86084, flags: DIFlagArtificial | DIFlagObjectPointer)
conflicting debug info for argument
  call void @llvm.dbg.value(metadata %"class.std::__cxx11::basic_string"* %11, metadata !28956, metadata !DIExpression()), !dbg !86099
!86077 = !DILocalVariable(name: "this", arg: 1, scope: !86078, type: !86084, flags: DIFlagArtificial | DIFlagObjectPointer)
!28956 = !DILocalVariable(name: "this", arg: 1, scope: !28957, type: !21145, flags: DIFlagArtificial | DIFlagObjectPointer)
conflicting debug info for argument
  call void @llvm.dbg.value(metadata %class.callback* %0, metadata !86024, metadata !DIExpression()), !dbg !86113
!28956 = !DILocalVariable(name: "this", arg: 1, scope: !28957, type: !21145, flags: DIFlagArtificial | DIFlagObjectPointer)
!86024 = !DILocalVariable(name: "this", arg: 1, scope: !86022, type: !32116, flags: DIFlagArtificial | DIFlagObjectPointer)
warning: ignoring invalid debug info in TxtFactoryClient/HBW_Release/src/main-with_pass.ll

Any suggestion on why I am getting the segfault,

PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0.	Program arguments: clang++-14 --target=arm-linux-gnueabihf -flegacy-pass-manager -g -Xclang -load -Xclang /home/u18new/LLVM_PASSES/LogPasses-new/messagePublishFunc/TopicExtraction/mqtt/instrument.so -std=gnu++0x -std=c++0x -DENDIAN_LITTLE -ITxtSmartFactoryLib/include -ITxtSmartFactoryLib/libs -Ideps/include -O3 -Wall -c -fmessage-length=0 -Wno-psabi -DCLIENT_HBW -fPIC -MMD -MP -MFbin/TxtFactoryHBW -MTTxtFactoryClient/HBW_Release/src/main.d -o TxtFactoryClient/HBW_Release/src/main.o TxtFactoryClient/src/main.cpp
1.	<eof> parser at end of file
2.	Code generation
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
/usr/lib/x86_64-linux-gnu/libLLVM-14.so.1(_ZN4llvm3sys15PrintStackTraceERNS_11raw_ostreamEi+0x31)[0x7f21603a66a1]
/usr/lib/x86_64-linux-gnu/libLLVM-14.so.1(_ZN4llvm3sys17RunSignalHandlersEv+0xee)[0x7f21603a43ee]
/usr/lib/x86_64-linux-gnu/libLLVM-14.so.1(_ZN4llvm3sys15CleanupOnSignalEm+0x100)[0x7f21603a5a60]
/usr/lib/x86_64-linux-gnu/libLLVM-14.so.1(+0xd7a1bf)[0x7f21602d21bf]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x12980)[0x7f216967c980]
/usr/lib/x86_64-linux-gnu/libLLVM-14.so.1(_ZNK4llvm3DIE10getUnitDieEv+0x10)[0x7f2160c3d610]
/usr/lib/x86_64-linux-gnu/libLLVM-14.so.1(_ZN4llvm10DwarfDebug18finalizeModuleInfoEv+0xcc)[0x7f2160c52bac]
/usr/lib/x86_64-linux-gnu/libLLVM-14.so.1(_ZN4llvm10DwarfDebug9endModuleEv+0x146)[0x7f2160c53376]
/usr/lib/x86_64-linux-gnu/libLLVM-14.so.1(_ZN4llvm10AsmPrinter14doFinalizationERNS_6ModuleE+0x788)[0x7f2160c25c48]
/usr/lib/x86_64-linux-gnu/libLLVM-14.so.1(_ZN4llvm13FPPassManager14doFinalizationERNS_6ModuleE+0x31)[0x7f21604e82d1]
/usr/lib/x86_64-linux-gnu/libLLVM-14.so.1(_ZN4llvm6legacy15PassManagerImpl3runERNS_6ModuleE+0x1491)[0x7f21604e2311]
/usr/lib/x86_64-linux-gnu/libclang-cpp.so.14(_ZN5clang17EmitBackendOutputERNS_17DiagnosticsEngineERKNS_19HeaderSearchOptionsERKNS_14CodeGenOptionsERKNS_13TargetOptionsERKNS_11LangOptionsEN4llvm9StringRefEPNSE_6ModuleENS_13BackendActionESt10unique_ptrINSE_17raw_pwrite_streamESt14default_deleteISK_EE+0x3489)[0x7f21676d7719]
/usr/lib/x86_64-linux-gnu/libclang-cpp.so.14(+0x1b89c01)[0x7f21679fbc01]
/usr/lib/x86_64-linux-gnu/libclang-cpp.so.14(_ZN5clang8ParseASTERNS_4SemaEbb+0x244)[0x7f2166877054]
/usr/lib/x86_64-linux-gnu/libclang-cpp.so.14(_ZN5clang13CodeGenAction13ExecuteActionEv+0xb1)[0x7f21679f7f51]
/usr/lib/x86_64-linux-gnu/libclang-cpp.so.14(_ZN5clang14FrontendAction7ExecuteEv+0x67)[0x7f2168399727]
/usr/lib/x86_64-linux-gnu/libclang-cpp.so.14(_ZN5clang16CompilerInstance13ExecuteActionERNS_14FrontendActionE+0x336)[0x7f21682f0d86]
/usr/lib/x86_64-linux-gnu/libclang-cpp.so.14(_ZN5clang25ExecuteCompilerInvocationEPNS_16CompilerInstanceE+0x29b)[0x7f2168412e8b]
clang++-14(_Z8cc1_mainN4llvm8ArrayRefIPKcEES2_Pv+0x98f)[0x41329f]
clang++-14[0x4114dc]
/usr/lib/x86_64-linux-gnu/libclang-cpp.so.14(+0x20fc392)[0x7f2167f6e392]
/usr/lib/x86_64-linux-gnu/libLLVM-14.so.1(_ZN4llvm20CrashRecoveryContext9RunSafelyENS_12function_refIFvvEEE+0xdd)[0x7f21602d1f2d]
/usr/lib/x86_64-linux-gnu/libclang-cpp.so.14(_ZNK5clang6driver10CC1Command7ExecuteEN4llvm8ArrayRefINS2_8OptionalINS2_9StringRefEEEEEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPb+0x140)[0x7f2167f6de80]
/usr/lib/x86_64-linux-gnu/libclang-cpp.so.14(_ZNK5clang6driver11Compilation14ExecuteCommandERKNS0_7CommandERPS3_+0x3f3)[0x7f2167f35693]
/usr/lib/x86_64-linux-gnu/libclang-cpp.so.14(_ZNK5clang6driver11Compilation11ExecuteJobsERKNS0_7JobListERN4llvm15SmallVectorImplISt4pairIiPKNS0_7CommandEEEE+0x8a)[0x7f2167f3591a]
/usr/lib/x86_64-linux-gnu/libclang-cpp.so.14(_ZN5clang6driver6Driver18ExecuteCompilationERNS0_11CompilationERN4llvm15SmallVectorImplISt4pairIiPKNS0_7CommandEEEE+0x1a7)[0x7f2167f4f407]
clang++-14(main+0x2816)[0x410f46]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xe7)[0x7f215e7c5c87]
clang++-14(_start+0x2a)[0x40e3da]
clang: error: clang frontend command failed with exit code 139 (use -v to see invocation)
Ubuntu clang version 14.0.6
Target: arm-unknown-linux-gnueabihf
Thread model: posix
InstalledDir: /usr/bin
clang: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang: note: diagnostic msg: /tmp/main-8aa263.cpp
clang: note: diagnostic msg: /tmp/main-8aa263.sh
clang: note: diagnostic msg: 

********************
Makefile:191: recipe for target 'bin/TxtFactoryHBW' failed
make: *** [bin/TxtFactoryHBW] Error 139