dylan-lang/opendylan — Issue #182: Regression (2011.1): Bus error in tests
Author: waywardmonkeys
Created: 2012-02-12 04:15:30+00:00
State: open

Hannes commented out this test as it caused a bus error:

````dylan
define test unwind-protects ()
//---*** This results in a Bus error when the C back-end is used
// - hannes (Jan 2012)
check-equal("unwind-protect returns protected",
block () 1 cleanup 2 end, 1);
````

I thought this was odd as I hadn't had that problem before, but sure enough, it works with 2011.1, fails with current master.

The stack trace is:

````
(gdb) bt
#0 SLOT_VALUE (object=0x11, position=2) at /Users/hannes/opendylan/sources/dfmc/c-run-time/run-time.c:4325
#1 0x0019e1d6 in Kgrounded_has_instancesQVKeI (class_=0x11, type_=0x216180) at ./../dylan-test-suite/../dylan/dispatch.c:1032
#2 0x001132e8 in Kprune_methods_by_known_classYdispatch_engine_internalVdylanI (argnum_=0x5, cls_=0x11, ds_=0xec8e70) at ./../dylan-test-suite/../dylan/discrimination.c:4801
#3 0x0010ecc1 in Kwalk_existing_dispatch_engineYdispatch_engine_internalVdylanI (ds_=0xec8e70, e_=0x958d20, recurse_=0x23c394) at ./../dylan-test-suite/../dylan/discrimination.c:2189
#4 0x0020b9be in xep_3 (fn=0x23c394, n=3, a1=0xec8e70, a2=0x958d20, a3=0x23c394) at /Users/hannes/opendylan/sources/dfmc/c-run-time/run-time.c:1814
#5 0x0010f789 in Kwalk_existing_dispatch_engineYdispatch_engine_internalVdylanI (ds_=0xec8e70, e_=0x916080, recurse_=0x23c394) at ./../dylan-test-suite/../dylan/discrimination.c:2482
#6 0x0010e8df in Kcompute_dispatch_from_rootYdispatch_engine_internalVdylanI (ds_=0xec8e70, parent_=0x49f590) at ./../dylan-test-suite/../dylan/discrimination.c:1884
#7 0x00118e13 in Khandle_standard_dispatch_missYdispatch_engine_internalVdylanI (ds_=0xec8e70, cache_=0x933270, parent_=0x49f590) at ./../dylan-test-suite/../dylan/discrimination.c:8325
#8 0x0010e4ea in Kcompute_dispatch_engineYdispatch_engine_internalVdylanI (ds_=0xec8e70) at ./../dylan-test-suite/../dylan/discrimination.c:1749
#9 0x0010b7e7 in Khandle_missed_dispatch_1VKgI (d_=0x216934, parent_=0x49f590, args_=0xbfffba84) at ./../dylan-test-suite/../dylan/new-dispatch.c:14378
#10 0x0010b354 in Khandle_missed_dispatchVKgI (d_=0x216934, parent_=0x49f590, args_=0xbfffba84) at ./../dylan-test-suite/../dylan/new-dispatch.c:14190
#11 0x000fc207 in KPgf_dispatch_absentVKgI (mepargs_=0xbfffba84, e_=0x216934, parent_=0x49f590) at ./../dylan-test-suite/../dylan/new-dispatch.c:3125
#12 0x00206b5a in general_engine_node_n_engine (a1=0xecbac0) at /Users/hannes/opendylan/sources/dfmc/c-run-time/run-time.c:2605
#13 0x001fd4ef in discriminate_engine_2_2 (a1=0xecbac0, a2=0x277434) at /Users/hannes/opendylan/sources/dfmc/c-run-time/run-time.c:3343
#14 0x001fef46 in if_type_discriminator_engine_1_2 (a1=0xecbac0, a2=0x277434) at /Users/hannes/opendylan/sources/dfmc/c-run-time/run-time.c:3475
#15 0x0020348a in primitive_engine_node_apply_with_optionals (engD=0x916080, parent=0x49f590, args=0xbfffbd34) at /Users/hannes/opendylan/sources/dfmc/c-run-time/run-time.c:1690
#16 0x0010b956 in Khandle_missed_dispatch_1VKgI (d_=0x216934, parent_=0x49f578, args_=0xbfffbd34) at ./../dylan-test-suite/../dylan/new-dispatch.c:14425
#17 0x0010b354 in Khandle_missed_dispatchVKgI (d_=0x216934, parent_=0x49f578, args_=0xbfffbd34) at ./../dylan-test-suite/../dylan/new-dispatch.c:14190
#18 0x000fc207 in KPgf_dispatch_absentVKgI (mepargs_=0xbfffbd34, e_=0x216934, parent_=0x49f578) at ./../dylan-test-suite/../dylan/new-dispatch.c:3125
#19 0x00206b5a in general_engine_node_n_engine (a1=0xecbac0) at /Users/hannes/opendylan/sources/dfmc/c-run-time/run-time.c:2605
#20 0x001fd4ef in discriminate_engine_2_2 (a1=0xecbac0, a2=0x277434) at /Users/hannes/opendylan/sources/dfmc/c-run-time/run-time.c:3343
#21 0x001fcb72 in cache_header_engine_2 (a1=0xecbac0, a2=0x277434) at /Users/hannes/opendylan/sources/dfmc/c-run-time/run-time.c:3075
#22 0x00483101 in Kprint_formatYcommon_dylan_internalsVcommon_dylanI (buffer_=0xecbac0, format_string_=0x4a04c0, format_arguments_=0xec9e10) at ./../dylan-test-suite/../common-dylan/format.c:2846
#23 0x0048284b in Kformat_to_stringYcommon_extensionsVcommon_dylanI (format_string_=0x4a04c0, format_arguments_=0xbfffbf70) at ./../dylan-test-suite/../common-dylan/format.c:2667
#24 0x00489c84 in Kcondition_to_stringYcommon_extensionsVcommon_dylanMM2I (error_=0xbde5e8) at ./../dylan-test-suite/../common-dylan/format.c:6062
#25 0x001fd1fb in discriminate_engine_1_1 (a1=0xbde5e8) at /Users/hannes/opendylan/sources/dfmc/c-run-time/run-time.c:3336
#26 0x00203475 in primitive_engine_node_apply_with_optionals (engD=0xe8ee70, parent=0x49f480, args=0xbfffc1b4) at /Users/hannes/opendylan/sources/dfmc/c-run-time/run-time.c:1689
#27 0x0010b917 in Khandle_missed_dispatch_1VKgI (d_=0x216934, parent_=0x49f480, args_=0xbfffc1b4) at ./../dylan-test-suite/../dylan/new-dispatch.c:14416
#28 0x0010b354 in Khandle_missed_dispatchVKgI (d_=0x216934, parent_=0x49f480, args_=0xbfffc1b4) at ./../dylan-test-suite/../dylan/new-dispatch.c:14190
#29 0x000fc207 in KPgf_dispatch_absentVKgI (mepargs_=0xbfffc1b4, e_=0x216934, parent_=0x49f480) at ./../dylan-test-suite/../dylan/new-dispatch.c:3125
#30 0x00206b5a in general_engine_node_n_engine (a1=0xbde5e8) at /Users/hannes/opendylan/sources/dfmc/c-run-time/run-time.c:2605
#31 0x001fde96 in monomorphic_discriminator_engine_1_1 (a1=0xbde5e8) at /Users/hannes/opendylan/sources/dfmc/c-run-time/run-time.c:3406
#32 0x0048988a in Kprint_pretty_nameYcommon_dylan_internalsVcommon_dylanMM1I (buffer_=0xecbd40, condition_=0xbde5e8) at ./../dylan-test-suite/../common-dylan/format.c:5930
#33 0x001ff25b in if_type_discriminator_engine_2_2 (a1=0xecbd40, a2=0xbde5e8) at /Users/hannes/opendylan/sources/dfmc/c-run-time/run-time.c:3481
#34 0x001fcb72 in cache_header_engine_2 (a1=0xecbd40, a2=0xbde5e8) at /Users/hannes/opendylan/sources/dfmc/c-run-time/run-time.c:3075
#35 0x0048302d in Kprint_formatYcommon_dylan_internalsVcommon_dylanI (buffer_=0xecbd40, format_string_=0x5114f4, format_arguments_=0xecbd50) at ./../dylan-test-suite/../common-dylan/format.c:2835
#36 0x0048284b in Kformat_to_stringYcommon_extensionsVcommon_dylanI (format_string_=0x5114f4, format_arguments_=0xbfffc4ac) at ./../dylan-test-suite/../common-dylan/format.c:2667
#37 0x004f94ff in Ksafe_error_to_stringVtestworksI (error_=0xbde5e8) at ./../dylan-test-suite/../testworks/checks.c:1467
#38 0x004f95bb in Kprint_errorVtestworksMM0I (error_=0xbde5e8) at ./../dylan-test-suite/../testworks/checks.c:1499
#39 0x0020b01c in xep_1 (fn=0x5111a8, n=1, a1=0xbde5e8) at /Users/hannes/opendylan/sources/dfmc/c-run-time/run-time.c:1802
#40 0x00503ef2 in Kprint_result_infoVtestworksMM2I (result_=0xbde5b8, Urest_=0xbfffc7ec, indent_=0xeb9460, test_=0x514708) at ./../dylan-test-suite/../testworks/reports.c:1933
#41 0x00209474 in key_mep_4 (a1=0xbde5b8) at /Users/hannes/opendylan/sources/dfmc/c-run-time/run-time.c:2274
#42 0x0020507e in implicit_keyed_single_method_engine_1 (a1=0xbde5b8, optionals=0xbfffc7ec) at /Users/hannes/opendylan/sources/dfmc/c-run-time/run-time.c:3027
#43 0x001fd258 in discriminate_engine_1_2 (a1=0xbde5b8, a2=0xbfffc7ec) at /Users/hannes/opendylan/sources/dfmc/c-run-time/run-time.c:3337
#44 0x00504176 in Kprint_result_infoVtestworksMM2I (result_=0xbe4030, Urest_=0xbfffca1c, indent_=0x514d64, test_=0x514708) at ./../dylan-test-suite/../testworks/reports.c:1975
#45 0x00209474 in key_mep_4 (a1=0xbe4030) at /Users/hannes/opendylan/sources/dfmc/c-run-time/run-time.c:2274
#46 0x0020507e in implicit_keyed_single_method_engine_1 (a1=0xbe4030, optionals=0xbfffca1c) at /Users/hannes/opendylan/sources/dfmc/c-run-time/run-time.c:3027
#47 0x001fd258 in discriminate_engine_1_2 (a1=0xbe4030, a2=0xbfffca1c) at /Users/hannes/opendylan/sources/dfmc/c-run-time/run-time.c:3337
#48 0x00504176 in Kprint_result_infoVtestworksMM2I (result_=0xd954b0, Urest_=0xbfffce7c, indent_=0x216aa8, test_=0x514708) at ./../dylan-test-suite/../testworks/reports.c:1975
#49 0x00209474 in key_mep_4 (a1=0xd954b0) at /Users/hannes/opendylan/sources/dfmc/c-run-time/run-time.c:2274
#50 0x0020507e in implicit_keyed_single_method_engine_1 (a1=0xd954b0, optionals=0xbfffce7c) at /Users/hannes/opendylan/sources/dfmc/c-run-time/run-time.c:3027
#51 0x001fdf16 in monomorphic_discriminator_engine_1_2 (a1=0xd954b0, a2=0xbfffce7c) at /Users/hannes/opendylan/sources/dfmc/c-run-time/run-time.c:3407
#52 0x0020348a in primitive_engine_node_apply_with_optionals (engD=0xa9d900, parent=0x5120b4, args=0xbfffcde4) at /Users/hannes/opendylan/sources/dfmc/c-run-time/run-time.c:1690
#53 0x0010b917 in Khandle_missed_dispatch_1VKgI (d_=0x216934, parent_=0x5120b4, args_=0xbfffcde4) at ./../dylan-test-suite/../dylan/new-dispatch.c:14416
#54 0x0010b354 in Khandle_missed_dispatchVKgI (d_=0x216934, parent_=0x5120b4, args_=0xbfffcde4) at ./../dylan-test-suite/../dylan/new-dispatch.c:14190
#55 0x000fc207 in KPgf_dispatch_absentVKgI (mepargs_=0xbfffcde4, e_=0x216934, parent_=0x5120b4) at ./../dylan-test-suite/../dylan/new-dispatch.c:3125
#56 0x00206b5a in general_engine_node_n_engine (a1=0xd954b0) at /Users/hannes/opendylan/sources/dfmc/c-run-time/run-time.c:2605
#57 0x005047a5 in Kfailures_report_functionVtestworksMM0I (result_=0xd954b0) at ./../dylan-test-suite/../testworks/reports.c:2163
#58 0x0020b01c in xep_1 (fn=0x5140e0, n=1, a1=0xd954b0) at /Users/hannes/opendylan/sources/dfmc/c-run-time/run-time.c:1802
#59 0x00503c7c in Kdisplay_resultsVtestworksMM0I (result_=0xd954b0, Urest_=0xbfffcfe4, report_function_=0x5140e0, report_format_function_=0x5a78bc) at ./../dylan-test-suite/../testworks/reports.c:1828
#60 0x0020f859 in rest_key_xep_4 (fn=0x514110, n=5) at /Users/hannes/opendylan/sources/dfmc/c-run-time/run-time.c:2164
#61 0x0050a871 in Kanonymous_of_run_test_applicationF167I (state_=0x9601a0) at ./../dylan-test-suite/../testworks/command-line.c:2335
#62 0x0020b01c in xep_1 (fn=0x9102d0, n=1, a1=0x9601a0) at /Users/hannes/opendylan/sources/dfmc/c-run-time/run-time.c:1802
#63 0x00473c2a in Kdo_with_profilingYcommon_dylan_internalsVcommon_dylanI (body_=0x9102f8, keywords_=0x99e3f0, result_function_=0x9102d0) at ./../dylan-test-suite/../common-dylan/macros.c:812
#64 0x0050a53d in Krun_test_applicationVtestworksMM0I (parent_=0x97e6e0, Urest_=0xbfffd334, command_name_=0x2161b4, arguments_=0x2161b4, report_format_function_=0x2161b4) at ./../dylan-test-suite/../testworks/command-line.c:2246
#65 0x0020d554 in rest_key_xep_5 (fn=0x5153b4, n=1) at /Users/hannes/opendylan/sources/dfmc/c-run-time/run-time.c:2175
#66 0x00004eed in _Init_dylan_test_suite_app__X_dylan_test_suite_app_for_user () at dylan-test-suite-app.c:114
#67 0x8fe0ed6d in __dyld__ZN16ImageLoaderMachO18doModInitFunctionsERKN11ImageLoader11LinkContextE ()
#68 0x8fe0d31e in __dyld__ZN11ImageLoader23recursiveInitializationERKNS_11LinkContextEj ()
#69 0x8fe0d2c2 in __dyld__ZN11ImageLoader23recursiveInitializationERKNS_11LinkContextEj ()
#70 0x8fe0d3d1 in __dyld__ZN11ImageLoader15runInitializersERKNS_11LinkContextE ()
#71 0x8fe024a9 in __dyld__ZN4dyld24initializeMainExecutableEv ()
#72 0x8fe07950 in __dyld__ZN4dyld5_mainEPK12macho_headermiPPKcS5_S5_ ()
#73 0x8fe018b1 in __dyld__ZN13dyldbootstrap5startEPK12macho_headeriPPKcl ()
#74 0x8fe01057 in __dyld__dyld_start ()
````

This is interesting since it shows that it is actually failing during printing...