View Issue Details

IDProjectCategoryView StatusLast Update
0000567ascendcompilerpublic2013-03-04 22:28
Reporterjohn 
Assigned To 
PrioritynormalSeverityminorReproducibilityhave not tried
Status resolvedResolutionfixed 
PlatformLinuxOSUbuntuOS Version12.04 LTS
Product VersionSVN 
Target Version0.9.9Fixed in Version 
Summary0000567: error in sim_destroy in relation.c:UpdateInputArgsList
DescriptionIn the new CUnit test case solver_qrslv.bug567, we see a crash (discovered while working on a fix for bug 564, but looks separate). This (new) bug arises during the process of sim_destroy. The function UpdateInputArgsList is throwing an error that appears to be due to being unable to construct the name of a relation instance during deallocation. See GDB trace below.

The message that is being attempted to be reported looks like "Screwed up merge of input variable [argloc] in [relcontextname]". But it's not even sure yet if the error was going to be reported.
Additional Information(note: updated, test case has been renamed)

john@novo:~/ascend$ gdb --args test/test solver_qrslv.bug567
GNU gdb (Ubuntu/Linaro 7.4-2012.04-0ubuntu2) 7.4-2012.04
Copyright (C) 2012 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 "i686-linux-gnu".
For bug reporting instructions, please see:
<http://bugs.launchpad.net/gdb-linaro/>...
Reading symbols from /home/john/ascend/test/test...done.
(gdb) r
Starting program: /home/john/ascend/test/test solver_qrslv.bug567
Registered ASCEND test suites
CUNIT RUNNING SELECTED 1 TESTS...


     CUnit - A unit testing framework for C - Version 2.1-2
     http://cunit.sourceforge.net/

Running selected tests...Looking for 'solver_qrslv.bug567'...
Valid test 'bug567' in suite 'solver_qrslv'
Running test 'solver_qrslv.bug567'...

Suite: solver_qrslv
  Test: bug567 ...ascend/solver/test/test_qrslv.c:148 (test_bug567): ASCENDLIBRARY = models

ascend/compiler/module.c:1008 (ModuleSearchPath): File 'models/johnpye/fprops/brayton_split.a4c' opened directly, without path search
ascend/compiler/scanner.l:837 (Asc_ScannerPushBuffer): REQUIREd module "atoms.a4l" already PROVIDEd
ascend/compiler/scanner.l:837 (Asc_ScannerPushBuffer): REQUIREd module "atoms.a4l" already PROVIDEd
ascend/compiler/scanner.l:837 (Asc_ScannerPushBuffer): REQUIREd module "system.a4l" already PROVIDEd
ascend/compiler/scanner.l:837 (Asc_ScannerPushBuffer): REQUIREd module "atoms.a4l" already PROVIDEd
ascend/compiler/scanner.l:837 (Asc_ScannerPushBuffer): REQUIREd module "johnpye/thermo_types.a4c" already PROVIDEd
ascend/compiler/scanner.l:837 (Asc_ScannerPushBuffer): REQUIREd module "atoms.a4l" already PROVIDEd
ascend/compiler/scanner.l:837 (Asc_ScannerPushBuffer): REQUIREd module "johnpye/thermo_types.a4c" already PROVIDEd
WARNING: models/johnpye/fprops/asc_helmholtz.c:110:helmholtz_register: FPROPS is still EXPERIMENTAL. Use with caution.

ascend/compiler/scanner.l:837 (Asc_ScannerPushBuffer): REQUIREd module "johnpye/fprops/rankine_fprops.a4c" already PROVIDEd
WARNING: models/johnpye/fprops/asc_heatex_pinch.c:99:heatex_pinch_register: HEATEX is still EXPERIMENTAL.

ascend/compiler/mergeinst.c:773 (MergeModels): Merging models 'JO[3].inlet.cd' and 'JO[3].inlet.cd'
ascend/compiler/mergeinst.c:773 (MergeModels): Merging models 'JO[2].inlet.cd' and 'JO[2].inlet.cd'
ascend/compiler/mergeinst.c:773 (MergeModels): Merging models 'JO[1].inlet.cd' and 'JO[1].inlet.cd'
ascend/compiler/mergeinst.c:773 (MergeModels): Merging models 'CO2.inlet.cd' and 'CO2.inlet.cd'
ascend/compiler/mergeinst.c:773 (MergeModels): Merging models 'CO2.cd' and 'CO2.cd'
ascend/compiler/mergeinst.c:773 (MergeModels): Merging models 'CO1.inlet.cd' and 'CO1.inlet.cd'
ascend/compiler/mergeinst.c:773 (MergeModels): Merging models 'CO1.cd' and 'CO1.cd'
ascend/compiler/mergeinst.c:773 (MergeModels): Merging models 'ME.inlet_branch.cd' and 'ME.inlet_branch.cd'
ascend/compiler/mergeinst.c:773 (MergeModels): Merging models 'ME.inlet.cd' and 'ME.inlet.cd'
ascend/compiler/mergeinst.c:773 (MergeModels): Merging models 'SP.outlet.cd' and 'SP.outlet.cd'
ascend/compiler/mergeinst.c:773 (MergeModels): Merging models 'SP.inlet.cd' and 'SP.inlet.cd'
ascend/compiler/mergeinst.c:773 (MergeModels): Merging models 'HEL.inlet.cd' and 'HEL.inlet.cd'
ascend/compiler/mergeinst.c:773 (MergeModels): Merging models 'HEL.outlet_hot.cd' and 'HEL.outlet_hot.cd'
ascend/compiler/mergeinst.c:773 (MergeModels): Merging models 'HEH.inlet.cd' and 'HEH.inlet.cd'
ascend/compiler/mergeinst.c:773 (MergeModels): Merging models 'HEH.inlet_hot.cd' and 'HEH.inlet_hot.cd'
ascend/compiler/mergeinst.c:773 (MergeModels): Merging models 'DI.inlet.cd' and 'DI.inlet.cd'
ascend/compiler/mergeinst.c:773 (MergeModels): Merging models 'TU.inlet.cd' and 'TU.inlet.cd'
ascend/compiler/mergeinst.c:773 (MergeModels): Merging models 'TU.cd' and 'TU.cd'
ascend/compiler/mergeinst.c:773 (MergeModels): Merging models 'BO.inlet.cd' and 'BO.inlet.cd'
ascend/compiler/mergeinst.c:773 (MergeModels): Merging models 'BO.outlet' and 'BO.outlet'
ascend/compiler/mergeinst.c:773 (MergeModels): Merging models 'cd' and 'cd'
ascend/compiler/mergeinst.c:773 (MergeModels): Merging models 'BO.outlet.state' and 'BO.outlet.state'
ascend/compiler/mergeinst.c:773 (MergeModels): Merging models 'TU.outlet' and 'TU.outlet'
ascend/compiler/mergeinst.c:773 (MergeModels): Merging models 'cd' and 'cd'
ascend/compiler/mergeinst.c:773 (MergeModels): Merging models 'TU.outlet.state' and 'TU.outlet.state'
ascend/compiler/mergeinst.c:773 (MergeModels): Merging models 'HEH.outlet_hot' and 'HEH.outlet_hot'
ascend/compiler/mergeinst.c:773 (MergeModels): Merging models 'cd' and 'cd'
ascend/compiler/mergeinst.c:773 (MergeModels): Merging models 'HEH.outlet_hot.state' and 'HEH.outlet_hot.state'
ascend/compiler/mergeinst.c:773 (MergeModels): Merging models 'HEL.inlet_hot' and 'HEL.inlet_hot'
ascend/compiler/mergeinst.c:773 (MergeModels): Merging models 'HEL.outlet_hot.cd' and 'HEL.outlet_hot.cd'
ascend/compiler/mergeinst.c:773 (MergeModels): Merging models 'HEL.inlet_hot.state' and 'HEL.inlet_hot.state'
ascend/compiler/mergeinst.c:773 (MergeModels): Merging models 'HEL.outlet_hot' and 'HEL.outlet_hot'
ascend/compiler/mergeinst.c:773 (MergeModels): Merging models 'cd' and 'cd'
ascend/compiler/mergeinst.c:773 (MergeModels): Merging models 'HEL.outlet_hot.state' and 'HEL.outlet_hot.state'
ascend/compiler/mergeinst.c:773 (MergeModels): Merging models 'SP.inlet' and 'SP.inlet'
ascend/compiler/mergeinst.c:773 (MergeModels): Merging models 'SP.cd' and 'SP.cd'
ascend/compiler/mergeinst.c:773 (MergeModels): Merging models 'SP.inlet.state' and 'SP.inlet.state'
ascend/compiler/mergeinst.c:773 (MergeModels): Merging models 'SP.outlet' and 'SP.outlet'
ascend/compiler/mergeinst.c:773 (MergeModels): Merging models 'cd' and 'cd'
ascend/compiler/mergeinst.c:773 (MergeModels): Merging models 'SP.outlet.state' and 'SP.outlet.state'
ascend/compiler/mergeinst.c:773 (MergeModels): Merging models 'ME.inlet' and 'ME.inlet'
ascend/compiler/mergeinst.c:773 (MergeModels): Merging models 'ME.cd' and 'ME.cd'
ascend/compiler/mergeinst.c:773 (MergeModels): Merging models 'ME.inlet.state' and 'ME.inlet.state'
ascend/compiler/mergeinst.c:773 (MergeModels): Merging models 'DI.inlet' and 'DI.inlet'
ascend/compiler/mergeinst.c:773 (MergeModels): Merging models 'DI.cd' and 'DI.cd'
ascend/compiler/mergeinst.c:773 (MergeModels): Merging models 'DI.inlet.state' and 'DI.inlet.state'
ascend/compiler/mergeinst.c:773 (MergeModels): Merging models 'DI.outlet' and 'DI.outlet'
ascend/compiler/mergeinst.c:773 (MergeModels): Merging models 'cd' and 'cd'
ascend/compiler/mergeinst.c:773 (MergeModels): Merging models 'DI.outlet.state' and 'DI.outlet.state'
ascend/compiler/mergeinst.c:773 (MergeModels): Merging models 'HEL.inlet' and 'HEL.inlet'
ascend/compiler/mergeinst.c:773 (MergeModels): Merging models 'HEL.cd' and 'HEL.cd'
ascend/compiler/mergeinst.c:773 (MergeModels): Merging models 'HEL.inlet.state' and 'HEL.inlet.state'
ascend/compiler/mergeinst.c:773 (MergeModels): Merging models 'HEL.outlet' and 'HEL.outlet'
ascend/compiler/mergeinst.c:773 (MergeModels): Merging models 'HEL.outlet.state' and 'HEL.outlet.state'
ascend/compiler/mergeinst.c:773 (MergeModels): Merging models 'HEH.inlet' and 'HEH.inlet'
ascend/compiler/mergeinst.c:773 (MergeModels): Merging models 'HEH.cd' and 'HEH.cd'
ascend/compiler/mergeinst.c:773 (MergeModels): Merging models 'HEH.inlet.state' and 'HEH.inlet.state'
ascend/compiler/mergeinst.c:773 (MergeModels): Merging models 'HEH.outlet' and 'HEH.outlet'
ascend/compiler/mergeinst.c:773 (MergeModels): Merging models 'cd' and 'cd'
ascend/compiler/mergeinst.c:773 (MergeModels): Merging models 'HEH.outlet.state' and 'HEH.outlet.state'
ascend/compiler/mergeinst.c:773 (MergeModels): Merging models 'BO.inlet' and 'BO.inlet'
ascend/compiler/mergeinst.c:773 (MergeModels): Merging models 'BO.inlet.state' and 'BO.inlet.state'
models/johnpye/fprops/asc_helmholtz.c:182 (helmholtz_prepare): COMPONENT: carbondioxide
models/johnpye/fprops/asc_helmholtz.c:194:helmholtz_prepare: Prepared component 'carbondioxide' OK.
models/johnpye/fprops/asc_helmholtz.c:182 (helmholtz_prepare): COMPONENT: carbondioxide
models/johnpye/fprops/asc_helmholtz.c:194:helmholtz_prepare: Prepared component 'carbondioxide' OK.
models/johnpye/fprops/asc_helmholtz.c:182 (helmholtz_prepare): COMPONENT: carbondioxide
models/johnpye/fprops/asc_helmholtz.c:194:helmholtz_prepare: Prepared component 'carbondioxide' OK.
models/johnpye/fprops/asc_helmholtz.c:182 (helmholtz_prepare): COMPONENT: carbondioxide
models/johnpye/fprops/asc_helmholtz.c:194:helmholtz_prepare: Prepared component 'carbondioxide' OK.
models/johnpye/fprops/asc_helmholtz.c:182 (helmholtz_prepare): COMPONENT: carbondioxide
models/johnpye/fprops/asc_helmholtz.c:194:helmholtz_prepare: Prepared component 'carbondioxide' OK.
models/johnpye/fprops/asc_helmholtz.c:182 (helmholtz_prepare): COMPONENT: carbondioxide
models/johnpye/fprops/asc_helmholtz.c:194:helmholtz_prepare: Prepared component 'carbondioxide' OK.
models/johnpye/fprops/asc_helmholtz.c:182 (helmholtz_prepare): COMPONENT: carbondioxide
models/johnpye/fprops/asc_helmholtz.c:194:helmholtz_prepare: Prepared component 'carbondioxide' OK.
models/johnpye/fprops/asc_helmholtz.c:182 (helmholtz_prepare): COMPONENT: carbondioxide
models/johnpye/fprops/asc_helmholtz.c:194:helmholtz_prepare: Prepared component 'carbondioxide' OK.
models/johnpye/fprops/asc_helmholtz.c:182 (helmholtz_prepare): COMPONENT: carbondioxide
models/johnpye/fprops/asc_helmholtz.c:194:helmholtz_prepare: Prepared component 'carbondioxide' OK.
models/johnpye/fprops/asc_helmholtz.c:182 (helmholtz_prepare): COMPONENT: carbondioxide
models/johnpye/fprops/asc_helmholtz.c:194:helmholtz_prepare: Prepared component 'carbondioxide' OK.
models/johnpye/fprops/asc_helmholtz.c:182 (helmholtz_prepare): COMPONENT: carbondioxide
models/johnpye/fprops/asc_helmholtz.c:194:helmholtz_prepare: Prepared component 'carbondioxide' OK.
models/johnpye/fprops/asc_helmholtz.c:182 (helmholtz_prepare): COMPONENT: carbondioxide
models/johnpye/fprops/asc_helmholtz.c:194:helmholtz_prepare: Prepared component 'carbondioxide' OK.
models/johnpye/fprops/asc_helmholtz.c:182 (helmholtz_prepare): COMPONENT: carbondioxide
models/johnpye/fprops/asc_helmholtz.c:194:helmholtz_prepare: Prepared component 'carbondioxide' OK.
models/johnpye/fprops/asc_helmholtz.c:182 (helmholtz_prepare): COMPONENT: carbondioxide
models/johnpye/fprops/asc_helmholtz.c:194:helmholtz_prepare: Prepared component 'carbondioxide' OK.
models/johnpye/fprops/asc_helmholtz.c:182 (helmholtz_prepare): COMPONENT: carbondioxide
models/johnpye/fprops/asc_helmholtz.c:194:helmholtz_prepare: Prepared component 'carbondioxide' OK.
models/johnpye/fprops/asc_helmholtz.c:182 (helmholtz_prepare): COMPONENT: carbondioxide
models/johnpye/fprops/asc_helmholtz.c:194:helmholtz_prepare: Prepared component 'carbondioxide' OK.
models/johnpye/fprops/asc_helmholtz.c:182 (helmholtz_prepare): COMPONENT: carbondioxide
models/johnpye/fprops/asc_helmholtz.c:194:helmholtz_prepare: Prepared component 'carbondioxide' OK.
models/johnpye/fprops/asc_helmholtz.c:182 (helmholtz_prepare): COMPONENT: carbondioxide
models/johnpye/fprops/asc_helmholtz.c:194:helmholtz_prepare: Prepared component 'carbondioxide' OK.
models/johnpye/fprops/asc_heatex_pinch.c:166 (heatex_prepare): component: carbondioxide
models/johnpye/fprops/asc_heatex_pinch.c:166 (heatex_prepare): component_hot: carbondioxide
models/johnpye/fprops/asc_heatex_pinch.c:180:heatex_prepare: Heat exchanger data structure OK.
models/johnpye/fprops/asc_heatex_pinch.c:166 (heatex_prepare): component: carbondioxide
models/johnpye/fprops/asc_heatex_pinch.c:166 (heatex_prepare): component_hot: carbondioxide
models/johnpye/fprops/asc_heatex_pinch.c:180:heatex_prepare: Heat exchanger data structure OK.
ascend/solver/test/test_qrslv.c:175 (test_bug567): Destroying instance tree


PROGRAM FATAL ERROR: ascend/general/list.c:487:gl_lengthF: Assertion failed: NULL != list


Program received signal SIGABRT, Aborted.
0xb7fdd424 in __kernel_vsyscall ()
(gdb) where
#0 0xb7fdd424 in __kernel_vsyscall ()
#1 0xb74cb1ef in __GI_raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#2 0xb74ce835 in __GI_abort () at abort.c:91
#3 0xb768e1bb in asc_panic_line (status=100, filename=0xb77bf9a8 "ascend/general/list.c", line=487, function=0xb77bfe32 "gl_lengthF",
    fmt=0xb77bfa7e "Assertion failed: %s") at ascend/general/panic.c:146
#4 0xb768b12d in gl_lengthF (list=0x0) at ascend/general/list.c:487
#5 0xb7711a1e in NumberParents (i=0x83ebb58) at ascend/compiler/parentchild.c:115
#6 0xb76d4d64 in ShortestPath (i=0x83ebb58, ref=0x0, height=0, best=4294967295) at ascend/compiler/instance_io.c:131
#7 0xb76d53c3 in WriteInstanceNameDS (dsPtr=0xbfffe428, i=0x83ebb58, ref=0x0) at ascend/compiler/instance_io.c:276
#8 0xb76d5457 in WriteInstanceNameString (i=0x83ebb58, ref=0x0) at ascend/compiler/instance_io.c:288
#9 0xb76fae07 in ChangeRelationPointers (rel=0x83f5db0, old=0x83ebb58, new=0x0) at ascend/compiler/linkinst.c:92
#10 0xb76bcbaf in RemoveRelationLinks (i=0x83ebb58, list=0x83e7b90) at ascend/compiler/destroyinst.c:263
#11 0xb76bd253 in DestroyInstanceParts (i=0x83ebb58) at ascend/compiler/destroyinst.c:420
#12 0xb76bda35 in DestroyInstance (inst=0x83ebb58, parent=0x83eb2d0) at ascend/compiler/destroyinst.c:646
#13 0xb76bcfba in DestroyInstanceParts (i=0x83eb2d0) at ascend/compiler/destroyinst.c:350
#14 0xb76bda35 in DestroyInstance (inst=0x83eb2d0, parent=0x83df540) at ascend/compiler/destroyinst.c:646
#15 0xb76bcfba in DestroyInstanceParts (i=0x83df540) at ascend/compiler/destroyinst.c:350
#16 0xb76bda35 in DestroyInstance (inst=0x83df540, parent=0x80e4750) at ascend/compiler/destroyinst.c:646
#17 0xb76bcfba in DestroyInstanceParts (i=0x80e4750) at ascend/compiler/destroyinst.c:350
#18 0xb76bda35 in DestroyInstance (inst=0x80e4750, parent=0x80e4728) at ascend/compiler/destroyinst.c:646
#19 0xb76bced9 in DestroyInstanceParts (i=0x80e4728) at ascend/compiler/destroyinst.c:328
#20 0xb76bda35 in DestroyInstance (inst=0x80e4728, parent=0x0) at ascend/compiler/destroyinst.c:646
#21 0xb7740283 in sim_destroy (sim=0x80e4728) at ascend/compiler/simlist.c:52
#22 0x0807b63f in test_bug567 () at ascend/solver/test/test_qrslv.c:179
#23 0xb7649b71 in run_single_test () from /usr/local/lib/libcunit.so.1
#24 0xb764761d in CU_run_selected_tests () from /usr/local/lib/libcunit.so.1
#25 0xb764bd63 in basic_run_selected_tests () from /usr/local/lib/libcunit.so.1
#26 0xb764ba71 in CU_basic_run_selected_tests () from /usr/local/lib/libcunit.so.1
#27 0x0804d292 in main (argc=2, argv=0xbffff334) at test/test.c:190
(gdb)
TagsNo tags attached.

Relationships

related to 0000564 resolvedjohn crash in 'SetRealAtomValue' on ubuntu 12.04 64-bit 

Activities

john

2012-09-30 14:21

administrator   ~0000914

Additional information, demonstrated that the solver does not need to set nor does the on_load method need to be run in order to see this error... looks simply to be a blackbox setup/destroy error?

john

2012-09-30 23:17

administrator   ~0000918

Last edited: 2012-09-30 23:19

View 2 revisions

Comment in 'ChangeRelationPointers' (code/trunk/ascend/compiler/linkinst.c):

/* FIXME: ChangeRelationPointers needs verification. all rel types have the rel->varlist that needs repair, then each rel type has specifics to fix up. */

Comment in ModifyBlackBoxRelPointers (code/trunk/ascend/compiler/relation.c):
/* FIXME: kirk never dealt with varlist rel->properly under merge.
ModifyBlackBoxRelPointers this gets used in interactive merge/refinement.
This should have just gone away perhaps now that we don't store
instance pointers anywhere except the varlist. maybe we must reindex,though. */

john

2012-10-02 12:25

administrator   ~0000921

Valgrind output:

models/johnpye/fprops/asc_heatex_pinch.c:179:heatex_prepare: Heat exchanger data structure OK.
ascend/solver/test/test_qrslv.c:220 (test_bug564): Destroying instance tree
ascend/compiler/linkinst.c:91 (ChangeRelationPointers): MODIFY BLACK BOX POINTERS


PROGRAM FATAL ERROR: ascend/general/list.c:487:gl_lengthF: ==24367== Conditional jump or move depends on uninitialised value(s)
==24367== at 0x63ABA93: vfprintf (vfprintf.c:1624)
==24367== by 0x63AEF73: buffered_vfprintf (vfprintf.c:2290)
==24367== by 0x63A9C1D: vfprintf (vfprintf.c:1310)
==24367== by 0x4E5A26C: error_reporter_default_callback (error.c:77)
==24367== by 0x4E5A941: va_error_reporter (error.c:311)
==24367== by 0x4E5096C: asc_va_panic (panic.c:105)
==24367== by 0x4E50A9D: asc_panic_line (panic.c:139)
==24367== by 0x4E4D70A: gl_lengthF (list.c:487)
==24367== by 0x4ED6C42: NumberParents (parentchild.c:105)
==24367== by 0x4E99861: ShortestPath (instance_io.c:131)
==24367== by 0x4E998A9: ShortestPath (instance_io.c:133)
==24367== by 0x4E998A9: ShortestPath (instance_io.c:133)
==24367==
==24367== Use of uninitialised value of size 8
==24367== at 0x63ABDBA: vfprintf (vfprintf.c:1624)
==24367== by 0x63AEF73: buffered_vfprintf (vfprintf.c:2290)
==24367== by 0x63A9C1D: vfprintf (vfprintf.c:1310)
==24367== by 0x4E5A26C: error_reporter_default_callback (error.c:77)
==24367== by 0x4E5A941: va_error_reporter (error.c:311)
==24367== by 0x4E5096C: asc_va_panic (panic.c:105)
==24367== by 0x4E50A9D: asc_panic_line (panic.c:139)
==24367== by 0x4E4D70A: gl_lengthF (list.c:487)
==24367== by 0x4ED6C42: NumberParents (parentchild.c:105)
==24367== by 0x4E99861: ShortestPath (instance_io.c:131)
==24367== by 0x4E998A9: ShortestPath (instance_io.c:133)
==24367== by 0x4E998A9: ShortestPath (instance_io.c:133)
==24367==
==24367== Invalid read of size 1
==24367== at 0x63ABDBA: vfprintf (vfprintf.c:1624)
==24367== by 0x63AEF73: buffered_vfprintf (vfprintf.c:2290)
==24367== by 0x63A9C1D: vfprintf (vfprintf.c:1310)
==24367== by 0x4E5A26C: error_reporter_default_callback (error.c:77)
==24367== by 0x4E5A941: va_error_reporter (error.c:311)
==24367== by 0x4E5096C: asc_va_panic (panic.c:105)
==24367== by 0x4E50A9D: asc_panic_line (panic.c:139)
==24367== by 0x4E4D70A: gl_lengthF (list.c:487)
==24367== by 0x4ED6C42: NumberParents (parentchild.c:105)
==24367== by 0x4E99861: ShortestPath (instance_io.c:131)
==24367== by 0x4E998A9: ShortestPath (instance_io.c:133)
==24367== by 0x4E998A9: ShortestPath (instance_io.c:133)
==24367== Address 0x9 is not stack'd, malloc'd or (recently) free'd
==24367==
==24367==
==24367== Process terminating with default action of signal 11 (SIGSEGV)
==24367== Access not within mapped region at address 0x9
==24367== at 0x63ABDBA: vfprintf (vfprintf.c:1624)
==24367== by 0x63AEF73: buffered_vfprintf (vfprintf.c:2290)
==24367== by 0x63A9C1D: vfprintf (vfprintf.c:1310)
==24367== by 0x4E5A26C: error_reporter_default_callback (error.c:77)
==24367== by 0x4E5A941: va_error_reporter (error.c:311)
==24367== by 0x4E5096C: asc_va_panic (panic.c:105)
==24367== by 0x4E50A9D: asc_panic_line (panic.c:139)
==24367== by 0x4E4D70A: gl_lengthF (list.c:487)
==24367== by 0x4ED6C42: NumberParents (parentchild.c:105)
==24367== by 0x4E99861: ShortestPath (instance_io.c:131)
==24367== by 0x4E998A9: ShortestPath (instance_io.c:133)
==24367== by 0x4E998A9: ShortestPath (instance_io.c:133)
==24367== If you believe this happened as a result of a stack
==24367== overflow in your program's main thread (unlikely but
==24367== possible), you can try to increase the size of the
==24367== main thread stack using the --main-stacksize= flag.
==24367== The main thread stack size used in this run was 8388608.
==24367==
==24367== HEAP SUMMARY:
==24367== in use at exit: 5,962,052 bytes in 34,166 blocks
==24367== total heap usage: 38,889 allocs, 4,723 frees, 7,901,355 bytes allocated
==24367==

john

2012-10-02 18:50

administrator   ~0000922

This error definitely arising from using 'sim_destroy' in place of Asc_CompilerDestroy(). Use this second function and there's no error, no crash.

john

2012-10-02 20:11

administrator   ~0000924

updated description, additional info: test name changed.

john

2012-10-09 14:46

administrator   ~0000926

Now the error has changed to another part of the code that clearly isn't set up for blackbox destruction:

models/johnpye/fprops/asc_heatex_pinch.c:179:heatex_prepare: Heat exchanger data structure OK.
ascend/solver/test/test_qrslv.c:175 (test_bug567): Destroying instance tree
ascend/compiler/linkinst.c:91 (ChangeRelationPointers): MODIFY BLACK BOX POINTERS


PROGRAM FATAL ERROR: ascend/compiler/mathinst.c:404:RemoveRelation: Incorrect type passed


Program received signal SIGABRT, Aborted.
0x00007ffff63b9445 in __GI_raise (sig=<optimised out>) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
64 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) where
#0 0x00007ffff63b9445 in __GI_raise (sig=<optimised out>) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#1 0x00007ffff63bcbab in __GI_abort () at abort.c:91
#2 0x00007ffff697bc06 in asc_panic_line (status=2, filename=0x7ffff6bbda96 "ascend/compiler/mathinst.c", line=404, function=0x7ffff6bbde41 "RemoveRelation", fmt=0x7ffff6bbda80 "Incorrect type passed")
    at ascend/general/panic.c:146
#3 0x00007ffff6a4fefc in RemoveRelation (i=0xc9c240, reln=0xcab6a0) at ascend/compiler/mathinst.c:404
#4 0x00007ffff6a86256 in DestroyVarList (l=0xc920f0, inst=0xcab6a0) at ascend/compiler/relation.c:3399
#5 0x00007ffff6a866b8 in DestroyRelation (rel=0xca6180, relinst=0xcab6a0) at ascend/compiler/relation.c:3460
#6 0x00007ffff69cdb73 in DestroyInstanceParts (i=0xcab6a0) at ascend/compiler/destroyinst.c:518
#7 0x00007ffff69ce484 in DestroyInstance (inst=0xcab6a0, parent=0xcab640) at ascend/compiler/destroyinst.c:641
#8 0x00007ffff69cc7eb in DeleteArrayChild (acp=0x6da670, parent=0xcab640) at ascend/compiler/destroyinst.c:248
#9 0x00007ffff69ce02c in DestroyInstanceParts (i=0xcab640) at ascend/compiler/destroyinst.c:580
#10 0x00007ffff69ce484 in DestroyInstance (inst=0xcab640, parent=0xc9bb50) at ascend/compiler/destroyinst.c:641
#11 0x00007ffff69ccf23 in DestroyInstanceParts (i=0xc9bb50) at ascend/compiler/destroyinst.c:350
#12 0x00007ffff69ce484 in DestroyInstance (inst=0xc9bb50, parent=0xc86e10) at ascend/compiler/destroyinst.c:641
#13 0x00007ffff69ccf23 in DestroyInstanceParts (i=0xc86e10) at ascend/compiler/destroyinst.c:350
#14 0x00007ffff69ce484 in DestroyInstance (inst=0xc86e10, parent=0xc86470) at ascend/compiler/destroyinst.c:641
#15 0x00007ffff69ccf23 in DestroyInstanceParts (i=0xc86470) at ascend/compiler/destroyinst.c:350
#16 0x00007ffff69ce484 in DestroyInstance (inst=0xc86470, parent=0x6ea790) at ascend/compiler/destroyinst.c:641
#17 0x00007ffff69ccd82 in DestroyInstanceParts (i=0x6ea790) at ascend/compiler/destroyinst.c:328
#18 0x00007ffff69ce484 in DestroyInstance (inst=0x6ea790, parent=0x0) at ascend/compiler/destroyinst.c:641
#19 0x00007ffff6ab9cd8 in sim_destroy (sim=0x6ea790) at ascend/compiler/simlist.c:52

john

2013-03-01 13:36

administrator   ~0000956

Valgrind reports as below.

A real atom instance is being destroyed which is later referred to when attempting to destroy a model.array.relation.

ascend/solver/test/test_qrslv.c:175 (test_bug567): Destroying instance tree
==15467== Invalid read of size 4
==15467== at 0x4EC908C: RemoveRelation (mathinst.c:392)
==15467== by 0x4EE9219: DestroyVarList (relation.c:3397)
==15467== by 0x4EE94C9: DestroyRelation (relation.c:3458)
==15467== by 0x4E81D53: DestroyInstanceParts (destroyinst.c:515)
==15467== by 0x4E82215: DestroyInstance (destroyinst.c:638)
==15467== by 0x4E811AF: DeleteArrayChild (destroyinst.c:245)
==15467== by 0x4E8200D: DestroyInstanceParts (destroyinst.c:577)
==15467== by 0x4E82215: DestroyInstance (destroyinst.c:638)
==15467== by 0x4E81637: DestroyInstanceParts (destroyinst.c:347)
==15467== by 0x4E82215: DestroyInstance (destroyinst.c:638)
==15467== by 0x4E81637: DestroyInstanceParts (destroyinst.c:347)
==15467== by 0x4E82215: DestroyInstance (destroyinst.c:638)
==15467== Address 0x77dd720 is 0 bytes inside a block of size 312 free'd
==15467== at 0x4C2A82E: free (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==15467== by 0x4E81957: DestroyInstanceParts (destroyinst.c:422)
==15467== by 0x4E82215: DestroyInstance (destroyinst.c:638)
==15467== by 0x4E81637: DestroyInstanceParts (destroyinst.c:347)
==15467== by 0x4E82215: DestroyInstance (destroyinst.c:638)
==15467== by 0x4E81637: DestroyInstanceParts (destroyinst.c:347)
==15467== by 0x4E82215: DestroyInstance (destroyinst.c:638)
==15467== by 0x4E81637: DestroyInstanceParts (destroyinst.c:347)
==15467== by 0x4E82215: DestroyInstance (destroyinst.c:638)
==15467== by 0x4E81637: DestroyInstanceParts (destroyinst.c:347)
==15467== by 0x4E82215: DestroyInstance (destroyinst.c:638)
==15467== by 0x4E81538: DestroyInstanceParts (destroyinst.c:325)
==15467==

john

2013-03-01 17:13

administrator   ~0000957

I have identified that what is happening is that a real_atom_inst has been destroyed but that somehow there are remaining references to it that haven't been correctly cleared out yet.

The 'DestroyInstance' function seems to primarily do the following

1. attempts to first remove all references to an instance from the 'parents' of the current instance,
2. if a model or array, remove it from pending instance list, if applicable
3. remove instance from the circular 'clique' list
4. remove the parts (children etc) of the instance (recursively, back to '1')

How are variables and relations linked together? A 'struct relation' maintains a list of vars, and a 'RealAtomInstance' maintains a list of relations. When we destroy a relation, DestroyVarList attempts to remove the link to the relation from each variable in the relation's "vars" list. But if the var has already been squashed, this results in an invalid read error from valgrind, as reported above.

HOWEVER, I note that in DestroyInstanceParts, there bit that deals with RealAtomInstance also has a call 'RemoveRelationLinks' which should be fixing up the relation's "var" list via calls to ChangeRelationPointers. That looks like it must be where our problem is, if the cleaning up of blackbox relations isn't yet complete. And the test model contains several blackbox relations.

To be continued...

Issue History

Date Modified Username Field Change
2012-09-30 13:47 john New Issue
2012-09-30 14:21 john Note Added: 0000914
2012-09-30 14:21 john Additional Information Updated View Revisions
2012-09-30 14:22 svn
2012-09-30 23:17 john Note Added: 0000918
2012-09-30 23:19 john Note Edited: 0000918 View Revisions
2012-10-02 12:25 john Note Added: 0000921
2012-10-02 18:50 john Note Added: 0000922
2012-10-02 18:50 john Relationship added related to 0000564
2012-10-02 19:31 svn
2012-10-02 20:11 john Note Added: 0000924
2012-10-02 20:11 john Description Updated View Revisions
2012-10-02 20:11 john Additional Information Updated View Revisions
2012-10-09 14:44 svn
2012-10-09 14:46 john Note Added: 0000926
2013-02-26 13:39 john Target Version 1.0 => 0.9.9
2013-03-01 13:15 svn
2013-03-01 13:36 john Note Added: 0000956
2013-03-01 17:13 john Note Added: 0000957
2013-03-04 19:11 svn
2013-03-04 22:28 svn
2013-03-04 22:28 svn Status new => resolved
2013-03-04 22:28 svn Resolution open => fixed