From: Hugh Sasse Date: 2005-11-05T04:45:03+09:00 Subject: Stack trace consumes information. patch... ---559023410-851401618-1131133493=:15480 Content-Type: MULTIPART/MIXED; BOUNDARY="-559023410-851401618-1131133493=:15480" This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. ---559023410-851401618-1131133493=:15480 Content-Type: TEXT/PLAIN; charset=US-ASCII I have just had output like this from rails: /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.11.1/lib/active_record/connection_adapters/mysql_adapter.rb:119:in `query': Duplicate entry '"00149246 "' for key 2 (Mysql::Error) from /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.11.1/lib/active_record/connection_adapters/mysql_adapter.rb:119:in `execute' from /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.11.1/lib/active_record/connection_adapters/mysql_adapter.rb:113:in `insert' from /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.11.1/lib/active_record/base.rb:1155:in `create_without_callbacks' from /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.11.1/lib/active_record/callbacks.rb:261:in `create_without_timestamps' from /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.11.1/lib/active_record/timestamp.rb:30:in `create' from /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.11.1/lib/active_record/base.rb:1139:in `create_or_update_without_callbacks' from /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.11.1/lib/active_record/callbacks.rb:249:in `create_or_update' from /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.11.1/lib/active_record/base.rb:965:in `save_without_validation' ... 9 levels... from /usr/local/lib/ruby/1.8/open-uri.rb:87:in `open' from populate_tables2.rb:247:in `initialize' from populate_tables2.rb:461:in `new' from populate_tables2.rb:461 neelix hgs 13 %> In those missing 9 levels is the information I need about where my call to the library was. I.e. that would tell me which table I was accessing at the time. The attached patch puts #ifndef...#endif around the definitions for TRACE_HEAD and TRACE_TAIL, to give people the option of adding -DTRACE_TAIL=40 -DTRACE_HEAD=20 to CPPFLAGS and recompiling ruby if they should wish. Since these are not defined anywhere else it should not break any code. It's untested, but I thought I'd post here to see if it is rejected outright, before testing it thoroughly... Thank you, Hugh ---559023410-851401618-1131133493=:15480 Content-Type: TEXT/PLAIN; charset=US-ASCII; name=eval_patch Content-Transfer-Encoding: BASE64 Content-Description: Content-Disposition: attachment; filename=eval_patch LS0tIGV2YWwuYwkyMDA1LTExLTAyIDExOjMzOjE4Ljg1NzI4MDAwMCArMDAw MA0KKysrIG5ld19ldmFsLmMJMjAwNS0xMS0wNCAxOToxNzo1NS41NTExMTgw MDAgKzAwMDANCkBAIC0xMjUzLDggKzEyNTMsMTIgQEANCiAJc3RydWN0IFJB cnJheSAqZXAgPSBSQVJSQVkoZXJyYXQpOw0KIA0KICNkZWZpbmUgVFJBQ0Vf TUFYIChUUkFDRV9IRUFEK1RSQUNFX1RBSUwrNSkNCisjaWZuZGVmIFRSQUNF X0hFQUQNCiAjZGVmaW5lIFRSQUNFX0hFQUQgOA0KKyNlbmRpZg0KKyNpZm5k ZWYgVFJBQ0VfVEFJTA0KICNkZWZpbmUgVFJBQ0VfVEFJTCA1DQorI2VuZGlm DQogDQogCWVwID0gUkFSUkFZKGVycmF0KTsNCiAJZm9yIChpPTE7IGk8ZXAt PmxlbjsgaSsrKSB7DQo= ---559023410-851401618-1131133493=:15480-- ---559023410-851401618-1131133493=:15480--