Silverfrost Forums

Welcome to our forums

Compiler crash

6 Nov 2017 10:45 #20683

Just added this function, and got a compiler crash.

Here's the text of the error and a link to Google Drive for a ZIP file of a Plato Project that duplicates the error. It includes all the .INS files as well.

This error occurs whether compiling in /CHECKMATE or /RELEASE. I always ask for a listing, but none was generated.

Error:

Runtime error from program:c:\program files (x86)\silverfrost\ftn95\ftn95.exe
Access Violation
The instruction at address 004c1a80 attempted to read from location 00000004
 004c1a0c process_special_function(<ref>structÄtree_ptr,structÄtree_ptr,enumÄlogical) [+0074]
 004c1c89 process_special_function(<ref>structÄtree_ptr,<ptr>structÄscoped_entity,enumÄlo [+0063]
 00447c5b process_tree1(<ref>structÄtree_ptr,enumÄlogical) [+d106] [recur=  3] 
 004391fa process_tree_completely(<ref>structÄtree_ptr) [+0024]
 00417b69 end_function(int) [+0a6f]
 00419a14 parse_end_statement(<ptr>char,int,<ref>int) [+0c04]
 0041311f handle_token(<ptr>char,int,int,int,int,<ref>int) [+0e65]
 004056b3 Prd—Ô
eax=00000000   ebx=0ef78bd4   ecx=03d4c0b4
edx=0f11cee0   esi=0f11ceac   edi=00001e81
ebp=03d4b0a8   esp=03d4b064   IOPL=2
ds=002b   es=002b   fs=0053
gs=002b   cs=0023   ss=002b
flgs=00210212 [NC OP NZ SN DN NV]

 004c1a80  cmp      [eax+0x4],0x1a 
 004c1a84  jne      4c1aa9 
 004c1a8a  qfild    [00abcfd4] 

link: https://drive.google.com/file/d/0B5fbkRqVCqoMN0JPTlNjUUZ1aTA/view?usp=sharing

6 Nov 2017 10:55 #20684

I discovered the error in the code that caused the crash.

Near the bottom, in the call to ANNOTATE_LITHO, I used one of the arguments (LITHO_RECORD, a derived type) as if it was an array. It was not declared that way. Perhaps the compiler saw that as a function call?

In any case, it's cleared up for me.

7 Nov 2017 7:39 #20686

If you can isolate the failure to a few lines of code (and post the result) then we can fix the compiler to avoid the crash.

7 Nov 2017 3:48 #20688

I posted the link to a ZIP file with the relevant files (not much code).

Shall I try to make it even smaller?

7 Nov 2017 4:53 #20689

Even smaller:

	subroutine draw_litho_on_device(litho_record)
	TYPE:: LITHO_REC
	sequence
! --- DON'T CHANGE THE TYPE OF ANYTHING FROM HERE UNTIL THE MARKER!
	INTEGER*2	:: FWD=0
	END TYPE LITHO_REC

	type (litho_rec) litho_record ! (1) uncomment to get a clean compile

	CALL ANNOTATE_LITHO(x,y,XDIST,XANNO,BOXSIZ,LITHO_RECORD(NLITH),p_options)
	return
	end subroutine
8 Nov 2017 10:05 #20694

This bug has now been fixed for the next release of FTN95.

Please login to reply.