{"action":"created","issue":{"url":"https://api.github.com/repos/KnightOS/KnightOS/issues/371","repository_url":"https://api.github.com/repos/KnightOS/KnightOS","labels_url":"https://api.github.com/repos/KnightOS/KnightOS/issues/371/labels{/name}","comments_url":"https://api.github.com/repos/KnightOS/KnightOS/issues/371/comments","events_url":"https://api.github.com/repos/KnightOS/KnightOS/issues/371/events","html_url":"https://github.com/KnightOS/KnightOS/issues/371","id":377601989,"node_id":"MDU6SXNzdWUzNzc2MDE5ODk=","number":371,"title":"Cygwin64 z80e-sdl.exe segmentation-fault","user":{"login":"TheElementalOfCreation","id":24580325,"node_id":"MDQ6VXNlcjI0NTgwMzI1","avatar_url":"https://avatars3.githubusercontent.com/u/24580325?v=4","gravatar_id":"","url":"https://api.github.com/users/TheElementalOfCreation","html_url":"https://github.com/TheElementalOfCreation","followers_url":"https://api.github.com/users/TheElementalOfCreation/followers","following_url":"https://api.github.com/users/TheElementalOfCreation/following{/other_user}","gists_url":"https://api.github.com/users/TheElementalOfCreation/gists{/gist_id}","starred_url":"https://api.github.com/users/TheElementalOfCreation/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TheElementalOfCreation/subscriptions","organizations_url":"https://api.github.com/users/TheElementalOfCreation/orgs","repos_url":"https://api.github.com/users/TheElementalOfCreation/repos","events_url":"https://api.github.com/users/TheElementalOfCreation/events{/privacy}","received_events_url":"https://api.github.com/users/TheElementalOfCreation/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":21,"created_at":"2018-11-05T22:03:09Z","updated_at":"2018-11-10T06:53:07Z","closed_at":null,"author_association":"NONE","body":"Whenever I try to run the z80e-sdl.exe file, with or without a rom, I always get a seg-fault. The output from the gdb is as such:\r\n```\r\nStarting program: /cygdrive/c/Users/Creation/Downloads/calculator/z80e-master/z80e-master/frontends/sdl/bin/z80e-sdl.exe\r\n[New Thread 8956.0xb7c]\r\n[New Thread 8956.0x44e4]\r\n[New Thread 8956.0x3c2c]\r\n[New Thread 8956.0x3d68]\r\n[New Thread 8956.0x36dc]\r\nNo ROM file specified, starting debugger\r\n[New Thread 8956.0x1320]\r\n\r\nThread 1 \"z80e-sdl\" received signal SIGSEGV, Segmentation fault.\r\n0x0000000100401db9 in setup_display (w=480, h=320)\r\n    at /cygdrive/c/Users/Creation/Downloads/calculator/z80e-master/z80e-master/frontends/sdl/main.c:286\r\n286             pixel_color_on    = SDL_MapRGB(context.screen->format, COLOR_ON);\r\n```\r\n\r\nAnd the stack dump is:\r\n```\r\nException: STATUS_ACCESS_VIOLATION at rip=00100401DB9\r\nrax=0000000000000000 rbx=00000001004221E0 rcx=00000003F0C4329E\r\nrdx=0000000000000000 rsi=0000000180261320 rdi=00000000FFFFCDF0\r\nr8 =0000000000000066 r9 =0000000000000000 r10=0000000100000000\r\nr11=00000003F0C28FBE r12=0000000000000000 r13=0000000000000000\r\nr14=0000000000000000 r15=0000000000000000\r\nrbp=00000000FFFFCB30 rsp=00000000FFFFCAE0\r\nprogram=C:\\cygwin64\\usr\\local\\bin\\z80e-sdl.exe, pid 17988, thread main\r\ncs=0033 ds=002B es=002B fs=0053 gs=002B ss=002B\r\nStack trace:\r\nFrame        Function    Args\r\n000FFFFCB30  00100401DB9 (00600000140, 00000000001, 000FFFFCC60, 005A7951020)\r\n000FFFFCBC0  00100402EC5 (000FFFFCC60, 00000000000, 00000000030, 30001000000FF00)\r\n000FFFFCCD0  00180049E16 (00000000000, 00000000000, 00000000000, 00000000000)\r\n00000000000  00180047973 (00000000000, 00000000000, 00000000000, 00000000000)\r\n000FFFFFFF0  00180047A24 (00000000000, 00000000000, 00000000000, 00000000000)\r\nEnd of stack trace\r\n```\r\n\r\nAlso, when I try to run the tests (tests.exe) I get this from the gdb:\r\n```\r\nStarting program: /cygdrive/c/Users/Creation/Downloads/calculator/z80e-master/z80e-master/frontends/test/bin/tests.exe\r\n[New Thread 11016.0x4608]\r\n[New Thread 11016.0x20cc]\r\n[New Thread 11016.0x46b4]\r\n[New Thread 11016.0x4d4]\r\n[New Thread 11016.0x4f94]\r\nTesting performance .......................................executed 1,000,000 cycles in 15.000000 milliseconds (~66.666667 MHz)\r\n..........................................Instruction tests....\r\nTesting ADD A, r ..........................................PASS\r\nTesting ADC A, r ..........................................PASS\r\nTesting SUB A, r ..........................................PASS\r\nTesting SBC A, r ..........................................PASS\r\nTesting AND A, r ..........................................PASS\r\nTesting XOR A, r ..........................................PASS\r\nTesting OR A, r ...........................................PASS\r\nTesting CP r ..............................................PASS\r\nTesting RST y .............................................PASS\r\nTesting DJNZ d ............................................PASS\r\nTesting JR d ..............................................PASS\r\nTesting JR cc, d ..........................................PASS\r\nTesting LD rp, nn .........................................PASS\r\nTesting ADD HL, rp ........................................PASS\r\nTesting LD (BC), A ........................................PASS\r\nTesting LD (nn), HL .......................................PASS\r\nTesting LD (nn), A ........................................PASS\r\nTesting LD HL, (nn) .......................................PASS\r\nTesting LD A, (nn) ........................................PASS\r\nTesting INC rp ............................................PASS\r\nTesting INC r .............................................PASS\r\nTesting DEC rp ............................................PASS\r\nTesting DEC r .............................................PASS\r\nTesting LD r, n ...........................................PASS\r\nTesting RLCA ..............................................PASS\r\nTesting RRCA ..............................................PASS\r\nTesting RLA ...............................................PASS\r\nTesting RRA ...............................................PASS\r\nTesting CPL ...............................................PASS\r\nTesting DAA ...............................................PASS\r\nTesting LD r, r ...........................................PASS\r\nTesting POP rp2 ...........................................PASS\r\nTesting RET cc ............................................PASS\r\nTesting RET ...............................................PASS\r\nTesting EXX ...............................................PASS\r\nTesting JP (HL) ...........................................PASS\r\nTesting LD SP, HL .........................................PASS\r\nTesting JP cc, nn .........................................PASS\r\nTesting JP nn .............................................PASS\r\nTesting OUT (n), A ........................................PASS\r\nTesting IN A, (n) .........................................PASS\r\nTesting EX (SP), HL .......................................PASS\r\nTesting EX DE, HL .........................................PASS\r\nTesting CALL cc, nn .......................................PASS\r\nTesting PUSH rp2 ..........................................PASS\r\nTesting CALL nn ...........................................PASS\r\nTesting alu[y] n ..........................................PASS\r\nTesting LD (IX,IY), A / LD A, (IX,IY) .....................PASS\r\nTesting JP IX / JP IY .....................................PASS\r\nTesting ADD IX, rp ........................................PASS\r\nTesting prefix reset ......................................PASS\r\nTesting index offsets .....................................PASS\r\nTesting IXH/IXL ...........................................PASS\r\nTesting interrupt mode set ................................PASS\r\nTesting RLC r .............................................PASS\r\nTesting RRC r .............................................PASS\r\nTesting RL r ..............................................PASS\r\nTesting RR r ..............................................PASS\r\nTesting SLA r .............................................PASS\r\nTesting SRA r .............................................PASS\r\nTesting SLL r .............................................PASS\r\nTesting SRL r .............................................PASS\r\nTesting BIT y, r ..........................................PASS\r\nTesting RES y, r ..........................................PASS\r\nTesting SET y, r ..........................................PASS\r\nTesting EI/DI .............................................PASS\r\nTesting NEG ...............................................PASS\r\nTesting IN (C) ............................................PASS\r\nTesting IN r, (C) .........................................PASS\r\nTesting OUT (C), 0 ........................................PASS\r\nTesting OUT (C), r ........................................PASS\r\nTesting SBC HL, rp ........................................PASS\r\nTesting ADC HL, rp ........................................PASS\r\nTesting LD (nn), rp .......................................PASS\r\nTesting LD rp, (nn) .......................................PASS\r\nTesting LD A, I ...........................................PASS\r\nTesting RRD/RLD ...........................................PASS\r\nTesting LDI ...............................................PASS\r\nTesting LDIR ..............................................PASS\r\nTesting LDD ...............................................PASS\r\nTesting LDDR ..............................................PASS\r\nTesting CPI ...............................................PASS\r\nTesting CPD ...............................................PASS\r\nTesting CPIR ..............................................PASS\r\nTesting CPDR ..............................................PASS\r\nTesting INI ...............................................PASS\r\nTesting IND ...............................................PASS\r\nTesting INIR ..............................................PASS\r\nTesting INDR ..............................................PASS\r\nTesting OUTI ..............................................PASS\r\nTesting OUTD ..............................................PASS\r\nTesting OTIR ..............................................PASS\r\nTesting OTDR ..............................................PASS\r\n............................................Interrupt tests....\r\nTesting mode 1 interrupts .................................PASS\r\nTesting mode 2 interrupts .................................PASS\r\n.................................................Port tests....\r\nTesting port 0x01 (keyboard) ..............................PASS\r\nTesting port 0x02 (status) ................................PASS\r\nTesting port 0x04, 0x05, 0x06, 0x07 (mapping, TI-83+) .....PASS\r\nTesting port 0x04, 0x05, 0x06, 0x07 (mapping, Others) .....PASS\r\nTesting port 0x00 (link port) .............................PASS\r\nTesting port 0x0A (link assist rx) ........................Receiving BE via link port\r\nReceiving EF via link port\r\nFAIL 3\r\nTesting port 0x0D (link assist tx) ........................FAIL 2\r\n.............................................Debugger tests....\r\nTesting debugger_init() ...................................PASS\r\nTesting find_best_command() ...............................PASS\r\nTesting Commandline parser ................................PASS\r\n\r\nThread 1 \"tests\" received signal SIGSEGV, Segmentation fault.\r\n0x0000000100411840 in try_from_sourcemap (memory=0xffffcaf0, map=0xffffca68, entry=0xffffca60)\r\n    at /cygdrive/c/Users/Creation/Downloads/calculator/z80e-master/z80e-master/libz80e/src/disassembler/disassemble.c:156\r\n156             for (i = 0; i < globals.objects->length; ++i) {\r\n```\r\n\r\nAnd this as the stackdump:\r\n```\r\nException: STATUS_ACCESS_VIOLATION at rip=00100411840\r\nrax=0000000000000000 rbx=0000000000000026 rcx=00000000FFFFCAF0\r\nrdx=00000000FFFFCA68 rsi=0000000180261320 rdi=0000000080808000\r\nr8 =00000000FFFFCA60 r9 =0000000180144890 r10=0000000100000000\r\nr11=0000000100408BB0 r12=000000018022CDD0 r13=00000000FFFFCC7C\r\nr14=0000000000000000 r15=00000000FFFFCC7C\r\nrbp=00000000FFFFCA00 rsp=00000000FFFFC9B0\r\nprogram=C:\\Users\\Creation\\Downloads\\calculator\\z80e-master\\z80e-master\\frontends\\test\\bin\\tests.exe, pid 13872, thread main\r\ncs=0033 ds=002B es=002B fs=0053 gs=002B ss=002B\r\nStack trace:\r\nFrame        Function    Args\r\n000FFFFCA00  00100411840 (000FFFFCA68, 000FFFFCA60, 00000000000, 00180144AA1)\r\n000FFFFCAC0  0010041260F (00100402D7F, 000FFFFCC00, 0018019464E, 00100402DFC)\r\n000FFFFCB20  00100402E9E (00100420538, 000FFFFCACC, 00180144890, 00049435341)\r\n000FFFFCBB0  00100408BD6 (0018022CDD0, 000FFFFCC7C, 00000000000, 000FFFFCCD0)\r\n000FFFFCBB0  00100408C71 (000FFFFCC00, FF0700010302FF00, 00180049DAA, 000FFFFCCD0)\r\n000FFFFCCD0  00180049E16 (00000000000, 00000000000, 00000000000, 00000000000)\r\n00000000000  00180047973 (00000000000, 00000000000, 00000000000, 00000000000)\r\n000FFFFFFF0  00180047A24 (00000000000, 00000000000, 00000000000, 00000000000)\r\nEnd of stack trace\r\n```\r\n\r\nCan anyone help me out?"},"comment":{"url":"https://api.github.com/repos/KnightOS/KnightOS/issues/comments/437563327","html_url":"https://github.com/KnightOS/KnightOS/issues/371#issuecomment-437563327","issue_url":"https://api.github.com/repos/KnightOS/KnightOS/issues/371","id":437563327,"node_id":"MDEyOklzc3VlQ29tbWVudDQzNzU2MzMyNw==","user":{"login":"TheElementalOfCreation","id":24580325,"node_id":"MDQ6VXNlcjI0NTgwMzI1","avatar_url":"https://avatars3.githubusercontent.com/u/24580325?v=4","gravatar_id":"","url":"https://api.github.com/users/TheElementalOfCreation","html_url":"https://github.com/TheElementalOfCreation","followers_url":"https://api.github.com/users/TheElementalOfCreation/followers","following_url":"https://api.github.com/users/TheElementalOfCreation/following{/other_user}","gists_url":"https://api.github.com/users/TheElementalOfCreation/gists{/gist_id}","starred_url":"https://api.github.com/users/TheElementalOfCreation/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TheElementalOfCreation/subscriptions","organizations_url":"https://api.github.com/users/TheElementalOfCreation/orgs","repos_url":"https://api.github.com/users/TheElementalOfCreation/repos","events_url":"https://api.github.com/users/TheElementalOfCreation/events{/privacy}","received_events_url":"https://api.github.com/users/TheElementalOfCreation/received_events","type":"User","site_admin":false},"created_at":"2018-11-10T06:53:07Z","updated_at":"2018-11-10T06:53:07Z","author_association":"NONE","body":"Wait, if I've done this right:\r\n```\r\n(gdb) print sizeof(globals)\r\n$19 = 16\r\n(gdb) print sizeof(globals.objects)\r\n$20 = 8\r\n(gdb) print typeid(globals)\r\nNo symbol \"typeid\" in current context.\r\n(gdb) print (longlong) globals\r\n$21 = 0\r\n\r\n```\r\nis it telling me that every single byte of globals is a 0?"}}
{"actor":{"display_login":"TheElementalOfCreation"}}