[fpc-pascal] LLVM crash

Benito van der Zander benito at benibela.de
Thu Aug 10 23:27:13 CEST 2023


Hallo,

i tried to run my program under LLVM (from july fpc)  and it crashes?

Program received signal SIGSEGV, Segmentation fault.
0x000000000042e5f1in SYSTEM_$$_SYSGETMEM_FIXED$QWORD$$POINTER()
(gdb) bt
#0 0x000000000042e5f1in SYSTEM_$$_SYSGETMEM_FIXED$QWORD$$POINTER()
#1 0x000000000041b92ain fpc_ansistr_setlength()
#2 0x0000000000558d52in RESETBUFFER(ABUFFER=0x7fffffffd560, 
BASECAPACITY=130) at bbutils.pas:1650
#3 INIT(ABUFFER=0x7fffffffd560, BASECAPACITY=130, AENCODING=65001) at 
bbutils.pas:1639
#4 STRDECODEHTMLENTITIES(result=0x0, P=<optimized out>, L=130, 
ENCODING=65001, FLAGS=...) at bbutils.pas:5527


anyone has seen sysgetmem crash before?


Perhaps that is exactly the kind of things ASAN was supposed to detect.

But with ASAN, I get an error somewhere entirely else. And I do not 
understand it, because the function is shown as ~ 5000 lines of assembly.

How can I see the mixed code with disassemble /rm in gdb? I tried to 
call fpc -gl, -gs and -gw, and nothing helps


And there are a lot of weird ASAN calls for trivial movs. Like:

0x00000000006f577c<+22204>: 48 8b bb c8 00 00 00 movrdi,QWORDPTR[rbx+0xc8]
0x00000000006f5783<+22211>: e8 18 cc d0 ff 
call0x4023a0<__asan_report_load8 at plt>
0x00000000006f5788<+22216>: e8 13 cc d0 ff 
call0x4023a0<__asan_report_load8 at plt>
0x00000000006f578d<+22221>: e8 0e cc d0 ff 
call0x4023a0<__asan_report_load8 at plt>
0x00000000006f5792<+22226>: e8 09 cc d0 ff 
call0x4023a0<__asan_report_load8 at plt>
0x00000000006f5797<+22231>: 48 89 c7 movrdi,rax
0x00000000006f579a<+22234>: e8 01 cc d0 ff 
call0x4023a0<__asan_report_load8 at plt>
0x00000000006f579f<+22239>: 48 89 cf movrdi,rcx
0x00000000006f57a2<+22242>: e8 09 ca d0 ff 
call0x4021b0<__asan_report_store8 at plt>


Are they supposed to be there?


Viele Grüße,

Benito

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20230810/ab4595e4/attachment-0001.htm>


More information about the fpc-pascal mailing list