munmap_chunk(): invalid pointer
munmap_chunk(): invalid pointer
Aborted (core dumped)
The program that is doing this is:[
Code: Select all
declare sub write_reagent()
declare sub read_reagent()
DIM SHARED as integer k, reag_count
DIM SHARED as string reag_name(200), reag_density(200), reag_code(200), reag_unit(200)
DIM SHARED as double reag_year(200), reag_inventory(k), reag_price(200), reag_mw(200)
SCREEN 0
'COLOR 0, 7
read_reagent()
'write_reagent()
SUB read_reagent()
cls
OPEN "reagent-new.dat" FOR INPUT AS #3
INPUT #3, reag_count
PRINT reag_count
FOR k = 1 TO reag_count
INPUT #3, reag_name(k), reag_density(k), reag_code(k), reag_unit(k), reag_year(k), reag_inventory(k), reag_price(k), reag_mw(k)
PRINT reag_name(k), reag_density(k), reag_code(k), reag_unit(k), reag_year(k), reag_inventory(k), reag_price(k), reag_mw(k)
NEXT
CLOSE #3
END SUB
/'SUB write_reagent()
OPEN "reagent-new-test.dat" FOR OUTPUT AS #3
WRITE #3, reag_count
FOR k = 1 TO reag_count
WRITE #3, reag_name(k), reag_density(k), reag_code(k),reag_unit(k), reag_year(k), reag_inventory(k), reag_price(k), reag_mw(k)
PRINT reag_name(k), reag_density(k), reag_code(k), reag_year(k), reag_inventory(k), reag_price(k), reag_mw(k)
NEXT
CLOSE #3
END SUB'/
The program compiles ok; when run it prints the data properly, and coughs up the errors.28
"water ","1 ","W001 ","kg",0,23,0.02,18.01
"t-butanol ",".775 ","T001 ","kg",0,2.933375,10,74.12
"acetyl chloride ","1.104 ","A001 ","kg",0,4.17864,10,78.5
"dimethylaniline ",".956 ","A002 ","kg",0,3.61846,50,121.18
"diethylether ",".715 ","E001 ","kg",0,0.715,2,74.12
"10% sulfuric acid ","1.084 ","S001 ","kg",0,4.10294,10,98.08
"NaOH (50% sol'n) ","1.530 ","S002 ","kg",0,5.79105,12,40
"sat'd sodium bicarbonate ","1.1 ","S003 ","kg",0,4.1635,5,84.011
"sodium sulfate (anhy) ","s ","S004 ","kg",0,1,5,142.04
"t-butylacetate ",".862 ","A003 ","kg",0,0.862,25,116.16
"dimethylaniline HCl ","S ","A004 ","kg",0,0,45,157.63
"methyl acrylate ",".894 ","A005 ","kg",0,0.894,50,128.17
"n-butanol ","0.81 ","B002 ","kg",0,3.06585,12,74.12
"hydroquinone ","S ","H001 ","kg",0,1,25,110.11
"p-toluenesulfonic acid:H2O","S ","S005 ","kg",0,1,25,190.22
"FeSO4:7H2O ","S ","I001 ","kg",0,1,5,278.015
"HCl (37w/w%) ","1.2 ","H002 ","kg",0,4.542,12,36.458
"o-nitrobenzaldehyde ","S ","N001 ","kg",0,1,30,151.12
"NH4OH (conc) ",".90 ","A006 ","kg",0,3.4065,18,35.0468
"sodium chloride ","S ","S006 ","kg",0,1,5,58.44
"o-aminobenzaldehyde ","S ","A007 ","kg",0,1,100,121.132
"acetic acid ","1.049 ","A008 ","kg",0,19.85233,12,60.05
"acetic anhydride ","1.082 ","A009 ","kg",0,3.246,5,102.09
"pyridine ",".978 ","P001 ","kg",0,3.70173,10,79.0999
"bromine ","3.102 ","B003 ","kg",0,3.102,100,159.82
"bromoacetic acid ","S ","B004 ","kg",0,1,45,138.95
"ethanol ",".794 ","E002 ","kg",0,3.00529,12,46.07
"sulfuric acid ","1.84 ","S010 ","kg",0,10,1,98.08
munmap_chunk(): invalid pointer
munmap_chunk(): invalid pointer
Aborted (core dumped)
any idea where the errors are coming from? I am running fedora 31 linux
any help appreciated
John
EDITED by Moderator to add code and quote blocks.