drmortalwombat / oscar64

Optimizing Small memory C Compiler Assembler and Runtime for C64
GNU General Public License v3.0
273 stars 24 forks source link

segfault easyflash*: nblock=NULL #46

Closed polluks closed 9 months ago

polluks commented 9 months ago

$ gdb ../../bin/oscar64
GNU gdb (Debian 8.2.1-2+b3) 8.2.1
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ../../bin/oscar64...done.
(gdb) r easyflash.c -n -tf=crt
Starting program: /home/stefan/g/oscar64/bin/oscar64 easyflash.c -n -tf=crt
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".

Program received signal SIGSEGV, Segmentation fault.
0x000000000809b8a6 in NativeCodeBasicBlock::OptimizeXYSpilling (this=0x8f93e40)
    at ../oscar64/NativeCodeGenerator.cpp:34197
34197                           if (nblock->mEntryBlocks.Size() == 1 && !pblock->mFalseJump && ps > 0)
(gdb) bt
#0  0x000000000809b8a6 in NativeCodeBasicBlock::OptimizeXYSpilling (
    this=0x8f93e40) at ../oscar64/NativeCodeGenerator.cpp:34197
#1  0x000000000809b289 in NativeCodeBasicBlock::OptimizeXYSpilling (
    this=0x8f8be60) at ../oscar64/NativeCodeGenerator.cpp:34277
#2  0x000000000809b289 in NativeCodeBasicBlock::OptimizeXYSpilling (
    this=0x8f7bea0) at ../oscar64/NativeCodeGenerator.cpp:34277
#3  0x00000000080f9e0a in NativeCodeBasicBlock::OptimizeXYSpilling (
    this=<optimized out>) at ../oscar64/NativeCodeGenerator.cpp:34183
#4  NativeCodeProcedure::Optimize (this=0x8f60420)
    at ../oscar64/NativeCodeGenerator.cpp:46878
#5  0x00000000080fa6f5 in NativeCodeProcedure::Compile (
    this=this@entry=0x8f60420, proc=proc@entry=0x8a28ed0)
    at ../oscar64/NativeCodeGenerator.cpp:45748
#6  0x000000000813ce8b in Compiler::CompileProcedure (this=0x82989b0,
    proc=0x8a28ed0) at ../oscar64/Compiler.cpp:468
#7  0x000000000813fea1 in Compiler::GenerateCode (this=0x82989b0)
    at ../oscar64/Compiler.cpp:1016
#8  0x000000000800e088 in main2 (argc=<optimized out>, argv=<optimized out>)
    at ../oscar64/oscar64.cpp:197
#9  0x00007fffff29409b in __libc_start_main (
    main=0x8009fd0 <main(int, char const**)>, argc=4, argv=0x7ffffffee158,
    init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>,
    stack_end=0x7ffffffee148) at ../csu/libc-start.c:308
#10 0x000000000800a00a in _start () at ../oscar64/oscar64.cpp:543
drmortalwombat commented 9 months ago

Most likely already fixed with previous checkin

polluks commented 9 months ago

thx!