In order to print unicode characters with llvm, I used setLocale in llvm ir:<br><br> call i8* @setlocale(i32 6, i8* getelementptr inbounds ([1 x i8]* @pe, i32 0, i32 0)) nounwind<br><br>where @pe is defined as follows:<br>
<br> @pe = private unnamed_addr constant [1 x i8] zeroinitializer, align 1<br><br>However, I got the following error:<br><br> *** glibc detected *** ./test/bin/executable: free(): invalid next size (fast): 0x08f93140 ***<br>
<br>I used gdb to debug the program and the backtrace is as follows:<br><br> #0 0xb7728424 in __kernel_vsyscall ()<br> #1 0xb74aee71 in raise () from /lib/i386-linux-gnu/libc.so.6<br> #2 0xb74b234e in abort () from /lib/i386-linux-gnu/libc.so.6<br>
#3 0xb74e5577 in ?? () from /lib/i386-linux-gnu/libc.so.6<br> #4 0xb74ef961 in ?? () from /lib/i386-linux-gnu/libc.so.6<br> #5 0xb74f128b in ?? () from /lib/i386-linux-gnu/libc.so.6<br> #6 0xb74f441d in free () from /lib/i386-linux-gnu/libc.so.6<br>
#7 0xb74a6730 in ?? () from /lib/i386-linux-gnu/libc.so.6<br> #8 0xb74a5299 in ?? () from /lib/i386-linux-gnu/libc.so.6<br> #9 0xb74a4cd1 in setlocale () from /lib/i386-linux-gnu/libc.so.6<br> ...<br><br>How can I resolve this issue? Any help would be appreciated<br>