From smith.winston.101@REDACTED Tue Nov 1 12:19:51 2011 From: smith.winston.101@REDACTED (Winston Smith) Date: Tue, 1 Nov 2011 07:19:51 -0400 Subject: [erlang-patches] [PATCH] Update xcomp config for AVR32/buildroot-v3.0.0 Message-ID: git fetch http://github.com/smithwinston/otp.git erl-xcomp-avr32 commit 3feb340bd42f15fc4e74e788ffb6372280156f37 Author: smithwinston Date: Tue Nov 1 06:40:23 2011 -0400 Update xcomp config for AVR32/buildroot-v3.0.0 With Atmel's recent buildroot-v3.0.0 release for AVR32, some changes were needed in order to properly cross compile Erlang/OTP for the platform. Tested with R14B04 on a mk I NGW100. https://github.com/smithwinston/otp/commits/erl-xcomp-avr32 https://github.com/smithwinston/otp/commit/3feb340bd42f15fc4e74e788ffb6372280156f37 From henrik@REDACTED Tue Nov 1 15:11:23 2011 From: henrik@REDACTED (Henrik Nord) Date: Tue, 1 Nov 2011 15:11:23 +0100 Subject: [erlang-patches] fix atime mtime In-Reply-To: References: Message-ID: <4EAFFE0B.20601@erlang.org> Issue : http://comments.gmane.org/gmane.comp.lang.erlang.bugs/2657 git fetch git://github.com/spawnthink/otp.git fix_atime_mtime https://github.com/spawnthink/otp/compare/fix_atime_mtime https://github.com/spawnthink/otp/compare/fix_atime_mtime.patch -- On 10/27/2011 09:50 PM, Ahmed Omar wrote: > Added another fix there > https://github.com/spawnthink/otp/commit/cbe886c1fdb9db4a639aa911f9c691b4d86ec48b > > for issue reported by systemio@REDACTED > > Please refetch > > Note : please let me know if you need me to separate them in different > branches. Hi Regarding the first patch, (atime, mtime) we will not use it due to our aim to rewrite those parts of the file driver for R15 The second part, when file:change_time/2,3 are called with invalid dates, we would like. Could you separate that in its own branch, with a properly formatted commit msg for me? https://github.com/erlang/otp/wiki/Writing-good-commit-messages (line length , imperative mode fix, instead of fixes etc..) -- /Henrik Nord Erlang/OTP -------------- next part -------------- An HTML attachment was scrubbed... URL: From spawn.think@REDACTED Tue Nov 1 16:13:20 2011 From: spawn.think@REDACTED (Ahmed Omar) Date: Tue, 1 Nov 2011 16:13:20 +0100 Subject: [erlang-patches] fix atime mtime In-Reply-To: <4EAFFE0B.20601@erlang.org> References: <4EAFFE0B.20601@erlang.org> Message-ID: git fetch git://github.com/spawnthink/otp.git fix_change_time_inval_dates https://github.com/spawnthink/otp/compare/fix_change_time_inval_dates https://github.com/spawnthink/otp/compare/fix_change_time_inval_dates.patch On Tue, Nov 1, 2011 at 3:11 PM, Henrik Nord wrote: > > Issue : http://comments.gmane.org/gmane.comp.lang.erlang.bugs/2657 > > git fetch git://github.com/spawnthink/otp.git fix_atime_mtime > > https://github.com/spawnthink/otp/compare/fix_atime_mtime > > > https://github.com/spawnthink/otp/compare/fix_atime_mtime.patch > > -- > > On 10/27/2011 09:50 PM, Ahmed Omar wrote: > > Added another fix there > > https://github.com/spawnthink/otp/commit/cbe886c1fdb9db4a639aa911f9c691b4d86ec48b > > for issue reported by systemio@REDACTED > > Please refetch > > Note : please let me know if you need me to separate them in different > branches. > > > > > Hi > Regarding the first patch, (atime, mtime) we will not use it due to our > aim to rewrite those parts of the file driver for R15 > > The second part, when file:change_time/2,3 are called with invalid dates, > we would like. > > Could you separate that in its own branch, with a properly formatted > commit msg for me? > https://github.com/erlang/otp/wiki/Writing-good-commit-messages > (line length , imperative mode fix, instead of fixes etc..) > > > > -- > /Henrik Nord Erlang/OTP > > -- Best Regards, - Ahmed Omar http://nl.linkedin.com/in/adiaa Follow me on twitter @spawn_think -------------- next part -------------- An HTML attachment was scrubbed... URL: From cyg.cao@REDACTED Wed Nov 2 07:11:44 2011 From: cyg.cao@REDACTED (Wei Cao) Date: Wed, 2 Nov 2011 14:11:44 +0800 Subject: [erlang-patches] fix eunit to print stacktrace correctly Message-ID: R15 adds file and lineno in the result of erlang:get_stacktrace/0, so eunit should be updated accordingly to accomodate the new stacktrace format. before fix: wei@REDACTED:~/codebase/mysql_prj/rds/trunk/rds$ make eunit module 'rds_lib' rds_la_split_file: read_test (module 'rds_la_split_file')...*failed* ::{badmatch,nomatch} after fix: wei@REDACTED:~/codebase/mysql_prj/rds/trunk/rds$ make eunit module 'rds_lib' rds_la_split_file: read_test (module 'rds_la_split_file')...rds_la_split_file: read_test (module 'rds_la_split_file')...*failed* ::error:{badmatch,nomatch} in function rds_la_split_file:'-dates/1-fun-0-'/2 [src/rds_la_split_file.erl:149] in call from lists:map/2 [lists.erl:1168] in call from rds_la_split_file:'-dates/1-fun-1-'/1 [src/rds_la_split_file.erl:147] in call from lists:map/2 [lists.erl:1168] in call from rds_la_split_file:dates/1 [src/rds_la_split_file.erl:145] in call from rds_la_split_file:seek_date/2 [src/rds_la_split_file.erl:136] in call from rds_la_split_file:read_test/0 [src/rds_la_split_file.erl:194] git fetch git://github.com/weicao/otp.git fix_eunit_print_stacktrace https://github.com/weicao/otp/compare/fix_eunit_print_stacktrace https://github.com/weicao/otp/compare/fix_eunit_print_stacktrace.patch -- Best, Wei Cao -------------- next part -------------- An HTML attachment was scrubbed... URL: From henrik@REDACTED Wed Nov 2 09:52:40 2011 From: henrik@REDACTED (Henrik Nord) Date: Wed, 2 Nov 2011 09:52:40 +0100 Subject: [erlang-patches] fix eunit to print stacktrace correctly In-Reply-To: References: Message-ID: <4EB104D8.8000904@erlang.org> On 11/02/2011 07:11 AM, Wei Cao wrote: > R15 adds file and lineno in the result of erlang:get_stacktrace/0, so > eunit should be updated accordingly to accomodate the new stacktrace > format. > > before fix: > > wei@REDACTED:~/codebase/mysql_prj/rds/trunk/rds$ make eunit > module 'rds_lib' > rds_la_split_file: read_test (module 'rds_la_split_file')...*failed* > ::{badmatch,nomatch} > > after fix: > wei@REDACTED:~/codebase/mysql_prj/rds/trunk/rds$ make eunit > module 'rds_lib' > rds_la_split_file: read_test (module > 'rds_la_split_file')...rds_la_split_file: read_test (module > 'rds_la_split_file')...*failed* > ::error:{badmatch,nomatch} > in function rds_la_split_file:'-dates/1-fun-0-'/2 > [src/rds_la_split_file.erl:149] > in call from lists:map/2 [lists.erl:1168] > in call from rds_la_split_file:'-dates/1-fun-1-'/1 > [src/rds_la_split_file.erl:147] > in call from lists:map/2 [lists.erl:1168] > in call from rds_la_split_file:dates/1 [src/rds_la_split_file.erl:145] > in call from rds_la_split_file:seek_date/2 > [src/rds_la_split_file.erl:136] > in call from rds_la_split_file:read_test/0 > [src/rds_la_split_file.erl:194] > > > git fetch git://github.com/weicao/otp.git > fix_eunit_print_stacktrace > > > https://github.com/weicao/otp/compare/fix_eunit_print_stacktrace > > > https://github.com/weicao/otp/compare/fix_eunit_print_stacktrace.patch > > > > > -- > > Best, > > Wei Cao > > > _______________________________________________ > erlang-patches mailing list > erlang-patches@REDACTED > http://erlang.org/mailman/listinfo/erlang-patches Thank you! I have included this in 'pu' -- /Henrik Nord Erlang/OTP -------------- next part -------------- An HTML attachment was scrubbed... URL: From henrik@REDACTED Wed Nov 2 09:53:41 2011 From: henrik@REDACTED (Henrik Nord) Date: Wed, 2 Nov 2011 09:53:41 +0100 Subject: [erlang-patches] fix atime mtime In-Reply-To: References: <4EAFFE0B.20601@erlang.org> Message-ID: <4EB10515.7000109@erlang.org> On 11/01/2011 04:13 PM, Ahmed Omar wrote: > > git fetch git://github.com/spawnthink/otp.git > fix_change_time_inval_dates > > https://github.com/spawnthink/otp/compare/fix_change_time_inval_dates > > https://github.com/spawnthink/otp/compare/fix_change_time_inval_dates.patch > > > On Tue, Nov 1, 2011 at 3:11 PM, Henrik Nord > wrote: > > > Issue : http://comments.gmane.org/gmane.comp.lang.erlang.bugs/2657 > > git fetch git://github.com/spawnthink/otp.git > fix_atime_mtime > > https://github.com/spawnthink/otp/compare/fix_atime_mtime > > > > https://github.com/spawnthink/otp/compare/fix_atime_mtime.patch > > > -- > > On 10/27/2011 09:50 PM, Ahmed Omar wrote: >> Added another fix there >> https://github.com/spawnthink/otp/commit/cbe886c1fdb9db4a639aa911f9c691b4d86ec48b >> >> for issue reported by systemio@REDACTED >> >> Please refetch >> >> Note : please let me know if you need me to separate them in >> different branches. > > > > Hi > Regarding the first patch, (atime, mtime) we will not use it due > to our aim to rewrite those parts of the file driver for R15 > > The second part, when file:change_time/2,3 are called with invalid > dates, we would like. > > Could you separate that in its own branch, with a properly > formatted commit msg for me? > https://github.com/erlang/otp/wiki/Writing-good-commit-messages > (line length , imperative mode fix, instead of fixes etc..) > > > > -- > /Henrik Nord Erlang/OTP > > > > > -- > Best Regards, > - Ahmed Omar > http://nl.linkedin.com/in/adiaa > Follow me on twitter > @spawn_think > Thank you! I have included your branch in 'pu' -- /Henrik Nord Erlang/OTP -------------- next part -------------- An HTML attachment was scrubbed... URL: From henrik@REDACTED Wed Nov 2 10:02:19 2011 From: henrik@REDACTED (Henrik Nord) Date: Wed, 2 Nov 2011 10:02:19 +0100 Subject: [erlang-patches] [PATCH] Update xcomp config for AVR32/buildroot-v3.0.0 In-Reply-To: References: Message-ID: <4EB1071B.7080703@erlang.org> On 11/01/2011 12:19 PM, Winston Smith wrote: > git fetch http://github.com/smithwinston/otp.git erl-xcomp-avr32 > > commit 3feb340bd42f15fc4e74e788ffb6372280156f37 > Author: smithwinston > Date: Tue Nov 1 06:40:23 2011 -0400 > > Update xcomp config for AVR32/buildroot-v3.0.0 > > With Atmel's recent buildroot-v3.0.0 release for AVR32, some changes > were needed in order to properly cross compile Erlang/OTP for the > platform. > > Tested with R14B04 on a mk I NGW100. > > > https://github.com/smithwinston/otp/commits/erl-xcomp-avr32 > https://github.com/smithwinston/otp/commit/3feb340bd42f15fc4e74e788ffb6372280156f37 > _______________________________________________ > erlang-patches mailing list > erlang-patches@REDACTED > http://erlang.org/mailman/listinfo/erlang-patches Hi Your branch was abit strange with 2 commits of the same code, with different commit msg and then a merge. I cherry-picked the lower one e89c2af4ce98e4b870b63a0c634bd96c504419f6 with the proper commit msg. It is now included in 'pu' Thank you for the contribution -- /Henrik Nord Erlang/OTP From henrik@REDACTED Wed Nov 2 10:07:29 2011 From: henrik@REDACTED (Henrik Nord) Date: Wed, 2 Nov 2011 10:07:29 +0100 Subject: [erlang-patches] An ODBC process should exit normally if its client exits with 'shutdown' In-Reply-To: <568484fa-5510-4448-91ab-1c8343ca2334@knuth> References: <568484fa-5510-4448-91ab-1c8343ca2334@knuth> Message-ID: <4EB10851.2050500@erlang.org> On 10/21/2011 06:52 PM, Magnus Henoch wrote: > I noticed that ODBC processes would always generate crash reports when > our system was being shut down, and came up with this patch: > > git fetch git://github.com/legoscia/otp.git odbc-shutdown-normal-exit > > https://github.com/legoscia/otp/compare/odbc-shutdown-normal-exit > https://github.com/legoscia/otp/compare/odbc-shutdown-normal-exit.patch > > Here is an example of such a crash report: > > =CRASH REPORT==== 21-Oct-2011::16:52:55 === > crasher: > initial call: odbc:init/1 > pid:<0.2685.0> > registered_name: [] > exception exit: {stopped,{'EXIT',<0.2684.0>,shutdown}} > in function gen_server:terminate/6 > ancestors: [odbc_sup,<0.2520.0>] > messages: [{'EXIT',#Port<0.26070>,normal}] > links: [<0.2521.0>] > dictionary: [] > trap_exit: true > status: running > heap_size: 610 > stack_size: 24 > reductions: 1483 > neighbours: > Thank you for the contribution, your branch is included in 'pu' -- /Henrik Nord Erlang/OTP From henrik@REDACTED Wed Nov 2 11:04:14 2011 From: henrik@REDACTED (Henrik Nord) Date: Wed, 2 Nov 2011 11:04:14 +0100 Subject: [erlang-patches] jinterface: workaround for a Java bug In-Reply-To: References: Message-ID: <4EB1159E.40204@erlang.org> On 10/20/2011 02:38 PM, Vlad Dumitrescu wrote: > git fetch git://github.com/vladdu/opt.git java_string_bug > > https://github.com/vladdu/otp/compare/java_string_bug > https://github.com/vladdu/otp/compare/java_string_bug.patch > > OtpErlangString is affected by Java bug > http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6242664 > > Java 1.5 has a bug where detecting codepoint offsets in strings that are > created by String.substring() gives wrong results. The new implementation > uses a different method, avoinding the issue. > > The following code will crash without the fix: > final String s = "abcdefg"; > final String ss = s.substring(3, 6); > final int[] cps = OtpErlangString.stringToCodePoints(ss); > > regards, > Vlad > _______________________________________________ > erlang-patches mailing list > erlang-patches@REDACTED > http://erlang.org/mailman/listinfo/erlang-patches Hi We would like a test for this. The suggestion is to extend the lists_roundtrip_2 test in nc_SUIT.erl by adding a new tag for the codepoint operation, and consequently adding the same to echo_server.java similar to how "sub3atom" is done. Thank you for the contribution! -- /Henrik Nord Erlang/OTP From henrik@REDACTED Wed Nov 2 12:06:01 2011 From: henrik@REDACTED (Henrik Nord) Date: Wed, 2 Nov 2011 12:06:01 +0100 Subject: [erlang-patches] Improving doc on node lookup In-Reply-To: <1312905648292-3730381.post@n4.nabble.com> References: <1312905648292-3730381.post@n4.nabble.com> Message-ID: <4EB12419.3050205@erlang.org> On 08/09/2011 06:00 PM, Vincenzo Maggio wrote: > Hello, > following > http://erlang.2086793.n4.nabble.com/Erlang-doesn-t-connect-with-short-long-names-tp3702366p3702366.html > Erlang doesn't connect with "short" long names I created a patch to improve > Erlang documentation on topic. > Please feel free to add suggestions, critics and whatever you consider > useful to this topic. > The patch can be found at > https://github.com/eliaballade/otp/commit/56a67c9c3f61d4bf766fb56ac065f6e064da1319 > https://github.com/eliaballade/otp/commit/56a67c9c3f61d4bf766fb56ac065f6e064da1319 > . > Thanks! > > -- > View this message in context: http://erlang.2086793.n4.nabble.com/Improving-doc-on-node-lookup-tp3730381p3730381.html > Sent from the Erlang Patches mailing list archive at Nabble.com. > _______________________________________________ > erlang-patches mailing list > erlang-patches@REDACTED > http://erlang.org/mailman/listinfo/erlang-patches Hi Can you send a git fetch link for this? somehow I am unable to use the banchname or the SHA-1 for fetching this. -- /Henrik Nord Erlang/OTP From smith.winston.101@REDACTED Thu Nov 3 05:14:47 2011 From: smith.winston.101@REDACTED (Winston Smith) Date: Thu, 3 Nov 2011 00:14:47 -0400 Subject: [erlang-patches] [PATCH] Update xcomp config for AVR32/buildroot-v3.0.0 In-Reply-To: <4EB1071B.7080703@erlang.org> References: <4EB1071B.7080703@erlang.org> Message-ID: On Wed, Nov 2, 2011 at 5:02 AM, Henrik Nord wrote: > Your branch was abit strange with 2 commits of the same code, with different > commit msg and then a merge. > > I cherry-picked the lower one e89c2af4ce98e4b870b63a0c634bd96c504419f6 with > the proper commit msg. Yeah, I amended the commit message as the initial one didn't have the line breaks in the 2nd part. I wasn't sure how to only have one "correct" commit > It is now included in 'pu' > > Thank you for the contribution Fantastic, thank you! From sg2342@REDACTED Mon Nov 7 17:28:31 2011 From: sg2342@REDACTED (Stefan Grundmann) Date: Mon, 7 Nov 2011 16:28:31 +0000 Subject: [erlang-patches] [PATCH] fix EST leak in snmp_note_store Message-ID: <201111071628.32059.sg2342@googlemail.com> fix GC timer in snmp_note_store in deactivate_timer/1 the new state of the timer is not set correctly, instead the timeout value set to 'false', resulting in a "crash loop" when the snmp note store process tries to restart the timer process. the incorrect activation state also leads to an ETS memory leak: an expired note will not get deleted except when snmp_note_store:get_note/2 is called with its key - the GC mechanism does not work because a deactivated timer will never be activated again. Commit that corrects this issue: git fetch git://github.com/sg2342/otp.git fix-snmp_note_store_timer Inline diff: diff --git a/lib/snmp/src/misc/snmp_note_store.erl b/lib/snmp/src/misc/snmp_note index a21a620..5bb5cb4 100644 --- a/lib/snmp/src/misc/snmp_note_store.erl +++ b/lib/snmp/src/misc/snmp_note_store.erl @@ -282,7 +282,7 @@ deactivate_timer(#state{timer = Pid, active = true} = State) receive deactivated -> ok end, - State#state{timeout = false}; + State#state{active = false}; deactivate_timer(State) -> State. Regression test: git fetch git://github.com/sg2342/otp.git snmp_note_store_timer-tc best regards Stefan Grundmann From fritchie@REDACTED Tue Nov 8 10:28:42 2011 From: fritchie@REDACTED (Scott Lystig Fritchie) Date: Tue, 08 Nov 2011 03:28:42 -0600 Subject: [erlang-patches] DTrace patch, review draft #1 Message-ID: <42487.1320744522@snookles.snookles.com> Hi, all. Here's the first draft of a DTrace patch to start the review process. Contrary to the commit message (sorry!), this patch as-is is broken for Linux+SystemTap. (It still works for OS X Snow Leopard and Solaris 10.) The Linux+SystemTap breakage is temporary and will be fixed before a final patch is submitted. git clone git://github.com/slfritchie/otp.git dtrace-review1 https://github.com/slfritchie/otp/compare/9a064a8c4f33d091c424bd23713bf76cd0ac7826...dtrace-review1 https://github.com/slfritchie/otp/compare/9a064a8c4f33d091c424bd23713bf76cd0ac7826...dtrace-review1.patch I'll include the commit message below. -Scott --- snip --- snip --- snip --- snip --- snip --- snip --- Add DTrace support for OS X, Solaris, and Linux (via SystemTap) Since it's been quite a while since I've written C code, *and* I haven't done any significant hacking on the VM itself in years, it's quite likely that I haven't done things in 100% proper style. Or my co-collaborators Dustin Sallings (CouchBase) or Michal Ptaszek (Erlang Solutions). My intent for this patch is to start discussion and review of DTrace support for consideration for the R15 release. For additional background on the motivation for this work, please see the slides for the presentation at the Erlang User Conference 2011 in Stockholm: https://www.erlang-factory.com/upload/presentations/462/euc2011-draft2.pdf Add autoconf support: use "./configure --enable-dtrace" on all supported platforms: * OS X Snow Leopard or later * Solaris 10 or OpenSolaris * Linux, via SystemTap's DTrace compatibility packages See the file `erts/emulator/beam/erlang_dtrace.d` for the definition of all DTrace probes in the virtual machine so far. Example D scripts can be found in `lib/dtrace/examples`. Note that if you see the error message `{name of probe} does not match any probes`, then there is no Erlang VM process + DTrace probes running. To fix, start a DTrace-enabled VM or remove `-q` from the `dtrace` command line. The `lib/dtrace` directory contains a small code-only OTP application that contains code that allows Erlang code to trigger a DTrace probe. Dynamic creation & deletion of DTrace probes is not currently supported, so the `dtrace:p()` function is hacked to allow a variable number of arguments (up to four integers and up to four strings) to be used. See the comments at the top of `lib/dtrace/src/dtrace.c` for more detail. One feature that may be controversial is the notion I've introduced of a special process dictionary key that can be used by Erlang code to tag I/O operations for an application-specific purpose. Right now, that tag's name is `dtrace_utag`. The dictionary keys used by `sys` and other modules start with a dollar sign. Perhaps there is some convention (but not a dollar sign?) that this tag should use? The purpose of the process dictionary key is to allow the tag to be included in trace messages, e.g. for file I/O, without changing the API of the `file.erl` module's functions. For example, here's a use of the tag when calling the `file:rename/2` function: (bar@REDACTED)1> put(dtrace_utag, "GGOOOAAALL!!!!!"). undefined (bar@REDACTED)2> dtrace:init(). ok %% Now start both the `user-probe.d` and `efile_drv.d` D scripts %% found in the `lib/dtrace/examples` directory. (bar@REDACTED)3> dtrace:p(7, 8, 9, "one", "four"). true %% The output from the `user-probe.d` script: <0.40.0> GGOOOAAALL!!!!! 7 8 9 0 'one' 'four' '' '' (bar@REDACTED)4> file:rename("old-name", "new-name"). {error,enoent} %% The output from the `efile_drv.d` script: async I/O pool port #Port<0.59> queue len 1 async I/O pool port #Port<0.59> queue len 0 efile_drv enter tag={1,110} user tag GGOOOAAALL!!!!! | RENAME (12) | args: old-name new-name , 0 0 (port #Port<0.59>) async I/O worker tag={1,110} | RENAME (12) | efile_drv-int_entry async I/O worker tag={1,110} | RENAME (12) | efile_drv-int_return efile_drv return tag={1,110} user tag GGOOOAAALL!!!!! | RENAME (12) | errno 2 I'm not exactly happy with this choice of tagging, namely using `put(dtrace_utag, Tag::list())`. But this is an experiment, so we'll see how it goes. I can't imagine changing the API for all file.erl functions in order pass the tag explicitly. Some modules have some extensive (ab)use of the C preprocessor to reduce the amount of #ifdefs that clutter the code. In several places, I have not #ifdef'ed automatic variables because of clutter. For the same reason, there are a handful of cases where I added DTrace-related members to a struct definition without an #ifdef. I feel that the result is easier to read than earlier drafts where I did use many more `https://github.com/slfritchie/otp/tree/dtrace-experiment+michal2` if you're curious.) I expect there may be some debate about whether the bloat of the affected structs is worthwhile. I erred on adding stuff to structs, especially in the efile_drv.c driver, not having a full grasp on what was thread-safe and what was not ... so I erred on the side of caution. The efile_drv.c has a work-around for a crazy GCC optimization bug. Thank goodness for Google, I dunno how I would've found a work-around for this silly thing. Many thanks to Trond Norbye for writing clearly about the problem in a membase Git repo commit message. /* * A note on probe naming: if "__" appears in a provider probe * definition, then two things happen during compilation: * * 1. The "__" will turn into a hypen, "-", for the probe name. * 2. The "__" will turn into a single underscore, "_", for the * macro names and function definitions that the compiler and * C developers will see. * * We'll try to use the following naming convention. We're a bit * limited because, as a USDT probe, we can only specify the 4th part * of the probe name, e.g. erlang*:::mumble. The 2nd part of the * probe name is always going to be "beam" or "beam.smp", and the 3rd * part of the probe name will always be the name of the function * that's calling the probe. * * So, all probes will be have names defined in this file using the * convention category__name or category__sub_category__name. This * will translate to probe names of category-name or * category-sub_category-name. * * Each of "category", "sub_category", and "name" may have underscores * but may not have hyphens. */ Add tentative support for sequential tracing sending, queueing, and receiving a message. I don't believe I've fully covered all the major places where it would be useful to have the sequential trace token info in a probe -- guidance from the OTP team would be helpful, if there's time to do that kind of review. Add global variable `erts_this_node_sysname`. The purpose of this new global variable is to have quick access to the local node name without having to acquire locks to look at the `erts_this_node` variable safely. [Though, after some later view, this isn't really required??] From mikpe@REDACTED Tue Nov 8 11:12:57 2011 From: mikpe@REDACTED (Mikael Pettersson) Date: Tue, 8 Nov 2011 11:12:57 +0100 Subject: [erlang-patches] DTrace patch, review draft #1 In-Reply-To: <42487.1320744522@snookles.snookles.com> References: <42487.1320744522@snookles.snookles.com> Message-ID: <20153.169.870266.493255@pilspetsen.it.uu.se> Scott Lystig Fritchie writes: > The efile_drv.c has a work-around for a crazy GCC optimization bug. > Thank goodness for Google, I dunno how I would've found a work-around > for this silly thing. Many thanks to Trond Norbye for writing clearly > about the problem in a membase Git repo commit message. If you or Trond believe there is a bug in gcc then _please_ report it to gcc's bugzilla for proper analysis. Neither this patch nor Trond's memcached patch contains enough detail for me to verify the presence or absence of the alleged bug. [BTW, your workaround for the bug is itself buggy. You're causing signed integer overflow which in turn causes undefined behaviour. Better make the 'gcc_optimizer_hack' variable unsigned.] If you don't want to report the bug to gcc's bugzilla, then I can take care of that _if_ you provide a standalone (self-contained with no external dependencies except libc) test case that reproduces the bug. /Mikael From henrik@REDACTED Tue Nov 8 12:12:15 2011 From: henrik@REDACTED (Henrik Nord) Date: Tue, 8 Nov 2011 12:12:15 +0100 Subject: [erlang-patches] [PATCH] fix EST leak in snmp_note_store In-Reply-To: <201111071628.32059.sg2342@googlemail.com> References: <201111071628.32059.sg2342@googlemail.com> Message-ID: <4EB90E8F.4000204@erlang.org> On 11/07/2011 05:28 PM, Stefan Grundmann wrote: > fix GC timer in snmp_note_store > > in deactivate_timer/1 the new state of the timer is not set correctly, > instead the timeout value set to 'false', resulting in a "crash loop" > when the snmp note store process tries to restart the timer process. > > the incorrect activation state also leads to an ETS memory leak: > an expired note will not get deleted except when > snmp_note_store:get_note/2 is called with its key - the GC mechanism > does not work because a deactivated timer will never be activated again. > > Commit that corrects this issue: > > git fetch git://github.com/sg2342/otp.git fix-snmp_note_store_timer > > Inline diff: > > diff --git a/lib/snmp/src/misc/snmp_note_store.erl > b/lib/snmp/src/misc/snmp_note > index a21a620..5bb5cb4 100644 > --- a/lib/snmp/src/misc/snmp_note_store.erl > +++ b/lib/snmp/src/misc/snmp_note_store.erl > @@ -282,7 +282,7 @@ deactivate_timer(#state{timer = Pid, active = true} = > State) > receive > deactivated -> ok > end, > - State#state{timeout = false}; > + State#state{active = false}; > deactivate_timer(State) -> > State. > > > Regression test: > > git fetch git://github.com/sg2342/otp.git snmp_note_store_timer-tc > > best regards > > Stefan Grundmann > _______________________________________________ > erlang-patches mailing list > erlang-patches@REDACTED > http://erlang.org/mailman/listinfo/erlang-patches Thank you for your contribution! included the revised branch into 'pu' -- /Henrik Nord Erlang/OTP From fritchie@REDACTED Wed Nov 9 18:36:58 2011 From: fritchie@REDACTED (Scott Lystig Fritchie) Date: Wed, 09 Nov 2011 11:36:58 -0600 Subject: [erlang-patches] DTrace patch, review draft #1 In-Reply-To: Message of "Tue, 08 Nov 2011 11:12:57 +0100." <20153.169.870266.493255@pilspetsen.it.uu.se> Message-ID: <71125.1320860218@snookles.snookles.com> Mikael Pettersson wrote: mp> If you or Trond believe there is a bug in gcc then _please_ report mp> it to gcc's bugzilla for proper analysis. Neither this patch nor mp> Trond's memcached patch contains enough detail for me to verify the mp> presence or absence of the alleged bug. Mikael, I don't know if that bug is already fixed. If memory serves me correctly, the bug is in the version of GCC 4.2.1 that I use on Solaris 10. Assuming that the bug is indeed fixed in a later branch, expecting Erlang users to correcly update their 64-bit compiler toolchain that is otherwise not buggy enough to screw up anything else ... seems to me to be a very high expectation. Regarding the workaround, some research suggests that using 'asm("")' instead of 'gcc_optimizer_hack++' might have the same effect. But I don't know enough about C compilers to know if it would work with non-GCC compilers. -Scott From aschultz@REDACTED Fri Nov 11 15:29:20 2011 From: aschultz@REDACTED (Andreas Schultz) Date: Fri, 11 Nov 2011 15:29:20 +0100 (CET) Subject: [erlang-patches] DTrace patch, review draft #1 In-Reply-To: <42487.1320744522@snookles.snookles.com> Message-ID: Hi Scott, When trying to compile this with gcc-4.6 and systemtap 1.6 on Ubuntu Oneiric, I run into some problems: * erts_this_node_sysname usage produces errors like this: gcc -g -O3 -fomit-frame-pointer -I/usr/src/dtrace-review1/erts/x86_64-unknown-linux-gnu -fno-tree-copyrename -D_GNU_SOURCE -DERTS_SMP -DHAVE_CONFIG_H -Wall -Wstrict-prototypes -Wmissing-prototypes -Wdeclaration-after-statement -DUSE_THREADS -D_THREAD_SAFE -D_REENTRANT -DPOSIX_THREADS -D_POSIX_THREAD_SAFE_FUNCTIONS -Ix86_64-unknown-linux-gnu/opt/smp -Ibeam -Isys/unix -Isys/common -Ix86_64-unknown-linux-gnu -Izlib -Ipcre -Ihipe -I../include -I../include/x86_64-unknown-linux-gnu -I../include/internal -I../include/internal/x86_64-unknown-linux-gnu -c beam/dist.c -o obj/x86_64-unknown-linux-gnu/opt/smp/dist.o beam/dist.c: In function ?dsig_send?: beam/dist.c:1691:1: error: invalid application of ?sizeof? to incomplete type ?char[]? beam/dist.c:1751:1: error: invalid application of ?sizeof? to incomplete type ?char[]? The problem is systemtap, it uses a lot of preprocessor magic to at the end generate a sizeof(erts_this_node_sysname). Since erts_this_node_sysname is defined as 'extern char erts_this_node_sysname[];', this will cause the error above. I have fixed that by changing the extern declaration to match the actual declaration: diff --git a/erts/emulator/beam/erl_node_tables.h b/erts/emulator/beam/erl_node_tables.h index 364d8eb..b884100 100644 --- a/erts/emulator/beam/erl_node_tables.h +++ b/erts/emulator/beam/erl_node_tables.h @@ -169,7 +169,7 @@ extern Sint erts_no_of_not_connected_dist_entries; extern DistEntry *erts_this_dist_entry; extern ErlNode *erts_this_node; -extern char erts_this_node_sysname[]; +extern char erts_this_node_sysname[64+1]; DistEntry *erts_channel_no_to_dist_entry(Uint); DistEntry *erts_sysname_to_connected_dist_entry(Eterm); * DTRACE/STAP_PROBE11 does no exist in systemtap gcc -g -O2 -I/usr/src/dtrace-review1/erts/x86_64-unknown-linux-gnu -fno-tree-copyrename -D_GNU_SOURCE -DHAVE_CONFIG_H -Wall -Wstrict-prototypes -Wmissing-prototypes -Wdeclaration-after-statement -DUSE_THREADS -D_THREAD_SAFE -D_REENTRANT -DPOSIX_THREADS -D_POSIX_THREAD_SAFE_FUNCTIONS -DLIBSCTP= -Ix86_64-unknown-linux-gnu/opt/plain -Ibeam -Isys/unix -Isys/common -Ix86_64-unknown-linux-gnu -Izlib -Ipcre -Ihipe -I../include -I../include/x86_64-unknown-linux-gnu -I../include/internal -I../include/internal/x86_64-unknown-linux-gnu -Idrivers/common -Idrivers/unix -c drivers/common/efile_drv.c -o obj/x86_64-unknown-linux-gnu/opt/plain/efile_drv.o drivers/common/efile_drv.c: In function ?flush_write?: drivers/common/efile_drv.c:1936:9: warning: implicit declaration of function ?STAP_PROBE11? [-Wimplicit-function-declaration] SystemTap only defines wrapper macros for up to 10 arguments. I have filed a bug with systemtap for this: http://sourceware.org/bugzilla/show_bug.cgi?id=13404 In the meantime since there are only a very few places that use 11 arguments, providing the macro our self should be ok. There is a variadic version of the STAP_PROBE macro, but that actually uses the fixed size macros in the end. diff --git a/erts/emulator/beam/dtrace-wrapper.h b/erts/emulator/beam/dtrace-wrapper.h index 55c3e6b..49e997d 100644 --- a/erts/emulator/beam/dtrace-wrapper.h +++ b/erts/emulator/beam/dtrace-wrapper.h @@ -59,6 +59,16 @@ inline void dtrace_fun_decode(Process *process, #define DTRACE11(name, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) \ erlang_##name((a0), (a1), (a2), (a3), (a4), (a5), (a6), (a7), (a8), (a9), (a10)) +#if defined(_SDT_PROBE) && !defined(STAP_PROBE11) +/* work arround for missing STAP macro */ +#define STAP_PROBE11(provider,name,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11) \ + _SDT_PROBE(provider, name, 11, \ + (arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11)) +#define _SDT_ASM_OPERANDS_11(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11) \ + _SDT_ASM_OPERANDS_10(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9,arg10), \ + _SDT_ARG(11, arg11) +#endif + #else /* HAVE_DTRACE */ /* Render all macros to do nothing */ Andreas ----- Original Message ----- > Hi, all. Here's the first draft of a DTrace patch to start the > review > process. Contrary to the commit message (sorry!), this patch as-is > is > broken for Linux+SystemTap. (It still works for OS X Snow Leopard > and > Solaris 10.) The Linux+SystemTap breakage is temporary and will be > fixed before a final patch is submitted. > > git clone git://github.com/slfritchie/otp.git dtrace-review1 > > https://github.com/slfritchie/otp/compare/9a064a8c4f33d091c424bd23713bf76cd0ac7826...dtrace-review1 > https://github.com/slfritchie/otp/compare/9a064a8c4f33d091c424bd23713bf76cd0ac7826...dtrace-review1.patch > > I'll include the commit message below. > > -Scott > > --- snip --- snip --- snip --- snip --- snip --- snip --- > > Add DTrace support for OS X, Solaris, and Linux (via SystemTap) > > Since it's been quite a while since I've written C code, *and* I > haven't done any significant hacking on the VM itself in years, it's > quite likely that I haven't done things in 100% proper style. Or > my co-collaborators Dustin Sallings (CouchBase) or Michal Ptaszek > (Erlang Solutions). My intent for this patch is to start discussion > and review of DTrace support for consideration for the R15 release. > > For additional background on the motivation for this work, please > see the slides for the presentation at the Erlang User Conference > 2011 > in Stockholm: > https://www.erlang-factory.com/upload/presentations/462/euc2011-draft2.pdf > > Add autoconf support: use "./configure --enable-dtrace" on all > supported > platforms: > * OS X Snow Leopard or later > * Solaris 10 or OpenSolaris > * Linux, via SystemTap's DTrace compatibility packages > > See the file `erts/emulator/beam/erlang_dtrace.d` for the definition > of all DTrace probes in the virtual machine so far. > > Example D scripts can be found in `lib/dtrace/examples`. Note that > if > you see the error message `{name of probe} does not match any > probes`, > then there is no Erlang VM process + DTrace probes running. To fix, > start a DTrace-enabled VM or remove `-q` from the `dtrace` command > line. > > The `lib/dtrace` directory contains a small code-only OTP application > that contains code that allows Erlang code to trigger a DTrace probe. > Dynamic creation & deletion of DTrace probes is not currently > supported, so the `dtrace:p()` function is hacked to allow a variable > number of arguments (up to four integers and up to four strings) to > be > used. See the comments at the top of `lib/dtrace/src/dtrace.c` for > more detail. > > One feature that may be controversial is the notion I've introduced > of a special process dictionary key that can be used by Erlang code > to > tag I/O operations for an application-specific purpose. Right now, > that tag's name is `dtrace_utag`. The dictionary keys used by `sys` > and other modules start with a dollar sign. Perhaps there is some > convention (but not a dollar sign?) that this tag should use? > > The purpose of the process dictionary key is to allow the tag to > be included in trace messages, e.g. for file I/O, without changing > the > API of the `file.erl` module's functions. For example, here's a use > of the tag when calling the `file:rename/2` function: > > (bar@REDACTED)1> put(dtrace_utag, "GGOOOAAALL!!!!!"). > undefined > > (bar@REDACTED)2> dtrace:init(). > ok > > %% Now start both the `user-probe.d` and `efile_drv.d` D scripts > %% found in the `lib/dtrace/examples` directory. > > (bar@REDACTED)3> dtrace:p(7, 8, 9, "one", "four"). > true > > %% The output from the `user-probe.d` script: > <0.40.0> GGOOOAAALL!!!!! 7 8 9 0 'one' 'four' '' '' > > (bar@REDACTED)4> file:rename("old-name", "new-name"). > {error,enoent} > > %% The output from the `efile_drv.d` script: > async I/O pool port #Port<0.59> queue len 1 > async I/O pool port #Port<0.59> queue len 0 > efile_drv enter tag={1,110} user tag GGOOOAAALL!!!!! | RENAME > (12) | args: old-name new-name , 0 0 (port #Port<0.59>) > async I/O worker tag={1,110} | RENAME (12) | efile_drv-int_entry > async I/O worker tag={1,110} | RENAME (12) | efile_drv-int_return > efile_drv return tag={1,110} user tag GGOOOAAALL!!!!! | RENAME > (12) | errno 2 > > I'm not exactly happy with this choice of tagging, namely using > `put(dtrace_utag, Tag::list())`. But this is an experiment, so > we'll see how it goes. I can't imagine changing the API for > all file.erl functions in order pass the tag explicitly. > > Some modules have some extensive (ab)use of the C preprocessor to > reduce the amount of #ifdefs that clutter the code. In several > places, > I have not #ifdef'ed automatic variables because of clutter. For the > same reason, there are a handful of cases where I added > DTrace-related > members to a struct definition without an #ifdef. I feel that the > result is easier to read than earlier drafts where I did use many > more > `https://github.com/slfritchie/otp/tree/dtrace-experiment+michal2` if > you're curious.) I expect there may be some debate about whether the > bloat of the affected structs is worthwhile. I erred on adding stuff > to structs, especially in the efile_drv.c driver, not having a full > grasp on what was thread-safe and what was not ... so I erred on the > side of caution. > > The efile_drv.c has a work-around for a crazy GCC optimization bug. > Thank goodness for Google, I dunno how I would've found a work-around > for this silly thing. Many thanks to Trond Norbye for writing > clearly > about the problem in a membase Git repo commit message. > > /* > * A note on probe naming: if "__" appears in a provider probe > * definition, then two things happen during compilation: > * > * 1. The "__" will turn into a hypen, "-", for the probe name. > * 2. The "__" will turn into a single underscore, "_", for the > * macro names and function definitions that the compiler and > * C developers will see. > * > * We'll try to use the following naming convention. We're a bit > * limited because, as a USDT probe, we can only specify the 4th part > * of the probe name, e.g. erlang*:::mumble. The 2nd part of the > * probe name is always going to be "beam" or "beam.smp", and the 3rd > * part of the probe name will always be the name of the function > * that's calling the probe. > * > * So, all probes will be have names defined in this file using the > * convention category__name or category__sub_category__name. This > * will translate to probe names of category-name or > * category-sub_category-name. > * > * Each of "category", "sub_category", and "name" may have > underscores > * but may not have hyphens. > */ > > Add tentative support for sequential tracing sending, queueing, and > receiving a message. I don't believe I've fully covered all the > major > places where it would be useful to have the sequential trace token > info > in a probe -- guidance from the OTP team would be helpful, if there's > time to do that kind of review. > > Add global variable `erts_this_node_sysname`. > > The purpose of this new global variable is to have quick > access to the local node name without having to acquire > locks to look at the `erts_this_node` variable safely. > [Though, after some later view, this isn't really required??] > _______________________________________________ > erlang-patches mailing list > erlang-patches@REDACTED > http://erlang.org/mailman/listinfo/erlang-patches > -- -- Dipl. Inform. Andreas Schultz email: as@REDACTED ------------------ managed broadband access ------------------ Travelping GmbH phone: +49-391-8190990 Roentgenstr. 13 fax: +49-391-819099299 D-39108 Magdeburg email: info@REDACTED GERMANY web: http://www.travelping.com Company Registration: HRB21276 Handelsregistergericht Chemnitz Geschaeftsfuehrer: Holger Winkelmann | VAT ID No.: DE236673780 -------------------------------------------------------------- From henrik@REDACTED Fri Nov 11 15:52:28 2011 From: henrik@REDACTED (Henrik Nord) Date: Fri, 11 Nov 2011 15:52:28 +0100 Subject: [erlang-patches] What's cooking in erlang/otp (2011-11-11) Message-ID: <201111111452.pABEqQm9031250@smaug.otp.ericsson.se> Read https://github.com/erlang/otp/wiki/Branches and https://github.com/erlang/otp/wiki/Submitting-patches New Branching strategy short version: The branch 'master' will be the upcoming major release (e.g. R15). Branch from this to submit patches for the next major release. (New features and major changes) New branch 'maint' will be introduced AFTER R15, and will be the next maintenance release (e.g. R15B01) Branch from this to submit patches for the next maintenance release. (Bug fixes and minor changes) The 'pu' branch will be based on 'master' and we will later add a 'maint-pu' for the 'maint' branch. ------------------------------------------------------------ [Graduated] * pg/fix-cover-leftover-down-msg (tools) (2011-08-29) 1 commit + [cover]fix leftover {'DOWN', ..} msg in callers queue (cc087c3) * rc/remote-shell-completion (kernel) (2010-10-22) 1 commit + make tab completion work in remote shells (73d1959) * rj/fix-debugger-msgs (debugger) (2011-09-25) 2 commits + Fix "OK" spelling in debugger messages and variables (84d0304) + Fix debugger message with wx (d90ccb6) * rj/fix-doctypos (kernel, otp) (2011-09-19) 3 commits + Add missing spaces in the Reference Manual distributed section (e43d646) + Add missing parenthesis in heart doc (20e826b) + Fix typo in the Reference Manual macros section (e318f7e) * rj/fix-erlang-doc-style (erts) (2011-09-26) 1 commit + Fixes module erlang doc style: option description (283e3ab) * rj/fix-remove-exec-bit (asn1, common_test, debugger, dialyzer, docbuilder, erts, hipe, orber, otp, percept, public_key, sasl, snmp, ssh, wx, xmerl) (2011-09-24) 3 commits + Remove exec bit from files: info files, dat, bat (ed32c91) + Remove exec bit from files related to: XML, make, C (b028ee6) + Remove exec bit from: erl, hrl, xml, html, asn, gif, xpm (7e8d824) * ss/re-split-doc-bug (stdlib) (2011-08-21) 1 commit + Fix re:split spec not to accept option 'global' (2a9dbb6) * ta/nif-variadic-funs (erts) (2011-10-27) 2 commits + erts: Make erl_nif.h compile with gcc on Windows (7738a36) + erts: convert variadic nif funs into inline funs (d76f146) ------------------------------------------------------------ [New topics] * ao/fix-change-time-inval-dates (kernel) (2011-11-01) 1 commit - Fix a crash when file:change_time/2,3 are called with invalid dates (cddc88d) * mh/odbc-shutdown-normal-exit (odbc) (2011-10-21) 1 commit - An ODBC process should exit normally if its client exits with 'shutdown' (14e9f24) * sg/fix-snmp_note_store-timer (snmp) (2011-11-08) 2 commits - snmp: add regression test for GC timer (597ce3c) - snmp: fix GC timer in snmp_note_store (09816ca) * uw/extending_gen (stdlib) (2011-11-08) 2 commits - faulty export in gen_fsm_SUITE.erl (7bb599b) - Add plugin support for alternative name lookup (9358d90) * wc/fix-eunit-print-stacktrace (eunit) (2011-11-02) 1 commit - fix eunit to print stacktrace correctly if test cases throw any exception (73b94a9) * ws/erl-xcomp-avr32 (otp) (2011-11-01) 1 commit - Update xcomp config for AVR32/buildroot-v3.0.0 (e89c2af) ------------------------------------------------------------ [Stalled] * bw/efile_exists (erts) (2010-10-07) 1 commit - prim_file:exists/{1,2} which is lightweight file existence check (2759905) Action expected from: Topic author * fm/posix-fallocate (erts, kernel) (2010-12-28) 1 commit - Added file:allocate/2 (7b39f0f) Action expected from: Topic author * jn/gen_stream (stdlib) (2011-04-15) 2 commits - Update gen_stream tests to conform with common_test standard (ce84daf) - Add gen_stream behaviour (6a089a4) Action expected from: OTP-Team * pr/mnesia_frag_hash (mnesia) (2011-04-27) 2 commits - add mnesia_frag_hash test (1d6762d) - Reduce calls to phash in key_to_frag_number (67a20c0) Action expected from: Topic author * tn/inet_drv-fix (erts) (2011-04-08) 1 commit - Use libdlpi to get physical address (e360563) Action expected from: Topic author ------------------------------------------------------------ [Cooking] * bg/temp-hipe-fixes (compiler, kernel) (2010-03-15) 5 commits - Avoid crash by skipping compilation_SUITE:on_load/1 (0198ee2) - Inline less aggressively for native-code compilation (41638df) - seq_trace_SUITE: Don't native-compile (fce2b79) - Disable native code if on_load is used (c8994f2) - andor_SUITE: Don't native-compile (531e5d9) This branch contains temporary workarounds to avoid failing test cases and is never intended to graduate. * fm/process_info_doc_fix (erts) (2011-09-20) 1 commit - Fix documentation for erlang:process_flag/2 (e88a46d) * gs/mod_log-fix (inets) (2011-09-24) 1 commit - Fix logging of content length in mod_log (166f4cc) * hw/asn1rt_check-transform (asn1) (2011-10-15) 1 commit - asn1rt_check: Fix transform_to_EXTERNAL1990 for binary input (6a69602) * jw/gen_event (stdlib) (2011-10-18) 1 commit - General code clean up and clarity fixes (dbd14ea) * jw/release_handler-which-releases (sasl) (2011-10-18) 1 commit - Add release_handler:which_releases/1 (66be346) * mh/create_cookie_error_msg (kernel) (2011-09-15) 1 commit - Specify file name and error on create_cookie failure (9319587) * mh/run_erl-exit-status (erts) (2011-09-02) 1 commit - run_erl.c: propagate exit status from child process (29364cf) * rj/fix-net_kernel-doc (kernel) (2011-09-28) 1 commit - Fixes net_kernel:get_net_ticktime() doc (bfa676a) * sa/dialyzer-wunderspecs (dialyzer) (2011-10-04) 2 commits - Fix false warning about closure application (33f6f13) - Change category of 'might also return' warnings (7892a31) * ta/docs (erts, kernel, otp, stdlib, test_server) (2011-11-01) 7 commits - Fix typos in expressions.xml (f8a0b3d) - file: correct make_link/2 and make_symlink/2 docs (8516b13) - Fix typo in test_server(3) (3fcbf04) - Fix typos in io_protocol.xml (e590fa8) - Fix typo in erlang(3) (25c27ed) - Fix typos in tar_SUITE (ff38c31) - Fix typos in erts/preloaded/src (a18e6d7) * ta/prim_archive-reloading-mfa (erts, kernel, stdlib) (2011-10-19) 2 commits - escript_SUITE: remove gratuitous space (3d89996) - [erts,kernel,stdlib] fix escript/primary archive reloading (4ac74ce) * ta/snmpc-warnings-option (snmp) (2011-10-05) 1 commit - snmpc: fix --warnings/--W option parsing (156b2ed) * nox/xmerl-namespace-axis (xmerl) (2010-12-07) 12 commits . Implement namespace axis (27d791f) . Add `#xmlPI` support to xmerl_xpath:write_node/1 (75e67f5) . Fix processing-instruction(name?) (f05e78b) . Fix path filters (610df56) . Support more top-level primary expressions (770d6d9) . Accumulate comments in element nodes (e5b6b3a) . Add `default_attrs` option (18584c5) . Allow whole documents to be returned (aef3dea) . Track parents and namespace in `#xmlAttribute` nodes (dc9b220) . Track parents in `#xmlPI` nodes (5095331) . Set `vsn` field in `#xmlDecl` record (d712331) . Fix namespace-conformance constraints (e062270) * ta/sendfile (diameter, erts, kernel, otp, stdlib, tools) (2011-01-13) 22 commits . Implement file:sendfile (c44f202) . otp: Update profiling doc with eprof (bb55c1c) . eprof: Fix invalid references to removed functions (25d213a) . Fix a few tests that used to fail on the HiPE platform (7afae64) . Dumb down release target to Solaris /usr/ucb/install (75ca1f8) . Dumb down opt/release targets to make 3.80 (b3e7e9c) . Minor tweaks and cleanup (ab7d352) . Need absolute -pa for bootstrap build (b9bed0b) . Simpler release targets for src subdirectories (5fbbdc6) . Use secondary expansion for src subdirectory rules (0f63f67) . One makefile for src build instead of recursion (0c7bbe0) . Remove app dependency on compiler to avoid forced recompilation (903dca1) ------------------------------------------------------------ [Dropped] * ao/fix_atime_mtime (erts, kernel) (2011-10-27) 2 commits . Fixes a crash in file_server_2 when file:change_time/2,3 are called with invalid dates (4e0e7ae) . Fixes wrong updates of file modification time (mtime) when only access time (atime) should be updated (42a8968) We aim to rewrite those parts of the file driver for R15 * ms/epmd-IPv6-node-reg (erts, kernel) (2011-06-03) 1 commit . epmd: support IPv6 node registration (5523b21) Crashing windows and bsd From vladdu55@REDACTED Fri Nov 11 16:02:37 2011 From: vladdu55@REDACTED (Vlad Dumitrescu) Date: Fri, 11 Nov 2011 16:02:37 +0100 Subject: [erlang-patches] jinterface: improve error message for too long OtpErlangAtom Message-ID: Hi! When trying to create an OtpErlangAtom longer than 255 characters, the error doesn't say what was the actual value. It would have saved me a lot of debugging time if it had been included in the error message. This patch addresses that. Please let me know if you want a test case for this, personally I think it's trivial enough to not need one. git fetch git://github.com/vladdu/otp.git jinterface_atom_message https://github.com/vladdu/otp/compare/jinterface_atom_message https://github.com/vladdu/otp/compare/jinterface_atom_message.patch (BTW there is still no maint branch as the instructions say, so it's based on dev) best regards, Vlad From magnus.henoch@REDACTED Fri Nov 11 18:36:16 2011 From: magnus.henoch@REDACTED (Magnus Henoch) Date: Fri, 11 Nov 2011 17:36:16 -0000 (GMT) Subject: [erlang-patches] eunit_surefire: include fixture setup/teardown failures in report Message-ID: <3300a27d-64c6-4350-9acb-decf23b3490b@knuth> Here is a patch for including failures in fixtures' setup/teardown functions in the test report generated by eunit_surefire: git fetch git://github.com/legoscia/otp.git eunit-surefire-fixture-errors https://github.com/legoscia/otp/commit/eunit-surefire-fixture-errors https://github.com/legoscia/otp/commit/eunit-surefire-fixture-errors.patch -- Magnus Henoch Erlang Solutions Ltd http://www.erlang-solutions.com/ From anton.vorobev@REDACTED Sat Nov 12 13:28:51 2011 From: anton.vorobev@REDACTED (Anton Vorobev) Date: Sat, 12 Nov 2011 13:28:51 +0100 Subject: [erlang-patches] FIX: segmentation fault in memsup Message-ID: Hi. I've got a problem with memsup inside an OpenVZ virtual container on Debian Linux. The point is that /proc/meminfo inside container does not include sections for buffers and/or caches (depends on version), and memsup does not have a control for NULL pointer before sscanf(). So, I propose the following patch which fixes the problem: git fetch git://github.com/vorobev/otp.git maint-memsup diff view and path: https://github.com/vorobev/otp/compare/maint-memsup https://github.com/vorobev/otp/compare/maint-memsup.patch Regards, Anton -------------- next part -------------- An HTML attachment was scrubbed... URL: From bookjovi@REDACTED Sun Nov 13 09:01:43 2011 From: bookjovi@REDACTED (Jovi Zhang) Date: Sun, 13 Nov 2011 16:01:43 +0800 Subject: [erlang-patches] [PATCH] erts: remove variable processes_busy In-Reply-To: References: Message-ID: How about this patch? On Wed, Nov 9, 2011 at 5:04 PM, Jovi Zhang wrote: > > variable processes_busy is not used in current code, it don't have > any meaning still stay on there, so remove it. > > Git Tree: git pull git://github.com/bookjovi/otp.git > Patch Review: * * > https://github.com/bookjovi/otp/commit/d428f18f1d03c133e2b59053978509bfae4d2c8c > > > commit d428f18f1d03c133e2b59053978509bfae4d2c8c > Author: Jovi Zhang > Date: Wed Nov 2 04:30:04 2011 +0800 > > erts: remove variable processes_busy > > variable processes_busy is not used in current code, it don't have > any meaning still stay on there, so remove it. > > diff --git a/erts/emulator/beam/benchmark.c > b/erts/emulator/beam/benchmark.c > index 7fbf44a..7382a0f 100644 > --- a/erts/emulator/beam/benchmark.c > +++ b/erts/emulator/beam/benchmark.c > @@ -26,7 +26,6 @@ > #include "benchmark.h" > > #ifdef BM_COUNTERS > -unsigned long long processes_busy; > unsigned long long processes_spawned; > unsigned long long messages_sent; > unsigned long long messages_copied; > @@ -184,7 +183,6 @@ void init_benchmarking() > #endif /* BM_TIMERS */ > > #ifdef BM_COUNTERS > - processes_busy = 0; > processes_spawned = 0; > messages_sent = 0; > messages_copied = 0; > diff --git a/erts/emulator/beam/benchmark.h > b/erts/emulator/beam/benchmark.h > index eedb06a..9c9d33c 100644 > --- a/erts/emulator/beam/benchmark.h > +++ b/erts/emulator/beam/benchmark.h > @@ -92,7 +92,6 @@ > * BM_COUNT(var) in the code where you want to increase it. > * > */ > -extern unsigned long long processes_busy; > extern unsigned long long processes_spawned; > extern unsigned long long messages_sent; > extern unsigned long long messages_copied; > diff --git a/erts/emulator/beam/erl_process.c > b/erts/emulator/beam/erl_process.c > index 5ceb4ce..b36e100 100644 > --- a/erts/emulator/beam/erl_process.c > +++ b/erts/emulator/beam/erl_process.c > @@ -224,10 +224,6 @@ static ErtsAlignedSchedulerSleepInfo > *aligned_sched_sleep_info; > > #endif > > -#ifndef BM_COUNTERS > -static int processes_busy; > -#endif > - > Process** process_tab; > static Uint last_reductions; > static Uint last_exact_reductions; > @@ -435,9 +431,6 @@ erts_init_process(int ncpu) > p_serial_shift = erts_fit_in_bits(erts_max_processes - 1); > p_serial_mask = ((~(~((Uint) 0) << proc_bits)) >> p_serial_shift); > erts_process_tab_index_mask = ~(~((Uint) 0) << p_serial_shift); > -#ifndef BM_COUNTERS > - processes_busy = 0; > -#endif > last_reductions = 0; > last_exact_reductions = 0; > erts_default_process_flags = 0; > @@ -6100,7 +6093,6 @@ erl_create_process(Process* parent, /* Parent of > process (default group leader). > goto error; > } > > - processes_busy++; > BM_COUNT(processes_spawned); > > #ifndef HYBRID > @@ -7623,7 +7615,6 @@ continue_exit_process(Process *p > pbt = ERTS_PROC_SET_CALL_TIME(p, ERTS_PROC_LOCKS_ALL, NULL); > > erts_smp_proc_unlock(p, ERTS_PROC_LOCKS_ALL); > - processes_busy--; > > if (dep) { > erts_do_net_exits(dep, reason); > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bookjovi@REDACTED Mon Nov 14 09:19:54 2011 From: bookjovi@REDACTED (Jovi Zhang) Date: Mon, 14 Nov 2011 16:19:54 +0800 Subject: [erlang-patches] [PATCH] erts: remove variable processes_busy Message-ID: variable processes_busy is not used in current code, it don't have any meaning still stay on there, so remove it. Git Tree: ? ? ? ? ? ? ? git pull git://github.com/bookjovi/otp.git Patch Review: https://github.com/bookjovi/otp/commit/d428f18f1d03c133e2b59053978509bfae4d2c8c commit d428f18f1d03c133e2b59053978509bfae4d2c8c Author: Jovi Zhang Date: ? Wed Nov 2 04:30:04 2011 +0800 ? ?erts: remove variable processes_busy ? ?variable processes_busy is not used in current code, it don't have ? ?any meaning still stay on there, so remove it. diff --git a/erts/emulator/beam/benchmark.c b/erts/emulator/beam/benchmark.c index 7fbf44a..7382a0f 100644 --- a/erts/emulator/beam/benchmark.c +++ b/erts/emulator/beam/benchmark.c @@ -26,7 +26,6 @@ #include "benchmark.h" #ifdef BM_COUNTERS -unsigned long long processes_busy; unsigned long long processes_spawned; unsigned long long messages_sent; unsigned long long messages_copied; @@ -184,7 +183,6 @@ void init_benchmarking() #endif /* BM_TIMERS */ #ifdef BM_COUNTERS - ? ?processes_busy ? ? = 0; ? ? processes_spawned ?= 0; ? ? messages_sent ? ? ?= 0; ? ? messages_copied ? ?= 0; diff --git a/erts/emulator/beam/benchmark.h b/erts/emulator/beam/benchmark.h index eedb06a..9c9d33c 100644 --- a/erts/emulator/beam/benchmark.h +++ b/erts/emulator/beam/benchmark.h @@ -92,7 +92,6 @@ ?* BM_COUNT(var) in the code where you want to increase it. ?* ?*/ -extern unsigned long long processes_busy; extern unsigned long long processes_spawned; extern unsigned long long messages_sent; extern unsigned long long messages_copied; diff --git a/erts/emulator/beam/erl_process.c b/erts/emulator/beam/erl_process.c index 5ceb4ce..b36e100 100644 --- a/erts/emulator/beam/erl_process.c +++ b/erts/emulator/beam/erl_process.c @@ -224,10 +224,6 @@ static ErtsAlignedSchedulerSleepInfo *aligned_sched_sleep_info; #endif -#ifndef BM_COUNTERS -static int processes_busy; -#endif - Process** ?process_tab; static Uint last_reductions; static Uint last_exact_reductions; @@ -435,9 +431,6 @@ erts_init_process(int ncpu) ? ? p_serial_shift = erts_fit_in_bits(erts_max_processes - 1); ? ? p_serial_mask = ((~(~((Uint) 0) << proc_bits)) >> p_serial_shift); ? ? erts_process_tab_index_mask = ~(~((Uint) 0) << p_serial_shift); -#ifndef BM_COUNTERS - ? ?processes_busy = 0; -#endif ? ? last_reductions = 0; ? ? last_exact_reductions = 0; ? ? erts_default_process_flags = 0; @@ -6100,7 +6093,6 @@ erl_create_process(Process* parent, /* Parent of process (default group leader). ? ? ? ?goto error; ? ? } - ? ?processes_busy++; ? ? BM_COUNT(processes_spawned); #ifndef HYBRID @@ -7623,7 +7615,6 @@ continue_exit_process(Process *p ? ? pbt = ERTS_PROC_SET_CALL_TIME(p, ERTS_PROC_LOCKS_ALL, NULL); ? ? erts_smp_proc_unlock(p, ERTS_PROC_LOCKS_ALL); - ? ?processes_busy--; ? ? if (dep) { ? ? ? ?erts_do_net_exits(dep, reason); From aschultz@REDACTED Mon Nov 14 15:22:42 2011 From: aschultz@REDACTED (Andreas Schultz) Date: Mon, 14 Nov 2011 15:22:42 +0100 (CET) Subject: [erlang-patches] DTrace patch, review draft #1 In-Reply-To: Message-ID: <5e90cc79-c479-4402-8d26-25bbfca0794d@office> Hi all, I got the SystemTap stuff working under Ubuntu Oneiric ;-) I would suggest that everyone who is not comfortable with rolling their own kernels stick with Fedora 16, which has build-in support for utrace. Building a Debian or Ubuntu system with utrace is a lot of work and might not be worth the effort. The STAP_PROBE11 problem has been fixed upstream in the meantime. Until a new version is packed, I recommend getting the latest version from the git repo 'git clone git://sourceware.org/git/systemtap.git'. The rest is straight forward, make sure you have a kernel that UTRACE enabled and that you have the correct kernel debug symbols. stap is using a different mechanism to pick up the trace points, so the syntax is not as simple as with dtrace. The dtrace sample rewitten for stap from the README.md looks like this: stap -e 'probe process("beam").mark("efile_drv__entry") {printf("%d %d %s | %d | %s %s , %d %d %d %d, %d\n", $arg1, $arg2, $arg3 == NULL ? "" : user_string($arg3), $arg4, $arg5 == NULL ? "" : user_string($arg5), $arg6 == NULL ? "" : user_string($arg6), $arg7, $arg8, $arg9, $arg10, $arg11)} probe process("beam").mark("efile_drv__int*") {printf("%d %d %d\n", $arg1, $arg2, $arg3)} probe process("beam").mark("efile_drv__return") {printf("%d %d %s | %d | %d %d\n", $arg1, $arg2, $arg3 == NULL ? "" : user_string($arg3), $arg4, $arg5, $arg6)}' -x 8384 make sure that stap can find the beam emulator, if you use beam.smp, replace "beam" with "beam.smp". '-x ####' refers to the pid of the running beam process you wish to trace. Attached is efile_drv.d rewritten for stap. Converting dtrace scripts is most easy, major differences are: - arg counting starts with 1, not with 0 - copyinstr() needs to be replaced, in most cases with user_string() Have fun Andreas ----- Original Message ----- > Hi Scott, > > When trying to compile this with gcc-4.6 and systemtap 1.6 on Ubuntu > Oneiric, I run into some problems: > > * erts_this_node_sysname usage produces errors like this: > gcc -g -O3 -fomit-frame-pointer > -I/usr/src/dtrace-review1/erts/x86_64-unknown-linux-gnu > -fno-tree-copyrename -D_GNU_SOURCE -DERTS_SMP -DHAVE_CONFIG_H > -Wall -Wstrict-prototypes -Wmissing-prototypes > -Wdeclaration-after-statement -DUSE_THREADS -D_THREAD_SAFE > -D_REENTRANT -DPOSIX_THREADS -D_POSIX_THREAD_SAFE_FUNCTIONS > -Ix86_64-unknown-linux-gnu/opt/smp -Ibeam -Isys/unix -Isys/common > -Ix86_64-unknown-linux-gnu -Izlib -Ipcre -Ihipe -I../include > -I../include/x86_64-unknown-linux-gnu -I../include/internal > -I../include/internal/x86_64-unknown-linux-gnu -c beam/dist.c -o > obj/x86_64-unknown-linux-gnu/opt/smp/dist.o > beam/dist.c: In function ?dsig_send?: > beam/dist.c:1691:1: error: invalid application of ?sizeof? to > incomplete type ?char[]? > beam/dist.c:1751:1: error: invalid application of ?sizeof? to > incomplete type ?char[]? > > The problem is systemtap, it uses a lot of preprocessor magic to at > the end generate a sizeof(erts_this_node_sysname). Since > erts_this_node_sysname is defined as 'extern char > erts_this_node_sysname[];', this will cause the error above. I have > fixed that by changing the extern declaration to match the actual > declaration: > > diff --git a/erts/emulator/beam/erl_node_tables.h > b/erts/emulator/beam/erl_node_tables.h > index 364d8eb..b884100 100644 > --- a/erts/emulator/beam/erl_node_tables.h > +++ b/erts/emulator/beam/erl_node_tables.h > @@ -169,7 +169,7 @@ extern Sint > erts_no_of_not_connected_dist_entries; > > extern DistEntry *erts_this_dist_entry; > extern ErlNode *erts_this_node; > -extern char erts_this_node_sysname[]; > +extern char erts_this_node_sysname[64+1]; > > DistEntry *erts_channel_no_to_dist_entry(Uint); > DistEntry *erts_sysname_to_connected_dist_entry(Eterm); > > * DTRACE/STAP_PROBE11 does no exist in systemtap > gcc -g -O2 -I/usr/src/dtrace-review1/erts/x86_64-unknown-linux-gnu > -fno-tree-copyrename -D_GNU_SOURCE -DHAVE_CONFIG_H -Wall > -Wstrict-prototypes -Wmissing-prototypes > -Wdeclaration-after-statement -DUSE_THREADS -D_THREAD_SAFE > -D_REENTRANT -DPOSIX_THREADS -D_POSIX_THREAD_SAFE_FUNCTIONS > -DLIBSCTP= -Ix86_64-unknown-linux-gnu/opt/plain -Ibeam -Isys/unix > -Isys/common -Ix86_64-unknown-linux-gnu -Izlib -Ipcre -Ihipe > -I../include -I../include/x86_64-unknown-linux-gnu > -I../include/internal -I../include/internal/x86_64-unknown-linux-gnu > -Idrivers/common -Idrivers/unix -c drivers/common/efile_drv.c -o > obj/x86_64-unknown-linux-gnu/opt/plain/efile_drv.o > drivers/common/efile_drv.c: In function ?flush_write?: > drivers/common/efile_drv.c:1936:9: warning: implicit declaration of > function ?STAP_PROBE11? [-Wimplicit-function-declaration] > > SystemTap only defines wrapper macros for up to 10 arguments. I have > filed a bug with systemtap for this: > http://sourceware.org/bugzilla/show_bug.cgi?id=13404 > In the meantime since there are only a very few places that use 11 > arguments, providing the macro our self should be ok. There is a > variadic version of the STAP_PROBE macro, but that actually uses the > fixed size macros in the end. > > diff --git a/erts/emulator/beam/dtrace-wrapper.h > b/erts/emulator/beam/dtrace-wrapper.h > index 55c3e6b..49e997d 100644 > --- a/erts/emulator/beam/dtrace-wrapper.h > +++ b/erts/emulator/beam/dtrace-wrapper.h > @@ -59,6 +59,16 @@ inline void dtrace_fun_decode(Process *process, > #define DTRACE11(name, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) > \ > erlang_##name((a0), (a1), (a2), (a3), (a4), (a5), (a6), (a7), > (a8), (a9), (a10)) > > +#if defined(_SDT_PROBE) && !defined(STAP_PROBE11) > +/* work arround for missing STAP macro */ > +#define > STAP_PROBE11(provider,name,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11) > \ > + _SDT_PROBE(provider, name, 11, \ > + > (arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11)) > +#define > _SDT_ASM_OPERANDS_11(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11) > \ > + _SDT_ASM_OPERANDS_10(arg1, arg2, arg3, arg4, arg5, arg6, arg7, > arg8, arg9,arg10), \ > + _SDT_ARG(11, arg11) > +#endif > + > #else /* HAVE_DTRACE */ > > /* Render all macros to do nothing */ > > Andreas > ----- Original Message ----- > > Hi, all. Here's the first draft of a DTrace patch to start the > > review > > process. Contrary to the commit message (sorry!), this patch as-is > > is > > broken for Linux+SystemTap. (It still works for OS X Snow Leopard > > and > > Solaris 10.) The Linux+SystemTap breakage is temporary and will be > > fixed before a final patch is submitted. > > > > git clone git://github.com/slfritchie/otp.git dtrace-review1 > > > > https://github.com/slfritchie/otp/compare/9a064a8c4f33d091c424bd23713bf76cd0ac7826...dtrace-review1 > > https://github.com/slfritchie/otp/compare/9a064a8c4f33d091c424bd23713bf76cd0ac7826...dtrace-review1.patch > > > > I'll include the commit message below. > > > > -Scott > > > > --- snip --- snip --- snip --- snip --- snip --- snip --- > > > > Add DTrace support for OS X, Solaris, and Linux (via SystemTap) > > > > Since it's been quite a while since I've written C code, *and* I > > haven't done any significant hacking on the VM itself in years, > > it's > > quite likely that I haven't done things in 100% proper style. Or > > my co-collaborators Dustin Sallings (CouchBase) or Michal Ptaszek > > (Erlang Solutions). My intent for this patch is to start > > discussion > > and review of DTrace support for consideration for the R15 release. > > > > For additional background on the motivation for this work, please > > see the slides for the presentation at the Erlang User Conference > > 2011 > > in Stockholm: > > https://www.erlang-factory.com/upload/presentations/462/euc2011-draft2.pdf > > > > Add autoconf support: use "./configure --enable-dtrace" on all > > supported > > platforms: > > * OS X Snow Leopard or later > > * Solaris 10 or OpenSolaris > > * Linux, via SystemTap's DTrace compatibility packages > > > > See the file `erts/emulator/beam/erlang_dtrace.d` for the > > definition > > of all DTrace probes in the virtual machine so far. > > > > Example D scripts can be found in `lib/dtrace/examples`. Note that > > if > > you see the error message `{name of probe} does not match any > > probes`, > > then there is no Erlang VM process + DTrace probes running. To > > fix, > > start a DTrace-enabled VM or remove `-q` from the `dtrace` command > > line. > > > > The `lib/dtrace` directory contains a small code-only OTP > > application > > that contains code that allows Erlang code to trigger a DTrace > > probe. > > Dynamic creation & deletion of DTrace probes is not currently > > supported, so the `dtrace:p()` function is hacked to allow a > > variable > > number of arguments (up to four integers and up to four strings) to > > be > > used. See the comments at the top of `lib/dtrace/src/dtrace.c` for > > more detail. > > > > One feature that may be controversial is the notion I've introduced > > of a special process dictionary key that can be used by Erlang code > > to > > tag I/O operations for an application-specific purpose. Right now, > > that tag's name is `dtrace_utag`. The dictionary keys used by > > `sys` > > and other modules start with a dollar sign. Perhaps there is some > > convention (but not a dollar sign?) that this tag should use? > > > > The purpose of the process dictionary key is to allow the tag to > > be included in trace messages, e.g. for file I/O, without changing > > the > > API of the `file.erl` module's functions. For example, here's a > > use > > of the tag when calling the `file:rename/2` function: > > > > (bar@REDACTED)1> put(dtrace_utag, "GGOOOAAALL!!!!!"). > > undefined > > > > (bar@REDACTED)2> dtrace:init(). > > ok > > > > %% Now start both the `user-probe.d` and `efile_drv.d` D > > scripts > > %% found in the `lib/dtrace/examples` directory. > > > > (bar@REDACTED)3> dtrace:p(7, 8, 9, "one", "four"). > > true > > > > %% The output from the `user-probe.d` script: > > <0.40.0> GGOOOAAALL!!!!! 7 8 9 0 'one' 'four' '' '' > > > > (bar@REDACTED)4> file:rename("old-name", "new-name"). > > {error,enoent} > > > > %% The output from the `efile_drv.d` script: > > async I/O pool port #Port<0.59> queue len 1 > > async I/O pool port #Port<0.59> queue len 0 > > efile_drv enter tag={1,110} user tag GGOOOAAALL!!!!! | RENAME > > (12) | args: old-name new-name , 0 0 (port #Port<0.59>) > > async I/O worker tag={1,110} | RENAME (12) | > > efile_drv-int_entry > > async I/O worker tag={1,110} | RENAME (12) | > > efile_drv-int_return > > efile_drv return tag={1,110} user tag GGOOOAAALL!!!!! | RENAME > > (12) | errno 2 > > > > I'm not exactly happy with this choice of tagging, namely using > > `put(dtrace_utag, Tag::list())`. But this is an experiment, so > > we'll see how it goes. I can't imagine changing the API for > > all file.erl functions in order pass the tag explicitly. > > > > Some modules have some extensive (ab)use of the C preprocessor to > > reduce the amount of #ifdefs that clutter the code. In several > > places, > > I have not #ifdef'ed automatic variables because of clutter. For > > the > > same reason, there are a handful of cases where I added > > DTrace-related > > members to a struct definition without an #ifdef. I feel that the > > result is easier to read than earlier drafts where I did use many > > more > > `https://github.com/slfritchie/otp/tree/dtrace-experiment+michal2` > > if > > you're curious.) I expect there may be some debate about whether > > the > > bloat of the affected structs is worthwhile. I erred on adding > > stuff > > to structs, especially in the efile_drv.c driver, not having a full > > grasp on what was thread-safe and what was not ... so I erred on > > the > > side of caution. > > > > The efile_drv.c has a work-around for a crazy GCC optimization bug. > > Thank goodness for Google, I dunno how I would've found a > > work-around > > for this silly thing. Many thanks to Trond Norbye for writing > > clearly > > about the problem in a membase Git repo commit message. > > > > /* > > * A note on probe naming: if "__" appears in a provider probe > > * definition, then two things happen during compilation: > > * > > * 1. The "__" will turn into a hypen, "-", for the probe name. > > * 2. The "__" will turn into a single underscore, "_", for the > > * macro names and function definitions that the compiler and > > * C developers will see. > > * > > * We'll try to use the following naming convention. We're a bit > > * limited because, as a USDT probe, we can only specify the 4th > > part > > * of the probe name, e.g. erlang*:::mumble. The 2nd part of the > > * probe name is always going to be "beam" or "beam.smp", and the > > 3rd > > * part of the probe name will always be the name of the function > > * that's calling the probe. > > * > > * So, all probes will be have names defined in this file using the > > * convention category__name or category__sub_category__name. This > > * will translate to probe names of category-name or > > * category-sub_category-name. > > * > > * Each of "category", "sub_category", and "name" may have > > underscores > > * but may not have hyphens. > > */ > > > > Add tentative support for sequential tracing sending, queueing, and > > receiving a message. I don't believe I've fully covered all the > > major > > places where it would be useful to have the sequential trace token > > info > > in a probe -- guidance from the OTP team would be helpful, if > > there's > > time to do that kind of review. > > > > Add global variable `erts_this_node_sysname`. > > > > The purpose of this new global variable is to have quick > > access to the local node name without having to acquire > > locks to look at the `erts_this_node` variable safely. > > [Though, after some later view, this isn't really required??] > > _______________________________________________ > > erlang-patches mailing list > > erlang-patches@REDACTED > > http://erlang.org/mailman/listinfo/erlang-patches > > > > -- > -- > Dipl. Inform. > Andreas Schultz > > email: as@REDACTED > ------------------ managed broadband access ------------------ > > Travelping GmbH phone: +49-391-8190990 > Roentgenstr. 13 fax: +49-391-819099299 > D-39108 Magdeburg email: info@REDACTED > GERMANY web: http://www.travelping.com > > Company Registration: HRB21276 Handelsregistergericht Chemnitz > Geschaeftsfuehrer: Holger Winkelmann | VAT ID No.: DE236673780 > -------------------------------------------------------------- > > _______________________________________________ > erlang-patches mailing list > erlang-patches@REDACTED > http://erlang.org/mailman/listinfo/erlang-patches > -- -- Dipl. Inform. Andreas Schultz email: as@REDACTED phone: +49-391-819099-224 mobil: +49-179-7654368 ------------------ managed broadband access ------------------ Travelping GmbH phone: +49-391-8190990 Roentgenstr. 13 fax: +49-391-819099299 D-39108 Magdeburg email: info@REDACTED GERMANY web: http://www.travelping.com Company Registration: HRB21276 Handelsregistergericht Chemnitz Geschaeftsfuehrer: Holger Winkelmann | VAT ID No.: DE236673780 -------------------------------------------------------------- -------------- next part -------------- A non-text attachment was scrubbed... Name: efile_drv.sdt Type: text/x-csrc Size: 3072 bytes Desc: not available URL: From fritchie@REDACTED Tue Nov 15 03:19:01 2011 From: fritchie@REDACTED (Scott Lystig Fritchie) Date: Mon, 14 Nov 2011 20:19:01 -0600 Subject: [erlang-patches] DTrace patch, review draft #2 In-Reply-To: Message of "Mon, 14 Nov 2011 15:22:42 +0100." <5e90cc79-c479-4402-8d26-25bbfca0794d@office> Message-ID: <3027.1321323541@snookles.snookles.com> Andreas, thanks for your work and advice. I've included your efile_drv.d converted script into lib/dtrace/examples/efile_drv.systemtap. OTP team, I've a new branch for review. I know that the top-level README.md changes aren't appropriate for the real OTP repo, but having the diffs there is nice for people who visit my GitHub repo's page at https://github.com/slfritchie/otp/tree/dtrace-review2. Are there other things that might be preventing this branch from going into the "pu" branch? Changes since last push to GitHub (relative to commit 5828a4fb28, which was the former `dtrace-review1` branch): * Rebased onto 14 Nov 2011's "master" branch * Recent changes to the async task queuing mechanism means that the async worker queue length is not available. A bogus value of -1 is hard-coded until there's a good way to peek into the new queue structure and find the queue length. * Small fixes based on review comments by Mikael Pettersson, Andrew Thompson, and Andreas Schultz. git clone git://github.com/slfritchie/otp.git dtrace-review2 https://github.com/slfritchie/otp/compare/dtrace-review2 https://github.com/slfritchie/otp/compare/dtrace-review2.patch -Scott From bgustavsson@REDACTED Tue Nov 15 08:26:16 2011 From: bgustavsson@REDACTED (=?UTF-8?Q?Bj=C3=B6rn_Gustavsson?=) Date: Tue, 15 Nov 2011 08:26:16 +0100 Subject: [erlang-patches] DTrace patch, review draft #2 In-Reply-To: <3027.1321323541@snookles.snookles.com> References: <5e90cc79-c479-4402-8d26-25bbfca0794d@office> <3027.1321323541@snookles.snookles.com> Message-ID: On Tue, Nov 15, 2011 at 3:19 AM, Scott Lystig Fritchie wrote: > Andreas, thanks for your work and advice. ?I've included your > efile_drv.d converted script into > lib/dtrace/examples/efile_drv.systemtap. > > OTP team, I've a new branch for review. ?I know that the top-level > README.md changes aren't appropriate for the real OTP repo, but having > the diffs there is nice for people who visit my GitHub repo's page at > https://github.com/slfritchie/otp/tree/dtrace-review2. > > Are there other things that might be preventing this branch from going > into the "pu" branch? > To put my comments in context, we (the Erlang/OTP team) think that dtrace support could potentially be very useful feature in Erlang/OTP and we therefore consider including it in R15 as an experimental feature turned off by default. For an experimental feature, we have the following requirements in general: 1. If the feature is not enabled, it should not cause any problems. Basically, that what we will focus on when testing your branch. 2. The approach should reasonable and there should not be any obvious problems or blatant coding style violations. That was the general stuff. Now to my specific comments what needs to be fixed. I found one major problem and some minor things that should be fixed. Doing a default build should work without problems. I did a "./otp_build setup -a" on my Mac (Mac OS 10.7.2) and got: === Entering application dtrace erlc -W +debug_info -I../include -I ../../et/include -I ../../../libraries/et/include -o../ebin dtrace.erl sed -e 's;%VSN%;0.8;' dtrace.app.src > ../ebin/dtrace.app sed -e 's;%VSN%;0.8;' dtrace.appup.src > ../ebin/dtrace.appup dtrace.erl:71: Warning: variable 'Message' is unused make -f i386-apple-darwin11.2.0/Makefile TYPE=opt /usr/bin/install -c -d ../priv/obj/i386-apple-darwin11.2.0 gcc -c -o ../priv/obj/i386-apple-darwin11.2.0/dtrace.o -Wall -Wstrict-prototypes -Wmissing-prototypes -Wdeclaration-after-statement -DUSE_THREADS -D_THREAD_SAFE -D_REENTRANT -DPOSIX_THREADS -m32 -g -O2 -I/Users/bjorng/Downloads/otp/erts/i386-apple-darwin11.2.0 -no-cpp-precomp -D_XOPEN_SOURCE -fPIC -fno-common -I/Users/bjorng/Downloads/otp/erts/emulator/beam -I/Users/bjorng/Downloads/otp/erts/include -I/Users/bjorng/Downloads/otp/erts/include/i386-apple-darwin11.2.0 -I/Users/bjorng/Downloads/otp/erts/include/internal -I/Users/bjorng/Downloads/otp/erts/include/internal/i386-apple-darwin11.2.0 -I/Users/bjorng/Downloads/otp/erts/emulator/sys/unix -I../priv/obj/i386-apple-darwin11.2.0 -I/Users/bjorng/Downloads/otp/erts/emulator/i386-apple-darwin11.2.0 dtrace.c dtrace.c:30:25: error: dtrace_user.h: No such file or directory make[4]: *** [../priv/obj/i386-apple-darwin11.2.0/dtrace.o] Error 1 make[3]: *** [opt] Error 2 make[2]: *** [opt] Error 2 make[1]: *** [opt] Error 2 make: *** [libs] Error 2 That must be fixed. Also, there should be no compilation warnings. Now on to more minor things: The erts/.gitignore file is included in the commit, but it only adds a blank line. Regarding coding style, our main rule is to imitate the style of the surrounding code in the same file. In this case, in most C source files, we put the beginning curly bracket on a new line like this: int foo(void) { ... } (You've put the curly bracket at the end of function declaration line.) Also, the most common comment style for "block" comments is: /* * Here is a comment. */ (Your added comments seem to have different styles.) Other than that, I didn't notice any coding style problems after a quick look. My final comment is that your changes are included in a single commit, which make it harder to review and will it make it harder to understand in the future. I would suggest breaking it up into several commits (at least three): First one commit that introduces the dtrace mechanism, i.e. the dtrace application, the dtrace support in header files in erts/emulator/beam, erlang_dtrace.d, changes in configure and Makefiles. A second commit that introduces all the example D programs in the dtrace application. One or more commits that add the probes in the emulator. For example, there could be one commit that adds all probes for file operations (in both the emulator and the kernel application), followed by other commits for other categories of probes. Or all probes could be in a single commit. /Bj?rn -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From henrik@REDACTED Tue Nov 15 11:22:24 2011 From: henrik@REDACTED (Henrik Nord) Date: Tue, 15 Nov 2011 11:22:24 +0100 Subject: [erlang-patches] Fwd: Re: jinterface: improve error message for too long OtpErlangAtom In-Reply-To: <4EC23C9A.8070905@erlang.org> References: <4EC23C9A.8070905@erlang.org> Message-ID: <4EC23D60.5090703@erlang.org> -------- Original Message -------- Subject: Re: [erlang-patches] jinterface: improve error message for too long OtpErlangAtom Date: Tue, 15 Nov 2011 11:19:06 +0100 From: Henrik Nord To: Vlad Dumitrescu On 11/11/2011 04:02 PM, Vlad Dumitrescu wrote: > Hi! > > When trying to create an OtpErlangAtom longer than 255 characters, the > error doesn't say what was the actual value. It would have saved me a > lot of debugging time if it had been included in the error message. > This patch addresses that. Please let me know if you want a test case > for this, personally I think it's trivial enough to not need one. > > git fetch git://github.com/vladdu/otp.git jinterface_atom_message > > https://github.com/vladdu/otp/compare/jinterface_atom_message > https://github.com/vladdu/otp/compare/jinterface_atom_message.patch > (BTW there is still no maint branch as the instructions say, so it's > based on dev) " New Branching strategy short version: The branch 'master' will be the upcoming major release (e.g. R15). Branch from this to submit patches for the next major release. (New features and major changes) New branch 'maint' will be introduced AFTER R15, and will be the next maintenance release (e.g. R15B01) Branch from this to submit patches for the next maintenance release. (Bug fixes and minor changes) The 'pu' branch will be based on 'master' and we will later add a 'maint-pu' for the 'maint' branch. " Also do not use 'dev' it will never be used again, and will be removed from github soon*^(TM), also out of date. * > best regards, > Vlad > _______________________________________________ > erlang-patches mailing list > erlang-patches@REDACTED > http://erlang.org/mailman/listinfo/erlang-patches I will include this in 'pu', I rebased the branch upon master, and did a small change in the commit msg. Thank you for the contribution! -- /Henrik Nord Erlang/OTP -------------- next part -------------- An HTML attachment was scrubbed... URL: From henrik@REDACTED Tue Nov 15 11:22:48 2011 From: henrik@REDACTED (Henrik Nord) Date: Tue, 15 Nov 2011 11:22:48 +0100 Subject: [erlang-patches] eunit_surefire: include fixture setup/teardown failures in report In-Reply-To: <3300a27d-64c6-4350-9acb-decf23b3490b@knuth> References: <3300a27d-64c6-4350-9acb-decf23b3490b@knuth> Message-ID: <4EC23D78.70906@erlang.org> On 11/11/2011 06:36 PM, Magnus Henoch wrote: > Here is a patch for including failures in fixtures' setup/teardown functions > in the test report generated by eunit_surefire: > > git fetch git://github.com/legoscia/otp.git eunit-surefire-fixture-errors > > https://github.com/legoscia/otp/commit/eunit-surefire-fixture-errors > https://github.com/legoscia/otp/commit/eunit-surefire-fixture-errors.patch > Thank you for the contribution, you branch is included in 'pu' -- /Henrik Nord Erlang/OTP From henrik@REDACTED Tue Nov 15 11:34:04 2011 From: henrik@REDACTED (Henrik Nord) Date: Tue, 15 Nov 2011 11:34:04 +0100 Subject: [erlang-patches] FIX: segmentation fault in memsup In-Reply-To: References: Message-ID: <4EC2401C.3070007@erlang.org> On 11/12/2011 01:28 PM, Anton Vorobev wrote: > Hi. > > I've got a problem with memsup inside an OpenVZ virtual container on > Debian Linux. > The point is that /proc/meminfo inside container does not include > sections for buffers and/or caches (depends on version), and memsup > does not have a control for NULL pointer before sscanf(). > > > So, I propose the following patch which fixes the problem: > > > git fetch git://github.com/vorobev/otp.git > maint-memsup > > diff view and path: > https://github.com/vorobev/otp/compare/maint-memsup > https://github.com/vorobev/otp/compare/maint-memsup.patch > > Regards, > Anton > > > > > _______________________________________________ > erlang-patches mailing list > erlang-patches@REDACTED > http://erlang.org/mailman/listinfo/erlang-patches Thank you for the contribution, your branch is included in 'pu' I rewrote your commits msg. If you want to do it in another way, I can refetch the branch after you have changed it to your liking. -- /Henrik Nord Erlang/OTP -------------- next part -------------- An HTML attachment was scrubbed... URL: From henrik@REDACTED Tue Nov 15 14:47:37 2011 From: henrik@REDACTED (Henrik Nord) Date: Tue, 15 Nov 2011 14:47:37 +0100 Subject: [erlang-patches] [PATCH] erts: remove variable processes_busy In-Reply-To: References: Message-ID: <4EC26D79.3050805@erlang.org> On 11/13/2011 09:01 AM, Jovi Zhang wrote: > How about this patch? I got the patch on the 14th, and this reminder on the 13th, and I did not have time to response to them until today. > > On Wed, Nov 9, 2011 at 5:04 PM, Jovi Zhang > wrote: > > > variable processes_busy is not used in current code, it don't have > any meaning still stay on there, so remove it. > > Git Tree: git pull git://github.com/bookjovi/otp.git > > Patch Review: > **https://github.com/bookjovi/otp/commit/d428f18f1d03c133e2b59053978509bfae4d2c8c > > > commit d428f18f1d03c133e2b59053978509bfae4d2c8c > Author: Jovi Zhang > > Date: Wed Nov 2 04:30:04 2011 +0800 > > erts: remove variable processes_busy > variable processes_busy is not used in current code, it don't have > any meaning still stay on there, so remove it. > > diff --git a/erts/emulator/beam/benchmark.c > b/erts/emulator/beam/benchmark.c > index 7fbf44a..7382a0f 100644 > --- a/erts/emulator/beam/benchmark.c > +++ b/erts/emulator/beam/benchmark.c > @@ -26,7 +26,6 @@ > #include "benchmark.h" > #ifdef BM_COUNTERS > -unsigned long long processes_busy; > unsigned long long processes_spawned; > unsigned long long messages_sent; > unsigned long long messages_copied; > @@ -184,7 +183,6 @@ void init_benchmarking() > #endif /* BM_TIMERS */ > #ifdef BM_COUNTERS > - processes_busy = 0; > processes_spawned = 0; > messages_sent = 0; > messages_copied = 0; > diff --git a/erts/emulator/beam/benchmark.h > b/erts/emulator/beam/benchmark.h > index eedb06a..9c9d33c 100644 > --- a/erts/emulator/beam/benchmark.h > +++ b/erts/emulator/beam/benchmark.h > @@ -92,7 +92,6 @@ > * BM_COUNT(var) in the code where you want to increase it. > * > */ > -extern unsigned long long processes_busy; > extern unsigned long long processes_spawned; > extern unsigned long long messages_sent; > extern unsigned long long messages_copied; > diff --git a/erts/emulator/beam/erl_process.c > b/erts/emulator/beam/erl_process.c > index 5ceb4ce..b36e100 100644 > --- a/erts/emulator/beam/erl_process.c > +++ b/erts/emulator/beam/erl_process.c > @@ -224,10 +224,6 @@ static ErtsAlignedSchedulerSleepInfo > *aligned_sched_sleep_info; > #endif > -#ifndef BM_COUNTERS > -static int processes_busy; > -#endif > - > Process** process_tab; > static Uint last_reductions; > static Uint last_exact_reductions; > @@ -435,9 +431,6 @@ erts_init_process(int ncpu) > p_serial_shift = erts_fit_in_bits(erts_max_processes - 1); > p_serial_mask = ((~(~((Uint) 0) << proc_bits)) >> > p_serial_shift); > erts_process_tab_index_mask = ~(~((Uint) 0) << p_serial_shift); > -#ifndef BM_COUNTERS > - processes_busy = 0; > -#endif > last_reductions = 0; > last_exact_reductions = 0; > erts_default_process_flags = 0; > @@ -6100,7 +6093,6 @@ erl_create_process(Process* parent, /* > Parent of process (default group leader). > goto error; > } > - processes_busy++; > BM_COUNT(processes_spawned); > #ifndef HYBRID > @@ -7623,7 +7615,6 @@ continue_exit_process(Process *p > pbt = ERTS_PROC_SET_CALL_TIME(p, ERTS_PROC_LOCKS_ALL, NULL); > erts_smp_proc_unlock(p, ERTS_PROC_LOCKS_ALL); > - processes_busy--; > if (dep) { > erts_do_net_exits(dep, reason); > > > > > _______________________________________________ > erlang-patches mailing list > erlang-patches@REDACTED > http://erlang.org/mailman/listinfo/erlang-patches I will include this in 'pu' Thank you for the contribution! -- /Henrik Nord Erlang/OTP -------------- next part -------------- An HTML attachment was scrubbed... URL: From henrik@REDACTED Tue Nov 15 17:03:33 2011 From: henrik@REDACTED (Henrik Nord) Date: Tue, 15 Nov 2011 17:03:33 +0100 Subject: [erlang-patches] gen_event clean ups In-Reply-To: References: Message-ID: <4EC28D55.60104@erlang.org> On 10/14/2011 11:04 PM, Joe Williams wrote: > git fetch git://github.com/joewilliams/otp.git gen_event > > > -- > Name: Joseph A. Williams > Email: joe@REDACTED > Blog: http://www.joeandmotorboat.com/ > Twitter: http://twitter.com/williamsjoe > > > > _______________________________________________ > erlang-patches mailing list > erlang-patches@REDACTED > http://erlang.org/mailman/listinfo/erlang-patches Hello again Joe We have decided not to include your patch. The reasoning behind not accepting pure stylistic code changes is that it will make it harder to follow changes by comparing code diffs. As to the likelihood of performance improvements we are not to sure about that as the compiler will still do its magic. -- /Henrik Nord Erlang/OTP -------------- next part -------------- An HTML attachment was scrubbed... URL: From fritchie@REDACTED Wed Nov 16 18:28:58 2011 From: fritchie@REDACTED (Scott Lystig Fritchie) Date: Wed, 16 Nov 2011 11:28:58 -0600 Subject: [erlang-patches] DTrace patch, review draft #2 In-Reply-To: Message of "Tue\, 15 Nov 2011 08\:26\:16 +0100." Message-ID: <89248.1321464538@snookles.snookles.com> Bj?rn Gustavsson wrote: bg> Doing a default build should work without problems. I did a bg> "./otp_build setup -a" on my Mac (Mac OS 10.7.2) and got: Yup, sorry about that. It's been too long since I last did a build completely without "--enable-dtrace", and it's ususally only to build the VM. That error was in the "dtrace" Erlang app, which (oddly enough) isn't built when running make inside the erts/emulator dir. bg> The erts/.gitignore file is included in the commit, but it only adds bg> a blank line. Yup, thanks. bg> Regarding coding style, our main rule is to imitate the style of the bg> surrounding code in the same file. In this case, in most C source bg> files, we put the beginning curly bracket on a new line like this: bg> int foo(void) { .. } Yup, also fixed. bg> (You've put the curly bracket at the end of function declaration bg> line.) bg> Also, the most common comment style for "block" comments is: bg> /* * Here is a comment. */ bg> (Your added comments seem to have different styles.) Ditto. bg> My final comment is that your changes are included in a single bg> commit, which make it harder to review and will it make it harder to bg> understand in the future. I would suggest breaking it up into bg> several commits (at least three): [...] Well, I've also fixed one NULL pointer dereferencing problem (when a probe is enabled) and I've got at least one more to fix. So there's going to be a bit of churn between now and then. I'd also really like to try to make a 'ustack()' helper. That may be possible, using the GDB macro package erts/etc/unix/etp-commands could make that wish come true. But it would be another (small) source of churn in the coming few days. Overnight last night, I ran several instances of the full OTP test suite. (See also my recent query over on the erlang-bugs list about the stability of tests for R15A.) If I can't get stable test suite results, then ... hrmm. OK, so ... I'm resigned to more churn happening in the next few days. However, it'd be great to get the DTrace stuff into "pu" sooner rather than later. Is it reasonable to assume that the next step is mine? Specifically, I'll create a new review branch that addresses all of Bjorn's and Mikael's comments? I'll call that review branch "dtrace-review3". And I'll work as hard as I can to find & fix bugs that pop up when the probes are enabled? Furthermore, when I make bugfixes (and any additional code style edits, adding 'ustack()' helper, etc), they'll be commits on the "dtrace-review3" branch. The understanding is that those later commits would be squashed prior to merging with "master"? -Scott From fritchie@REDACTED Thu Nov 17 08:32:04 2011 From: fritchie@REDACTED (Scott Lystig Fritchie) Date: Thu, 17 Nov 2011 01:32:04 -0600 Subject: [erlang-patches] DTrace patch, review draft #3 In-Reply-To: Message of "Tue\, 15 Nov 2011 08\:26\:16 +0100." Message-ID: <45760.1321515124@snookles.snookles.com> Bj?rn Gustavsson wrote: bg> My final comment is that your changes are included in a single bg> commit, which make it harder to review and will it make it harder to bg> understand in the future. I would suggest breaking it up into bg> several commits (at least three): [...] Bj?rn, I've split the commit from 1 -> 4 pieces. I've also fixed a few bugs and have un-done the DTrace-related edits that I'd put in README.md. Instead, that text has been moved to a new file, README.dtrace.md. I have eliminated all of the OTP test suite failures that I'm aware of, though the tests were run this afternoon prior to splitting the commit. It's possible that I un-fixed a bugfix, though I think the odds are low. I'll be re-running the tests overnight tonight with DTrace unconfigured, DTrace configured, and DTrace configured + probes enabled(*). git clone git://github.com/slfritchie/otp.git dtrace-review3 https://github.com/slfritchie/otp/compare/dtrace-review3 https://github.com/slfritchie/otp/compare/dtrace-review3.patch -Scott (*) I've encountered a odd/weird/buggy? problem with Solaris 10 where the Erlang OS process occasionally dumps core due to a SIGTRAP. I think it may have to do with a race condition between starting a new process and a turn-them-all-on probe specification. If anybody happens to know (or guess) anything about this, please contact me. From samuelrivas@REDACTED Thu Nov 17 10:02:33 2011 From: samuelrivas@REDACTED (Samuel) Date: Thu, 17 Nov 2011 10:02:33 +0100 Subject: [erlang-patches] fix mipsel compilation Message-ID: Hi, I'm resending some emails since for some reason all the emails I sent from my old account in the last few months didn't reach the list. Back in august I had a minor issue crosscompiling erlang, here is a possible fix: To compile for mipsel (with codesourcery toolchain) I have to pass CFLAGS=-EL and LDFLAGS=-EL. Actually, my crossconfiguration is like this: PATH=/home/samuel/src/otp_src_R14B03-bootstrap/bootstrap/bin:$PATH CFLAGS="-Os -EL -I/home/samuel/cross_compiled/include" LDFLAGS="-EL -L/home/samuel/cross_compiled/lib" ./configure -host=mips-linux-gnu -target=mips-linux-gnu --disable-hipe This would file because DED_LDFLAGS are not updated accordingly. In make/mips-unknown-linux-gnu/otp_ded.mk they will read DED_LDFLAGS = -shared -Wl,-Bsymbolic When the right value is (ignoring -L that is not really necessary to compile any driver) DED_LDFLAGS = -EL -shared -Wl,-Bsymbolic CFLAGS are set correctly, so I think this could be an error in the configuration files. An alternative to this fix is setting all the DED_ variables in the compilation line, but this feels awkward. You can fetch my (very simple) patch from git fetch git://github.com/samuelrivas/otp.git fix-mipsel-compilation I guess the same problem applies from non-linux builds, but I haven't tested it Best -- Samuel From hans.bolinder@REDACTED Thu Nov 17 14:49:54 2011 From: hans.bolinder@REDACTED (Hans Bolinder) Date: Thu, 17 Nov 2011 14:49:54 +0100 Subject: [erlang-patches] Re: gen:call({global, Name}, ...) In-Reply-To: References: <4D945745.6020600@erlang.org> <4D947A2B.5060905@erlang.org> Message-ID: <20165.4354.206045.827550@ornendil.otp.ericsson.se> Hi, [Geoff Cant:] > Henrik Nord writes: > > > On 03/31/2011 12:28 PM, Henrik Nord wrote: > >> On 03/30/2011 03:19 AM, Geoff Cant wrote: > >>> Hi all, I discovered today that gen:call({global, Name}, Label, Request, > >>> Timeout) calls global:safe_whereis_name(Name) to determine the Pid to > >>> look up globally registered names. > >>> > >>> global:safe_whereis_name/1 doesn't seem to offer any particular safety > >>> and more importantly, serializes all global name lookups on a > >>> node. (Using > >>> global:whereis_name/1 instead is just an ets lookup). > >>> > >>> Can we safely make a change like > >>> https://github.com/archaelus/otp/commit/4f6e8a147b3c600eef2dd05f8ce0d51cf9c35383 > >>> > >>> in gen.erl and improve call time and reduce the load on > >>> global_name_server at a stroke? > > > > This has apparently been tested before, and found to be unsafe. > > So im pulling it out. > > Hi Henrik, thanks for looking at this patch. > > Is there an important edge case I'm missing here? Sorry about the late answer. A bug affecting supervisor:start/6 was masked out by the call to global:safe_whereis_name(). The bug has been fixed now, and we've removed all calls to global:safe_whereis_name() in the upcoming release. Best regards, Hans Bolinder, Erlang/OTP team, Ericsson From aschultz@REDACTED Fri Nov 18 11:50:31 2011 From: aschultz@REDACTED (Andreas Schultz) Date: Fri, 18 Nov 2011 11:50:31 +0100 (CET) Subject: [erlang-patches] DTrace patch, review draft #3 In-Reply-To: <45760.1321515124@snookles.snookles.com> Message-ID: Hi Scott, I have converted all DTrace scripts to SystemTap and added a README: git fetch git://github.com/RoadRunnr/otp.git dtrace-systemtap https://github.com/RoadRunnr/otp/commit/4ea0b80639f3cae58748785d155a2b7fb4e9213a Regards Andreas ----- Original Message ----- > Bj?rn Gustavsson wrote: > > bg> My final comment is that your changes are included in a single > bg> commit, which make it harder to review and will it make it harder > to > bg> understand in the future. I would suggest breaking it up into > bg> several commits (at least three): [...] > > Bj?rn, I've split the commit from 1 -> 4 pieces. I've also fixed a > few > bugs and have un-done the DTrace-related edits that I'd put in > README.md. Instead, that text has been moved to a new file, > README.dtrace.md. > > I have eliminated all of the OTP test suite failures that I'm aware > of, > though the tests were run this afternoon prior to splitting the > commit. > It's possible that I un-fixed a bugfix, though I think the odds are > low. > I'll be re-running the tests overnight tonight with DTrace > unconfigured, > DTrace configured, and DTrace configured + probes enabled(*). > > git clone git://github.com/slfritchie/otp.git dtrace-review3 > > https://github.com/slfritchie/otp/compare/dtrace-review3 > https://github.com/slfritchie/otp/compare/dtrace-review3.patch > > -Scott > > (*) I've encountered a odd/weird/buggy? problem with Solaris 10 where > the Erlang OS process occasionally dumps core due to a SIGTRAP. I > think > it may have to do with a race condition between starting a new > process > and a turn-them-all-on probe specification. If anybody happens to > know > (or guess) anything about this, please contact me. > -- -- Dipl. Inform. Andreas Schultz email: as@REDACTED ------------------ managed broadband access ------------------ Travelping GmbH phone: +49-391-8190990 Roentgenstr. 13 fax: +49-391-819099299 D-39108 Magdeburg email: info@REDACTED GERMANY web: http://www.travelping.com Company Registration: HRB21276 Handelsregistergericht Chemnitz Geschaeftsfuehrer: Holger Winkelmann | VAT ID No.: DE236673780 -------------------------------------------------------------- From henrik@REDACTED Fri Nov 18 11:52:20 2011 From: henrik@REDACTED (Henrik Nord) Date: Fri, 18 Nov 2011 11:52:20 +0100 Subject: [erlang-patches] DTrace patch, review draft #3 In-Reply-To: <45760.1321515124@snookles.snookles.com> References: <45760.1321515124@snookles.snookles.com> Message-ID: <4EC638E4.80805@erlang.org> On 11/17/2011 08:32 AM, Scott Lystig Fritchie wrote: > Bj?rn Gustavsson wrote: > > bg> My final comment is that your changes are included in a single > bg> commit, which make it harder to review and will it make it harder to > bg> understand in the future. I would suggest breaking it up into > bg> several commits (at least three): [...] > > Bj?rn, I've split the commit from 1 -> 4 pieces. I've also fixed a few > bugs and have un-done the DTrace-related edits that I'd put in > README.md. Instead, that text has been moved to a new file, > README.dtrace.md. > > I have eliminated all of the OTP test suite failures that I'm aware of, > though the tests were run this afternoon prior to splitting the commit. > It's possible that I un-fixed a bugfix, though I think the odds are low. > I'll be re-running the tests overnight tonight with DTrace unconfigured, > DTrace configured, and DTrace configured + probes enabled(*). > > git clone git://github.com/slfritchie/otp.git dtrace-review3 > > https://github.com/slfritchie/otp/compare/dtrace-review3 > https://github.com/slfritchie/otp/compare/dtrace-review3.patch > > -Scott > > (*) I've encountered a odd/weird/buggy? problem with Solaris 10 where > the Erlang OS process occasionally dumps core due to a SIGTRAP. I think > it may have to do with a race condition between starting a new process > and a turn-them-all-on probe specification. If anybody happens to know > (or guess) anything about this, please contact me. > _______________________________________________ > erlang-patches mailing list > erlang-patches@REDACTED > http://erlang.org/mailman/listinfo/erlang-patches I added this version to 'pu' yesterday for testing -- /Henrik Nord Erlang/OTP From aronisstav@REDACTED Fri Nov 18 15:26:21 2011 From: aronisstav@REDACTED (Stavros Aronis) Date: Fri, 18 Nov 2011 15:26:21 +0100 Subject: [erlang-patches] Discrepancy detection in behaviours Message-ID: Hi, This patch enables Dialyzer to detect discrepancies in the implementation of behaviors. The new warnings regard incorrect treatment of the arguments passed to the callback, incorrect return values, errors in the specs provided for the callbacks and also warnings for missing callbacks or behaviours with no information about their callbacks. Documentation on how to provide this information is already included in the OTP Design Principles User's Guide and the existing major behaviors have been already patched to include such information. git fetch git://github.com/aronisstav/otp.git dialyzer-behaviours Stavros -------------- next part -------------- An HTML attachment was scrubbed... URL: From henrik@REDACTED Fri Nov 18 15:38:03 2011 From: henrik@REDACTED (Henrik Nord) Date: Fri, 18 Nov 2011 15:38:03 +0100 Subject: [erlang-patches] Discrepancy detection in behaviours In-Reply-To: References: Message-ID: <4EC66DCB.4070801@erlang.org> On 11/18/2011 03:26 PM, Stavros Aronis wrote: > Hi, > > This patch enables Dialyzer to detect discrepancies in the > implementation of behaviors. The new warnings regard incorrect > treatment of the arguments passed to the callback, incorrect return > values, errors in the specs provided for the callbacks and also > warnings for missing callbacks or behaviours with no information about > their callbacks. Documentation on how to provide this information is > already included in the OTP Design Principles User's Guide and the > existing major behaviors have been already patched to include such > information. > > git fetch git://github.com/aronisstav/otp.git > dialyzer-behaviours > > Stavros > > > _______________________________________________ > erlang-patches mailing list > erlang-patches@REDACTED > http://erlang.org/mailman/listinfo/erlang-patches Thank you Stavros. included -- /Henrik Nord Erlang/OTP -------------- next part -------------- An HTML attachment was scrubbed... URL: From fritchie@REDACTED Mon Nov 21 07:41:48 2011 From: fritchie@REDACTED (Scott Lystig Fritchie) Date: Mon, 21 Nov 2011 00:41:48 -0600 Subject: [erlang-patches] DTrace patch, review draft #3 In-Reply-To: Message of "Fri, 18 Nov 2011 11:52:20 +0100." <4EC638E4.80805@erlang.org> Message-ID: <36481.1321857708@snookles.snookles.com> Henrik Nord wrote: hn> I added this version to 'pu' yesterday for testing Hi, Henrik. Over the weekend, I updated the "dtrace-review3" branch with two additional commits: Add SystemTap README and sample scripts. Bugfixes to dtrace-review3 branch (squashed) If you'd prefer, I could squash the new SystemTap commit into the "Add DTrace support for OS X, Solaris, and Linux (via SystemTap), 2/4" commit. They're related in theme close enough to make sense squashing together. I didn't know what you wanted to see regarding bug and style fixing, so I squashed all bug and style fixes into a single commit. (And would squash new bug/style fixes into that same single commit?) I've a related question ... has your group picked a code freeze date yet? I suspect one bug (or, rather, a non-fatal mis-feature) in the Makefile.in recipe for FreeBSD and Solaris, but I'm not certain yet. And if there's enough time, I might try adding a few more useful probes. (Or someone else might wish to add new ones ... I sent queries to Dustin Sallings and Michal Ptaszek this weekend and haven't heard back yet, but, well, it *is* the weekend ...) -Scott From cstomi.levlist@REDACTED Tue Nov 22 10:41:23 2011 From: cstomi.levlist@REDACTED (Tamas.Cseke ) Date: Tue, 22 Nov 2011 10:41:23 +0100 Subject: [erlang-patches] [PATCH] SSL error handling Message-ID: <4ECB6E43.7050100@gmail.com> Hi, We use tcp keepalive options with active mode and when a break network connection the {ssl_closed, _} message is sen't to 'no_pid' makes the process crash and the user module doesn't detect the failure. I changed to send to the the correct pid. Maybe other alert users could be changed too, but I can't reproduce those error cases. Please review. git fetch git://github.com/tcseke/otp.git sslfix https://github.com/tcseke/otp/compare/sslfix https://github.com/tcseke/otp/compare/sslfix.patch Thanks, Tamas commit 849b81ffe6f66601997bff801c44b80a14f99152 Author: Tamas Cseke Date: Tue Nov 22 10:11:52 2011 +0100 Fix SSL connection teardown handling. We detect network connection failures with TCP keepalive. After the connection goes down, the error messages is sent to 'no_pid' that cause a badarg error. And the user module never doesn't detect the error. -define(SOL_TCP, 6). -define(TCP_KEEPIDLE, 4). -define(TCP_KEEPINTVL, 5). -define(TCP_KEEPCNT, 6). -define(KEEPALIVE_IDLE, 30). -define(KEEPALIVE_INTVL, 10). -define(KEEPALIVE_CNT, 5). ssl:setopts(Socket, [{raw, ?SOL_TCP, ?TCP_KEEPIDLE, <>}, {raw, ?SOL_TCP, ?TCP_KEEPINTVL, <>}, {raw, ?SOL_TCP, ?TCP_KEEPCNT, <>}]). From henrik@REDACTED Tue Nov 22 11:57:11 2011 From: henrik@REDACTED (Henrik Nord) Date: Tue, 22 Nov 2011 11:57:11 +0100 Subject: [erlang-patches] DTrace patch, review draft #3 In-Reply-To: <36481.1321857708@snookles.snookles.com> References: <36481.1321857708@snookles.snookles.com> Message-ID: <4ECB8007.4040208@erlang.org> On 11/21/2011 07:41 AM, Scott Lystig Fritchie wrote: > Henrik Nord wrote: > > hn> I added this version to 'pu' yesterday for testing > > Hi, Henrik. Over the weekend, I updated the "dtrace-review3" branch > with two additional commits: > > Add SystemTap README and sample scripts. > Bugfixes to dtrace-review3 branch (squashed) > > If you'd prefer, I could squash the new SystemTap commit into the "Add > DTrace support for OS X, Solaris, and Linux (via SystemTap), 2/4" > commit. They're related in theme close enough to make sense squashing > together. Sounds good > > I didn't know what you wanted to see regarding bug and style fixing, so > I squashed all bug and style fixes into a single commit. (And would > squash new bug/style fixes into that same single commit?) Yes, or into the commits itself, so there is no real "bugfix" commit, but these fixes are merged into the different commits, the mechanics one, the example programs one, and the one adding probes > > I've a related question ... has your group picked a code freeze date > yet? I suspect one bug (or, rather, a non-fatal mis-feature) in the > Makefile.in recipe for FreeBSD and Solaris, but I'm not certain yet. > And if there's enough time, I might try adding a few more useful probes. > (Or someone else might wish to add new ones ... I sent queries to Dustin > Sallings and Michal Ptaszek this weekend and haven't heard back yet, > but, well, it *is* the weekend ...) > > -Scott Yes, Deadline for this (and other patches from 'pu' will be next Wednesday, so the 30th of November. There will be a R15A tag pushed to github later today. And I would like you to rebase your branch upon that, there is some minor merge conflicts. Then I will refetch your branch tomorrow. -- /Henrik Nord Erlang/OTP From acmmlyc@REDACTED Tue Nov 22 12:31:43 2011 From: acmmlyc@REDACTED (Anneli Cuss) Date: Tue, 22 Nov 2011 22:31:43 +1100 Subject: [erlang-patches] [PATCH] Fix XPath tokenising behaviour with attributes, commas Message-ID: Hi all, I have a one-line patch to xmerl_xpath_scan.erl which corrects tokenising behaviour when attributes and commas get too friendly: git fetch git://github.com/anneli/otp.git fix_xmerl_xpath_scan To view changes: https://github.com/anneli/otp/compare/fix_xmerl_xpath_scan https://github.com/anneli/otp/compare/fix_xmerl_xpath_scan.patch I have a question about testing; the xmerl code seems to have come from its own world, and appears to be very much set up to test the extent of W3C conformance. Hence, I'm not sure where a test belongs, or indeed, where or how to implement it. At any rate, here's how to reproduce the bug this fixes: 1> xmerl_xpath_scan:tokens("concat(' ', @a)"). ** exception error: no function clause matching xmerl_xpath_scan:operator_name([],"attribute","::a)") (xmerl_xpath_scan.erl, line 151) in function xmerl_xpath_scan:tokens/2 (xmerl_xpath_scan.erl, line 66) 2> This is a valid XPath snippet, but the tokeniser appears to confuse part of the fragment for a boolean operator. Post-patch: 1> xmerl_xpath_scan:tokens("concat(' ', @a)"). [{function_name,1,concat}, {'(',1,'('}, {literal,1," "}, {',',1,','}, {axis,1,attribute}, {'::',1,'::'}, {name,1,{a,[],"a"}}, {')',1,')'}, {'$end',1,'$end'}] 2> Best, Anneli Cuss From egil@REDACTED Tue Nov 22 14:54:31 2011 From: egil@REDACTED (=?ISO-8859-1?Q?Bj=F6rn-Egil_Dahlberg?=) Date: Tue, 22 Nov 2011 14:54:31 +0100 Subject: [erlang-patches] OTP_R15A: R15 pre-release Message-ID: <4ECBA997.3020209@erlang.org> Hello! We have recently pushed a new master to GitHub tagged OTP_R15A. This is a pre-release of the upcoming R15B release and will only be available through GitHub, tagged OTP_R15A. This is a stabilized snapshot of the current R15 development which, among other things, includes: OTP-9468 'Line numbers in exceptions' OTP-9451 'Parallel make' OTP-4779 A new GUI for Observer. Integrating pman, etop and tv into observer with tracing facilities. OTP-7775 A number of memory allocation optimizations have been implemented. Most optimizations reduce contention caused by synchronization between threads during allocation and deallocation of memory. Most notably: Synchronization of memory management in scheduler specific allocator instances has been rewritten to use lock-free synchronization. Synchronization of memory management in scheduler specific pre-allocators has been rewritten to use lock-free synchronization. The 'mseg_alloc' memory segment allocator now use scheduler specific instances instead of one instance. Apart from reducing contention this also ensures that memory allocators always create memory segments on the local NUMA node on a NUMA system. OTP-9632 An ERTS internal, generic, many to one, lock-free queue for communication between threads has been introduced. The many to one scenario is very common in ERTS, so it can be used in a lot of places in the future. Currently it is used by scheduling of certain jobs, and the async thread pool, but more uses are planned for the future. Drivers using the driver_async functionality are not automatically locked to the system anymore, and can be unloaded as any dynamically linked in driver. Scheduling of ready async jobs is now also interleaved in between other jobs. Previously all ready async jobs were performed at once. OTP-9631 The ERTS internal system block functionality has been replaced by new functionality for blocking the system. The old system block functionality had contention issues and complexity issues. The new functionality piggy-backs on thread progress tracking functionality needed by newly introduced lock-free synchronization in the runtime system. When the functionality for blocking the system isn't used, there is more or less no overhead at all. This since the functionality for tracking thread progress is there and needed anyway. ... and much much more. This is not a full release of R15 but rather a pre-release. Feel free to try our R15A release and get back to us with your findings. Your feedback is important to us and highly welcomed. Regards, The OTP Team From max.lapshin@REDACTED Tue Nov 22 15:21:09 2011 From: max.lapshin@REDACTED (Max Lapshin) Date: Tue, 22 Nov 2011 17:21:09 +0300 Subject: [erlang-patches] OTP_R15A: R15 pre-release In-Reply-To: <4ECBA997.3020209@erlang.org> References: <4ECBA997.3020209@erlang.org> Message-ID: Wow! I'm in hurry to test new version. From fritchie@REDACTED Wed Nov 23 00:34:18 2011 From: fritchie@REDACTED (Scott Lystig Fritchie) Date: Tue, 22 Nov 2011 17:34:18 -0600 Subject: [erlang-patches] DTrace patch, review draft #3 In-Reply-To: Message of "Tue, 22 Nov 2011 11:57:11 +0100." <4ECB8007.4040208@erlang.org> Message-ID: <7822.1322004858@snookles.snookles.com> Henrik Nord wrote: hn> Yes, or into the commits itself, so there is no real "bugfix" hn> commit, but these fixes are merged into the different commits, the hn> mechanics one, the example programs one, and the one adding probes OK, I've squashed things so that it looks as if the original 4 commits are the only ones. hn> Yes, Deadline for this (and other patches from 'pu' will be next hn> Wednesday, so the 30th of November. Great, thanks! hn> There will be a R15A tag pushed to github later today. And I would hn> like you to rebase your branch upon that, there is some minor merge hn> conflicts. Then I will refetch your branch tomorrow. I've rebased the "dtrace-review3" branch on the OTP_R15A tag as I found it today, commit e21ff9b0b69219ab3853be7e80813156113152b7. Right now, the new head of the "dtrace-review3" branch is 4242b9c0eca65b767eabcc192d980fa3754d5b33. Many thanks for reviewing this work! -Scott From vladdu55@REDACTED Wed Nov 23 08:57:47 2011 From: vladdu55@REDACTED (Vlad Dumitrescu) Date: Wed, 23 Nov 2011 08:57:47 +0100 Subject: [erlang-patches] jinterface: workaround for a Java bug In-Reply-To: <4EB1159E.40204@erlang.org> References: <4EB1159E.40204@erlang.org> Message-ID: Hi! I have a test for this, but I couldn't test it with Java 1.5, as it's a hell to try to install it in a newer Ubuntu. Please let me know if you want to include it anyway or if Java 5 is to be considered deprecated (it already passed its end-of-life and premier commercial support is also not available anymore). best regards, Vlad On Wed, Nov 2, 2011 at 11:04, Henrik Nord wrote: > On 10/20/2011 02:38 PM, Vlad Dumitrescu wrote: >> >> git fetch git://github.com/vladdu/opt.git java_string_bug >> >> https://github.com/vladdu/otp/compare/java_string_bug >> https://github.com/vladdu/otp/compare/java_string_bug.patch >> >> OtpErlangString is affected by Java bug >> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6242664 >> >> Java 1.5 has a bug where detecting codepoint offsets in strings that are >> created by String.substring() gives wrong results. The new implementation >> uses a different method, avoinding the issue. >> >> The following code will crash without the fix: >> ? ? ? ? final String s = "abcdefg"; >> ? ? ? ? final String ss = s.substring(3, 6); >> ? ? ? ? final int[] cps = OtpErlangString.stringToCodePoints(ss); >> >> regards, >> Vlad >> _______________________________________________ >> erlang-patches mailing list >> erlang-patches@REDACTED >> http://erlang.org/mailman/listinfo/erlang-patches > > Hi > > We would like a test for this. > The suggestion is to extend the lists_roundtrip_2 test in nc_SUIT.erl by > adding a new tag for the codepoint operation, and consequently adding the > same to echo_server.java similar to how "sub3atom" is done. > > Thank you for the contribution! > > -- > /Henrik Nord Erlang/OTP > > From henrik@REDACTED Wed Nov 23 09:57:49 2011 From: henrik@REDACTED (Henrik Nord) Date: Wed, 23 Nov 2011 09:57:49 +0100 Subject: [erlang-patches] DTrace patch, review draft #3 In-Reply-To: <7822.1322004858@snookles.snookles.com> References: <7822.1322004858@snookles.snookles.com> Message-ID: <4ECCB58D.8070306@erlang.org> On 11/23/2011 12:34 AM, Scott Lystig Fritchie wrote: > Henrik Nord wrote: > > hn> Yes, or into the commits itself, so there is no real "bugfix" > hn> commit, but these fixes are merged into the different commits, the > hn> mechanics one, the example programs one, and the one adding probes > > OK, I've squashed things so that it looks as if the original 4 commits > are the only ones. > > hn> Yes, Deadline for this (and other patches from 'pu' will be next > hn> Wednesday, so the 30th of November. > > Great, thanks! > > hn> There will be a R15A tag pushed to github later today. And I would > hn> like you to rebase your branch upon that, there is some minor merge > hn> conflicts. Then I will refetch your branch tomorrow. > > I've rebased the "dtrace-review3" branch on the OTP_R15A tag as I found > it today, commit e21ff9b0b69219ab3853be7e80813156113152b7. Right now, > the new head of the "dtrace-review3" branch is > 4242b9c0eca65b767eabcc192d980fa3754d5b33. > > Many thanks for reviewing this work! > > -Scott Refetched -- /Henrik Nord Erlang/OTP From henrik@REDACTED Wed Nov 23 11:05:17 2011 From: henrik@REDACTED (Henrik Nord) Date: Wed, 23 Nov 2011 11:05:17 +0100 Subject: [erlang-patches] jinterface: workaround for a Java bug In-Reply-To: References: <4EB1159E.40204@erlang.org> Message-ID: <4ECCC55D.3000603@erlang.org> On 11/23/2011 08:57 AM, Vlad Dumitrescu wrote: > Hi! > > I have a test for this, but I couldn't test it with Java 1.5, as it's > a hell to try to install it in a newer Ubuntu. Please let me know if > you want to include it anyway or if Java 5 is to be considered > deprecated (it already passed its end-of-life and premier commercial > support is also not available anymore). > > best regards, > Vlad We would like it. Thank you > > On Wed, Nov 2, 2011 at 11:04, Henrik Nord wrote: >> On 10/20/2011 02:38 PM, Vlad Dumitrescu wrote: >>> git fetch git://github.com/vladdu/opt.git java_string_bug >>> >>> https://github.com/vladdu/otp/compare/java_string_bug >>> https://github.com/vladdu/otp/compare/java_string_bug.patch >>> >>> OtpErlangString is affected by Java bug >>> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6242664 >>> >>> Java 1.5 has a bug where detecting codepoint offsets in strings that are >>> created by String.substring() gives wrong results. The new implementation >>> uses a different method, avoinding the issue. >>> >>> The following code will crash without the fix: >>> final String s = "abcdefg"; >>> final String ss = s.substring(3, 6); >>> final int[] cps = OtpErlangString.stringToCodePoints(ss); >>> >>> regards, >>> Vlad >>> _______________________________________________ >>> erlang-patches mailing list >>> erlang-patches@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-patches >> Hi >> >> We would like a test for this. >> The suggestion is to extend the lists_roundtrip_2 test in nc_SUIT.erl by >> adding a new tag for the codepoint operation, and consequently adding the >> same to echo_server.java similar to how "sub3atom" is done. >> >> Thank you for the contribution! >> >> -- >> /Henrik Nord Erlang/OTP >> >> -- /Henrik Nord Erlang/OTP From henrik@REDACTED Wed Nov 23 11:13:01 2011 From: henrik@REDACTED (Henrik Nord) Date: Wed, 23 Nov 2011 11:13:01 +0100 Subject: [erlang-patches] [PATCH] Fix XPath tokenising behaviour with attributes, commas In-Reply-To: References: Message-ID: <4ECCC72D.2050506@erlang.org> On 11/22/2011 12:31 PM, Anneli Cuss wrote: > Hi all, > > I have a one-line patch to xmerl_xpath_scan.erl which corrects > tokenising behaviour when attributes and commas get too friendly: > > git fetch git://github.com/anneli/otp.git fix_xmerl_xpath_scan > > To view changes: > > https://github.com/anneli/otp/compare/fix_xmerl_xpath_scan > https://github.com/anneli/otp/compare/fix_xmerl_xpath_scan.patch > > I have a question about testing; the xmerl code seems to have come > from its own world, and appears to be very much set up to test the > extent of W3C conformance. Hence, I'm not sure where a test belongs, > or indeed, where or how to implement it. > > At any rate, here's how to reproduce the bug this fixes: > > 1> xmerl_xpath_scan:tokens("concat(' ', @a)"). > ** exception error: no function clause matching > xmerl_xpath_scan:operator_name([],"attribute","::a)") > (xmerl_xpath_scan.erl, line 151) > in function xmerl_xpath_scan:tokens/2 (xmerl_xpath_scan.erl, line 66) > 2> > > This is a valid XPath snippet, but the tokeniser appears to confuse > part of the fragment for a boolean operator. > > Post-patch: > > 1> xmerl_xpath_scan:tokens("concat(' ', @a)"). > [{function_name,1,concat}, > {'(',1,'('}, > {literal,1," "}, > {',',1,','}, > {axis,1,attribute}, > {'::',1,'::'}, > {name,1,{a,[],"a"}}, > {')',1,')'}, > {'$end',1,'$end'}] > 2> > > Best, > > Anneli Cuss > _______________________________________________ > erlang-patches mailing list > erlang-patches@REDACTED > http://erlang.org/mailman/listinfo/erlang-patches You patch is included Thank you for the contribution! -- /Henrik Nord Erlang/OTP From sverker@REDACTED Wed Nov 23 11:51:19 2011 From: sverker@REDACTED (Sverker Eriksson) Date: Wed, 23 Nov 2011 11:51:19 +0100 Subject: [erlang-patches] [erlang-questions] OTP_R15A: R15 pre-release In-Reply-To: References: <4ECBA997.3020209@erlang.org> Message-ID: <4ECCD027.2010001@erix.ericsson.se> Michael Uvarov wrote: > Is there dirty scheduling for NIFs in this build? > > No, and it won't be in R15B either. Other things have been prioritized. /Sverker, Erlang/OTP, Ericsson From bgustavsson@REDACTED Wed Nov 23 12:28:31 2011 From: bgustavsson@REDACTED (=?UTF-8?Q?Bj=C3=B6rn_Gustavsson?=) Date: Wed, 23 Nov 2011 12:28:31 +0100 Subject: [erlang-patches] DTrace patch, review draft #3 In-Reply-To: <7822.1322004858@snookles.snookles.com> References: <4ECB8007.4040208@erlang.org> <7822.1322004858@snookles.snookles.com> Message-ID: On 11/23/11, Scott Lystig Fritchie wrote: > OK, I've squashed things so that it looks as if the original 4 commits > are the only ones. Here are my first batch of comments, found during my first quick scan. I will probably post more comments later. Don't use assert.h in the emulator source code. We have our own ASSERT() macro defined in sys.h. The ERTS_INLINE macros are not used in a portable way. For functions to be used just in the same source file, use "static ERTS_INLINE". For functions to be used from several source files, you must put the inline functions in a header files. Here is an example from global.h how it should be done: ERTS_GLB_INLINE void *erts_prtsd_get(Port *p, int ix); #if ERTS_GLB_INLINE_INCL_FUNC_DEF ERTS_GLB_INLINE void * erts_prtsd_get(Port *prt, int ix) { return prt->psd ? prt->psd->data[ix] : NULL; } #endif In addition, the header file must be included from utils.c (to ensure that the functions will be defined even if inlining is turned off). Here are a few git issues, that makes it confusing to examine the diff in gitk: lib/Makefile is update in both commit 1/4 and 4/4. I think that the update should be combined into one that should go into commit 1/4. erl_node_tables.h has an addition in commit 1/4: +extern char erts_this_node_sysname[256]; /* must match erl_node_tables.c */ but is later changed in commit 3/4. lib/dtrace/c_src/Makefile contains a reference to "clearmake -C gnu". We no longer support clearmake, so the comment should not be added to new Makefiles. If noticed two typos in README.dtrace.md: diff --git a/README.dtrace.md b/README.dtrace.md index a01606f..fff8a5f 100644 --- a/README.dtrace.md +++ b/README.dtrace.md @@ -28,7 +28,7 @@ Supported platforms ------------------- The autoconf procedure is supported, I believe, for OS X/Snow Leopard -and OpenSolaris/64-bit. Just add the `--enable-dtrace` option your +and OpenSolaris/64-bit. Just add the `--enable-dtrace` option to your command to run the `configure` script. The code has been only very lightly tested on OS X. It ought to @@ -38,7 +38,7 @@ The autoconf stuff is ugly right now. It could use some cleaning up. For example: * After editing the `erlang_dtrace.d` file, you need to re-run the -* top-level "configure" script in order to update `erlang_dtrace.h`. + top-level "configure" script in order to update `erlang_dtrace.h`. * `make clean` will remove `erlang_dtrace.h`. A build will fail unless the top-level "configure" script is re-run to re-create that file. That is all for now. /Bj?rn -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From henrik@REDACTED Wed Nov 23 16:51:30 2011 From: henrik@REDACTED (Henrik Nord) Date: Wed, 23 Nov 2011 16:51:30 +0100 Subject: [erlang-patches] What's cooking in erlang/otp (2011-11-23) Message-ID: <201111231551.pANFpSRp030270@smaug.otp.ericsson.se> Hello! The release of R15B is approaching, the preliminary release date is 14th of December. The code stop for me, and thus for patches from you, is Wednesday the 30th November. Keep in mind that that date is for patches that are reviewed and done by that date, so if you want to have your patch included in R15, you need to send it in asap. After the release of R15B we will introduce the new 'maint' branch and the new 'maint-pu' branch for patches. See the wiki for more information about what branch to base your patch-branches upon. https://github.com/erlang/otp/wiki ------------------------------------------------------------ [Graduated] * fm/process_info_doc_fix (erts) (2011-09-20) 1 commit + Fix documentation for erlang:process_flag/2 (e88a46d) * gs/mod_log-fix (inets) (2011-09-24) 1 commit + Fix logging of content length in mod_log (166f4cc) * jw/release_handler-which-releases (sasl) (2011-10-18) 1 commit + Add release_handler:which_releases/1 (66be346) * mh/odbc-shutdown-normal-exit (odbc) (2011-10-21) 1 commit + An ODBC process should exit normally if its client exits with 'shutdown' (06d560b) * nox/xmerl-namespace-axis (xmerl) (2011-10-28) 13 commits + Fix bugs and add a flag to skip comments (5b2375f) + Implement namespace axis (ef8ba55) + Add `#xmlPI` support to xmerl_xpath:write_node/1 (5b9aeb6) + Fix processing-instruction(name?) (bffc6b4) + Fix path filters (3eaca03) + Support more top-level primary expressions (3979cef) + Accumulate comments in element nodes (6d84168) + Add `default_attrs` option (fcf6b58) + Allow whole documents to be returned (7fc95c0) + Track parents and namespace in `#xmlAttribute` nodes (64a4119) + Track parents in `#xmlPI` nodes (2b11547) + Set `vsn` field in `#xmlDecl` record (5d3feb9) ... * pr/mnesia_frag_hash (mnesia) (2011-04-27) 2 commits + add mnesia_frag_hash test (1d6762d) + Reduce calls to phash in key_to_frag_number (67a20c0) * rj/fix-net_kernel-doc (kernel) (2011-09-28) 1 commit + Fixes net_kernel:get_net_ticktime() doc (bfa676a) * sa/dialyzer-behaviours (dialyzer) (2011-11-14) 8 commits + Wrap up behaviours patch for Dialyzer (8167578) + Detection of callback-spec discrepancies (8682e6b) + Allow none() as return value in callbacks (fc075ff) + Behaviour callback discrepancy detection for Dialyzer (d101155) + Add lookup function for callbacks (7fde343) + Store callbacks in codeserver and PLT (191151e) + Collect callback definitions during compilation (93aa83a) + Update inets results (0472f66) * sa/dialyzer-wunderspecs (dialyzer) (2011-10-04) 2 commits + Fix false warning about closure application (33f6f13) + Change category of 'might also return' warnings (7892a31) * ta/snmpc-warnings-option (snmp) (2011-10-05) 1 commit + snmpc: fix --warnings/--W option parsing (156b2ed) ------------------------------------------------------------ [New topics] * ac/xpath-scan (xmerl) (2011-11-21) 1 commit - Treat , as special in xmerl_xpath_scan. (15925c0) * av/maint-memsup (os_mon) (2011-11-08) 1 commit - Fix segmentation fault in memsup (a95ebdd) * jz/remove-variable-processes_busy (erts) (2011-11-02) 1 commit - erts: remove variable processes_busy (d428f18) * mh/eunit_surefire-fixture-errors (eunit) (2011-03-10) 1 commit - Include fixture setup and cleanup errors in Eunit Surefire report (7425075) * slf/dtrace (Makefile , dtrace, erts, kernel, otp) (2011-11-17) 4 commits - Add DTrace support for OS X, Solaris, and Linux (via SystemTap), 4/4 (9d9194b) - Add DTrace support for OS X, Solaris, and Linux (via SystemTap), 3/4 (09689d6) - Add DTrace support for OS X, Solaris, and Linux (via SystemTap), 2/4 (139b645) - Add DTrace support for OS X, Solaris, and Linux (via SystemTap), 1/4 (fe471ac) * vd/jinterface-atom-message (jinterface) (2011-11-11) 1 commit - Improve error message when creating a too long OtpErlangAtom (334d636) ------------------------------------------------------------ [Stalled] * bw/efile_exists (erts) (2010-10-07) 1 commit - prim_file:exists/{1,2} which is lightweight file existence check (2759905) Action expected from: Topic author * jn/gen_stream (stdlib) (2011-04-15) 2 commits - Update gen_stream tests to conform with common_test standard (ce84daf) - Add gen_stream behaviour (6a089a4) Action expected from: OTP-Team * tn/inet_drv-fix (erts) (2011-04-08) 1 commit - Use libdlpi to get physical address (e360563) Action expected from: Topic author ------------------------------------------------------------ [Cooking] * ao/fix-change-time-inval-dates (kernel) (2011-11-01) 1 commit - Fix a crash when file:change_time/2,3 are called with invalid dates (cddc88d) * bg/temp-hipe-fixes (compiler, kernel) (2010-03-15) 5 commits - Avoid crash by skipping compilation_SUITE:on_load/1 (0198ee2) - Inline less aggressively for native-code compilation (41638df) - seq_trace_SUITE: Don't native-compile (fce2b79) - Disable native code if on_load is used (c8994f2) - andor_SUITE: Don't native-compile (531e5d9) This branch contains temporary workarounds to avoid failing test cases and is never intended to graduate. * hw/asn1rt_check-transform (asn1) (2011-10-15) 1 commit - asn1rt_check: Fix transform_to_EXTERNAL1990 for binary input (6a69602) * mh/create_cookie_error_msg (kernel) (2011-09-15) 1 commit - Specify file name and error on create_cookie failure (9319587) * mh/run_erl-exit-status (erts) (2011-09-02) 1 commit - run_erl.c: propagate exit status from child process (29364cf) * sg/fix-snmp_note_store-timer (snmp) (2011-11-08) 2 commits - snmp: add regression test for GC timer (597ce3c) - snmp: fix GC timer in snmp_note_store (09816ca) * ta/docs (erts, inets, kernel, otp, reltool, ssl, stdlib, test_server) (2011-11-23) 12 commits - Fix typo in reltool(3) (8932510) - Fix typo in gen_sctp(3) (d0656f3) - Fix typo in mod_responsecontrol.erl (bd8fa78) - Fix typo in erts_alloc(3) (161d70b) - Fix typos in ssl_cipher.erl (505e3a2) - Fix typos in expressions.xml (8353450) - file: correct make_link/2 and make_symlink/2 docs (765afb8) - Fix typo in test_server(3) (85b7363) - Fix typos in io_protocol.xml (0e472e5) - Fix typo in erlang(3) (3262866) - Fix typos in tar_SUITE (8a61b06) - Fix typos in erts/preloaded/src (bc875dd) * ta/prim_archive-reloading-mfa (erts, kernel, stdlib) (2011-10-19) 2 commits - escript_SUITE: remove gratuitous space (3d89996) - [erts,kernel,stdlib] fix escript/primary archive reloading (4ac74ce) * uw/extending_gen (stdlib) (2011-11-21) 5 commits - fix error in gen_[server|fsm]:enter_loop() (8983794) - fix documentation and whitespace errors (dd2a47b) - await process death in dummy_via:reset() (42d93e4) - faulty export in gen_fsm_SUITE.erl (e447bbe) - Add plugin support for alternative name lookup (ed6daae) * wc/fix-eunit-print-stacktrace (eunit) (2011-11-02) 1 commit - fix eunit to print stacktrace correctly if test cases throw any exception (73b94a9) * ws/erl-xcomp-avr32 (otp) (2011-11-01) 1 commit - Update xcomp config for AVR32/buildroot-v3.0.0 (e89c2af) * ta/sendfile (diameter, erts, kernel, otp, stdlib, tools) (2011-01-13) 22 commits . Implement file:sendfile (c44f202) . otp: Update profiling doc with eprof (bb55c1c) . eprof: Fix invalid references to removed functions (25d213a) . Fix a few tests that used to fail on the HiPE platform (7afae64) . Dumb down release target to Solaris /usr/ucb/install (75ca1f8) . Dumb down opt/release targets to make 3.80 (b3e7e9c) . Minor tweaks and cleanup (ab7d352) . Need absolute -pa for bootstrap build (b9bed0b) . Simpler release targets for src subdirectories (5fbbdc6) . Use secondary expansion for src subdirectory rules (0f63f67) . One makefile for src build instead of recursion (0c7bbe0) . Remove app dependency on compiler to avoid forced recompilation (903dca1) ------------------------------------------------------------ [Dropped] * fm/posix-fallocate (erts, kernel) (2010-12-28) 1 commit . Added file:allocate/2 (7b39f0f) Temporary dropped due to massive merge conflicts Needs rebase, and testfixes. * jw/gen_event (stdlib) (2011-10-18) 1 commit . General code clean up and clarity fixes (dbd14ea) From egil@REDACTED Wed Nov 23 17:24:04 2011 From: egil@REDACTED (=?windows-1252?Q?Bj=F6rn-Egil_Dahlberg?=) Date: Wed, 23 Nov 2011 17:24:04 +0100 Subject: [erlang-patches] DTrace patch, review draft #3 In-Reply-To: <7822.1322004858@snookles.snookles.com> References: <7822.1322004858@snookles.snookles.com> Message-ID: <4ECD1E24.4070805@erlang.org> On 2011-11-23 00:34, Scott Lystig Fritchie wrote: > Henrik Nord wrote: > > hn> There will be a R15A tag pushed to github later today. And I would > hn> like you to rebase your branch upon that, there is some minor merge > hn> conflicts. Then I will refetch your branch tomorrow. > > I've rebased the "dtrace-review3" branch on the OTP_R15A tag as I found > it today, commit e21ff9b0b69219ab3853be7e80813156113152b7. Right now, > the new head of the "dtrace-review3" branch is > 4242b9c0eca65b767eabcc192d980fa3754d5b33. > > Many thanks for reviewing this work! I am looking forward to dtrace in R15B-release. Great work! =) Review stuff: I have only reviewed efile <- prim_file <- file (I had a major merge-confligt with the whole impl.-tree for opu =) I do not like the file/efile dtrace implementation. In prim_file: read(FD, Size) -> read(FD, Size, get_dtrace_utag()). get_dtrace_utag() which is a process dictionary get, not ideal for every read and write. Especially not for non-dtrace builds. We have an idea for a solution. By introducing a special BIF that will return NIL for non-dtrace builds. This will be done by the loader so the compiler does not need to know anything (about that =). Furthermore, the file driver should not receive extra data in non-dtrace builds (in this case it is only a byte though). This can be done by "#ifdef HAVE_DTRACE" on dt_utag = EV_CHAR_P(ev, p, q); etc. This is of course only viable with the loader solution above. Compiler warnings: Using gcc (Ubuntu/Linaro 4.6.1-9ubuntu3) 4.6.1, i.e. no dtrace enabled I think gcc's warning "unused-but-set-variable" is fairly new and a equipped with pain. I think the compiler normally optimizes this and removes it from the code. Still, it would be nice to remove the warnings. I get that some of them are on the TODO-list still, for instance erl_async len. You can use ERTS_DECLARE_DUMMY(); to suppress warnings, see erl_bif_binary.c for an example. I get the following new warnings: SLF common/erl_printf.c:179:5: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement] SLF common/erl_printf.c:179:5: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement] SLF beam/erl_message.c:339:42: warning: variable ?tok_serial? set but not used [-Wunused-but-set-variable] SLF beam/erl_message.c:339:25: warning: variable ?tok_lastcnt? set but not used [-Wunused-but-set-variable] SLF beam/erl_message.c:339:10: warning: variable ?tok_label? set but not used [-Wunused-but-set-variable] SLF beam/erl_message.c:498:46: warning: variable ?tok_serial? set but not used [-Wunused-but-set-variable] SLF beam/erl_message.c:498:29: warning: variable ?tok_lastcnt? set but not used [-Wunused-but-set-variable] SLF beam/erl_message.c:498:14: warning: variable ?tok_label? set but not used [-Wunused-but-set-variable] SLF beam/erl_message.c:825:42: warning: variable ?tok_serial? set but not used [-Wunused-but-set-variable] SLF beam/erl_message.c:825:25: warning: variable ?tok_lastcnt? set but not used [-Wunused-but-set-variable] SLF beam/erl_message.c:825:10: warning: variable ?tok_label? set but not used [-Wunused-but-set-variable] SLF beam/dist.c:745:10: warning: variable ?msize? set but not used [-Wunused-but-set-variable] SLF beam/dist.c:744:42: warning: variable ?tok_serial? set but not used [-Wunused-but-set-variable] SLF beam/dist.c:744:25: warning: variable ?tok_lastcnt? set but not used [-Wunused-but-set-variable] SLF beam/dist.c:744:10: warning: variable ?tok_label? set but not used [-Wunused-but-set-variable] SLF beam/dist.c:792:12: warning: variable ?msize? set but not used [-Wunused-but-set-variable] SLF beam/dist.c:791:42: warning: variable ?tok_serial? set but not used [-Wunused-but-set-variable] SLF beam/dist.c:791:25: warning: variable ?tok_lastcnt? set but not used [-Wunused-but-set-variable] SLF beam/dist.c:791:10: warning: variable ?tok_label? set but not used [-Wunused-but-set-variable] SLF beam/dist.c:841:42: warning: variable ?tok_serial? set but not used [-Wunused-but-set-variable] SLF beam/dist.c:841:25: warning: variable ?tok_lastcnt? set but not used [-Wunused-but-set-variable] SLF beam/dist.c:841:10: warning: variable ?tok_label? set but not used [-Wunused-but-set-variable] SLF beam/erl_async.c:257:9: warning: unused variable ?len? [-Wunused-variable] SLF beam/erl_async.c:292:9: warning: unused variable ?len? [-Wunused-variable] SLF beam/erl_gc.c:2046:10: warning: unused variable ?pidbuf? [-Wunused-variable] SLF beam/beam_emu.c:1966:47: warning: variable ?tok_serial? set but not used [-Wunused-but-set-variable] SLF beam/beam_emu.c:1966:30: warning: variable ?tok_lastcnt? set but not used [-Wunused-but-set-variable] SLF beam/beam_emu.c:1966:15: warning: variable ?tok_label? set but not used [-Wunused-but-set-variable] SLF drivers/common/efile_drv.c:2320:45: warning: variable ?dt_i4? set but not used [-Wunused-but-set-variable] SLF drivers/common/efile_drv.c:2320:34: warning: variable ?dt_i3? set but not used [-Wunused-but-set-variable] SLF drivers/common/efile_drv.c:2320:23: warning: variable ?dt_i2? set but not used [-Wunused-but-set-variable] SLF drivers/common/efile_drv.c:2320:12: warning: variable ?dt_i1? set but not used [-Wunused-but-set-variable] SLF drivers/common/efile_drv.c:2319:11: warning: variable ?dt_utag? set but not used [-Wunused-but-set-variable] SLF drivers/common/efile_drv.c:2843:28: warning: variable ?dt_s1? set but not used [-Wunused-but-set-variable] SLF drivers/common/efile_drv.c:2842:45: warning: variable ?dt_i4? set but not used [-Wunused-but-set-variable] SLF drivers/common/efile_drv.c:2842:45: warning: variable ?dt_i4? set but not used [-Wunused-but-set-variable] Regards, Bj?rn-Egil From vladdu55@REDACTED Wed Nov 23 20:34:10 2011 From: vladdu55@REDACTED (Vlad Dumitrescu) Date: Wed, 23 Nov 2011 20:34:10 +0100 Subject: [erlang-patches] jinterface: workaround for a Java bug In-Reply-To: <4ECCC55D.3000603@erlang.org> References: <4EB1159E.40204@erlang.org> <4ECCC55D.3000603@erlang.org> Message-ID: Hi, Ok, please refetch. I have rebased the branch on master, I hope it's ok as R15A is out. The test is in a separate commit, so that you can run it with the original jinterface if you want (to check that the bug is there). git fetch git://github.com/vladdu/opt.git java_string_bug https://github.com/vladdu/otp/compare/java_string_bug https://github.com/vladdu/otp/compare/java_string_bug.patch regards, Vlad On Wed, Nov 23, 2011 at 11:05, Henrik Nord wrote: > On 11/23/2011 08:57 AM, Vlad Dumitrescu wrote: >> >> Hi! >> >> I have a test for this, but I couldn't test it with Java 1.5, as it's >> a hell to try to install it in a newer Ubuntu. Please let me know if >> you want to include it anyway or if Java 5 is to be considered >> deprecated (it already passed its end-of-life and premier commercial >> support is also not available anymore). >> >> best regards, >> Vlad > > We would like it. > Thank you >> >> On Wed, Nov 2, 2011 at 11:04, Henrik Nord ?wrote: >>> >>> On 10/20/2011 02:38 PM, Vlad Dumitrescu wrote: >>>> >>>> git fetch git://github.com/vladdu/opt.git java_string_bug >>>> >>>> https://github.com/vladdu/otp/compare/java_string_bug >>>> https://github.com/vladdu/otp/compare/java_string_bug.patch >>>> >>>> OtpErlangString is affected by Java bug >>>> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6242664 >>>> >>>> Java 1.5 has a bug where detecting codepoint offsets in strings that are >>>> created by String.substring() gives wrong results. The new >>>> implementation >>>> uses a different method, avoinding the issue. >>>> >>>> The following code will crash without the fix: >>>> ? ? ? ? final String s = "abcdefg"; >>>> ? ? ? ? final String ss = s.substring(3, 6); >>>> ? ? ? ? final int[] cps = OtpErlangString.stringToCodePoints(ss); >>>> >>>> regards, >>>> Vlad >>>> _______________________________________________ >>>> erlang-patches mailing list >>>> erlang-patches@REDACTED >>>> http://erlang.org/mailman/listinfo/erlang-patches >>> >>> Hi >>> >>> We would like a test for this. >>> The suggestion is to extend the lists_roundtrip_2 test in nc_SUIT.erl by >>> adding a new tag for the codepoint operation, and consequently adding the >>> same to echo_server.java similar to how "sub3atom" is done. >>> >>> Thank you for the contribution! >>> >>> -- >>> /Henrik Nord Erlang/OTP >>> >>> > > > -- > /Henrik Nord Erlang/OTP > > From fritchie@REDACTED Thu Nov 24 00:37:28 2011 From: fritchie@REDACTED (Scott Lystig Fritchie) Date: Wed, 23 Nov 2011 17:37:28 -0600 Subject: [erlang-patches] Tiny patch to inet_drv.c for Solaris Open Indiana and Illumos Message-ID: <9923.1322091448@snookles.snookles.com> Hi, all. I got a GitHub pull request several days ago for a tiny patch to inet_drv.c. https://github.com/slfritchie/otp/pull/3 I haven't seen anything on this list mentioning this small patch, so I thought I'd submit it on behalf of the original author. (He hasn't replied to my comment on the GitHub pull request, either.) Vladimir says that the patch is necessary for Solaris Illumos. I can confirm that it's necessary for Solaris Open Indiana build 151a, also. I haven't bootstrapped my development environment yet for Solaris 11 to know if it's required there, also. The 1-line patch is here: https://github.com/proger/otp/commit/f40294921d5862add77fd77851beb2785b026306` https://github.com/proger/otp/commit/f40294921d5862add77fd77851beb2785b026306.patch -Scott From trond.norbye@REDACTED Thu Nov 24 08:44:18 2011 From: trond.norbye@REDACTED (Trond Norbye) Date: Thu, 24 Nov 2011 08:44:18 +0100 Subject: [erlang-patches] Tiny patch to inet_drv.c for Solaris Open Indiana and Illumos In-Reply-To: <9923.1322091448@snookles.snookles.com> References: <9923.1322091448@snookles.snookles.com> Message-ID: It should no longer be needed after they reapplied my patch to use libdlpi to retrieve the mac address. (I just built everything on Solaris 11, and it detects everything correctly out of the box). At least on my OpenIndiana box (and I would guess other clones as well) libdlpi needs libdladm.so.1 which is installed in /lib, and libdlpi.so doesn't include an rpath to automatically detect it. That means that you'd need to add: LDFLAGS="-L/lib -R/lib" for it to successfully detect the availability of the library. Trond On Thu, Nov 24, 2011 at 12:37 AM, Scott Lystig Fritchie wrote: > Hi, all. ?I got a GitHub pull request several days ago for a tiny patch > to inet_drv.c. > > ? ?https://github.com/slfritchie/otp/pull/3 > > I haven't seen anything on this list mentioning this small patch, so I > thought I'd submit it on behalf of the original author. ?(He hasn't > replied to my comment on the GitHub pull request, either.) > > Vladimir says that the patch is necessary for Solaris Illumos. ?I can > confirm that it's necessary for Solaris Open Indiana build 151a, also. > I haven't bootstrapped my development environment yet for Solaris 11 to > know if it's required there, also. > > The 1-line patch is here: > > ? ?https://github.com/proger/otp/commit/f40294921d5862add77fd77851beb2785b026306` > ? ?https://github.com/proger/otp/commit/f40294921d5862add77fd77851beb2785b026306.patch > > -Scott > _______________________________________________ > erlang-patches mailing list > erlang-patches@REDACTED > http://erlang.org/mailman/listinfo/erlang-patches > -- Trond Norbye From raimo+erlang-patches@REDACTED Thu Nov 24 18:07:46 2011 From: raimo+erlang-patches@REDACTED (Raimo Niskanen) Date: Thu, 24 Nov 2011 18:07:46 +0100 Subject: [erlang-patches] Tiny patch to inet_drv.c for Solaris Open Indiana and Illumos In-Reply-To: References: <9923.1322091448@snookles.snookles.com> Message-ID: <20111124170746.GA3895@erix.ericsson.se> On Thu, Nov 24, 2011 at 08:44:18AM +0100, Trond Norbye wrote: > It should no longer be needed after they reapplied my patch to use > libdlpi to retrieve the mac address. (I just built everything on > Solaris 11, and it detects everything correctly out of the box). > > At least on my OpenIndiana box (and I would guess other clones as > well) libdlpi needs libdladm.so.1 which is installed in /lib, and > libdlpi.so doesn't include an rpath to automatically detect it. That > means that you'd need to add: LDFLAGS="-L/lib -R/lib" for it to > successfully detect the availability of the library. I am again looking at that patch of yours, and I think you will need to review my changes it... I have three problems: 1. On my machine (the only I found with libdlpi (we have not installed an OpenIndiana box yet)) there is no /lib/libdlpi.so and /lib/64/libdlpi.so symlinks to the corresponding *.so.1 files so the linking always fails. I suspect it is an installation issue so I did the symlinks by hand. $ uname -a SunOS fenris 5.10 Generic_142909-17 sun4u sparc SUNW,Sun-Fire-V245 Does this seem reasonable? 2. You are right about gcc. It passes an -Y P,/usr/ccs/lib flag to /usr/ccs/bin/ld which resets the by crle configured default path. I must however augument your patch to give -L/lib/64 -R/lib/64 to LDFLAGS for a 64-bit build. Does this seem reasonable? 3. When I run it does not succeed in finding the hwaddr. Truss shows this: 4146/6: so_socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP, "", SOV_XPG4_2) = 7 4146/6: fcntl(7, F_GETFL) = 2 4146/6: fcntl(7, F_SETFL, FWRITE|FNONBLOCK) = 0 4146/6: setsockopt(7, SOL_SOCKET, SO_RCVBUF, 0xFEAF9C2C, 4, SOV_DEFAULT) = 0 4146/6: bind(7, 0xFEAFA020, 16, SOV_XPG4_2) = 0 4146/6: getsockname(7, 0xFEAFA020, 0xFEAFAC00, SOV_DEFAULT) = 0 4146/6: open("/dev/bge0", O_RDWR) Err#13 EACCES [net_rawaccess] 4146/6: open("/devices/pseudo/clone@REDACTED:bge0", O_RDWR) Err#2 ENOENT 4146/6: open("/dev/bge", O_RDWR) Err#13 EACCES [net_rawaccess] 4146/6: open("/devices/pseudo/clone@REDACTED:bge", O_RDWR) Err#13 EACCES [net_rawaccess] Is there some nasty configuration I have missed to do? This run was without the -R flag but that should have given worse errors. Right? > inet:getif("bge0", [hwaddr]). {ok,[]} Right now the diff is this awkward (against your patch merged to master with a small conflict resolved): ------------------------------ erts/configure.in ------------------------------ index 992df94..d8d15ad 100644 @@ -1482,6 +1482,34 @@ AC_CHECK_HEADERS(fcntl.h limits.h unistd.h syslog.h dlfcn.h ieeefp.h \ net/errno.h malloc.h arpa/nameser.h libdlpi.h \ pty.h util.h utmp.h langinfo.h poll.h sdkddkver.h) +AC_CHECK_MEMBERS([struct ifreq.ifr_hwaddr]) + +dnl ---------------------------------------------------------------------- +dnl Check the availability for libdlpi +dnl ---------------------------------------------------------------------- +AC_CHECK_LIB(dlpi, dlpi_open) +if test $ac_cv_lib_dlpi_dlpi_open = no; then + dnl Try again now with -L/lib (or ditto 64) as argument to linker since + dnl gcc makes ld ignore the crle configured linker default paths + save_ldflags="$LDFLAGS" + if test "x$ac_cv_sizeof_void_p" = "x8"; then + if test -d "/lib64"; then + LDFLAGS="-L/lib64 -R/lib64 $LDFLAGS" + elif test -d "/lib/64"; then + LDFLAGS="-L/lib/64 -R/lib/64 $LDFLAGS" + else + LDFLAGS="-L/lib -R/lib $LDFLAGS" + fi + else + LDFLAGS="-L/lib -R/lib $LDFLAGS" + fi + unset -v ac_cv_lib_dlpi_dlpi_open + AC_CHECK_LIB(dlpi, dlpi_open) + if test $ac_cv_lib_dlpi_dlpi_open = no; then + LDFLAGS="$save_ldflags" + fi +fi + AC_CHECK_HEADER(sys/resource.h, [AC_DEFINE(HAVE_SYS_RESOURCE_H, 1, [Define to 1 if you have the header file]) @@ -4304,11 +4332,6 @@ AH_BOTTOM([ ]) dnl ---------------------------------------------------------------------- -dnl Check the availability for libdlpi -dnl ---------------------------------------------------------------------- -AC_CHECK_LIB(dlpi, dlpi_open) - -dnl ---------------------------------------------------------------------- dnl Output the result. dnl ---------------------------------------------------------------------- ------------------- erts/emulator/drivers/common/inet_drv.c ------------------- index 4550065..9dbe661 100644 @@ -4301,7 +4301,7 @@ static int inet_ctl_ifget(inet_descriptor* desc, char* buf, int len, sptr += alen; } } -#elif defined(SIOCGIFHWADDR) +#elif defined(SIOCGIFHWADDR) && defined(HAVE_STRUCT_IFREQ_IFR_HWADDR) if (ioctl(desc->s, SIOCGIFHWADDR, (char *)&ifreq) < 0) break; buf_check(sptr, s_end, 1+2+IFHWADDRLEN); / Raimo > > Trond > > On Thu, Nov 24, 2011 at 12:37 AM, Scott Lystig Fritchie > wrote: > > Hi, all. ?I got a GitHub pull request several days ago for a tiny patch > > to inet_drv.c. > > > > ? ?https://github.com/slfritchie/otp/pull/3 > > > > I haven't seen anything on this list mentioning this small patch, so I > > thought I'd submit it on behalf of the original author. ?(He hasn't > > replied to my comment on the GitHub pull request, either.) > > > > Vladimir says that the patch is necessary for Solaris Illumos. ?I can > > confirm that it's necessary for Solaris Open Indiana build 151a, also. > > I haven't bootstrapped my development environment yet for Solaris 11 to > > know if it's required there, also. > > > > The 1-line patch is here: > > > > ? ?https://github.com/proger/otp/commit/f40294921d5862add77fd77851beb2785b026306` > > ? ?https://github.com/proger/otp/commit/f40294921d5862add77fd77851beb2785b026306.patch > > > > -Scott > > _______________________________________________ > > erlang-patches mailing list > > erlang-patches@REDACTED > > http://erlang.org/mailman/listinfo/erlang-patches > > > > > > -- > Trond Norbye > _______________________________________________ > erlang-patches mailing list > erlang-patches@REDACTED > http://erlang.org/mailman/listinfo/erlang-patches -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From trond.norbye@REDACTED Fri Nov 25 07:15:20 2011 From: trond.norbye@REDACTED (Trond Norbye) Date: Fri, 25 Nov 2011 07:15:20 +0100 Subject: [erlang-patches] Tiny patch to inet_drv.c for Solaris Open Indiana and Illumos In-Reply-To: <20111124170746.GA3895@erix.ericsson.se> References: <9923.1322091448@snookles.snookles.com> <20111124170746.GA3895@erix.ericsson.se> Message-ID: On Thu, Nov 24, 2011 at 6:07 PM, Raimo Niskanen wrote: > > I have three problems: > 1. On my machine (the only I found with libdlpi (we have not installed > ?an OpenIndiana box yet)) there is no /lib/libdlpi.so and > ?/lib/64/libdlpi.so symlinks to the corresponding *.so.1 files > ?so the linking always fails. I suspect it is an installation issue > ?so I did the symlinks by hand. > ? ?$ uname -a > ? ?SunOS fenris 5.10 Generic_142909-17 sun4u sparc SUNW,Sun-Fire-V245 > ?Does this seem reasonable? Yes, I just looked at my Solaris 10 box, and it is missing the link from: libdlpi.so -> libdlpi.so.1, so one needs to manually create that until Sun^H^H^HOracle fix that. (I guess I could add a test for this in configure and notify the user if this is the case..) > 2. You are right about gcc. It passes an -Y P,/usr/ccs/lib flag to > ?/usr/ccs/bin/ld which resets the by crle configured default path. > ?I must however augument your patch to give -L/lib/64 -R/lib/64 to > ?LDFLAGS for a 64-bit build. Does this seem reasonable? Yes, for 64-bit builds one would need to search /lib/64 instad of /lib. > 3. When I run it does not succeed in finding the hwaddr. Truss shows this: > ?4146/6: ? ? ? ? so_socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP, "", SOV_XPG4_2) = 7 > ?4146/6: ? ? ? ? fcntl(7, F_GETFL) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? = 2 > ?4146/6: ? ? ? ? fcntl(7, F_SETFL, FWRITE|FNONBLOCK) ? ? ? ? ? ? = 0 > ?4146/6: ? ? ? ? setsockopt(7, SOL_SOCKET, SO_RCVBUF, 0xFEAF9C2C, 4, SOV_DEFAULT) = 0 > ?4146/6: ? ? ? ? bind(7, 0xFEAFA020, 16, SOV_XPG4_2) ? ? ? ? ? ? = 0 > ?4146/6: ? ? ? ? getsockname(7, 0xFEAFA020, 0xFEAFAC00, SOV_DEFAULT) = 0 > ?4146/6: ? ? ? ? open("/dev/bge0", O_RDWR) ? ? ? ? ? ? ? ? ? ? ? Err#13 EACCES [net_rawaccess] > ?4146/6: ? ? ? ? open("/devices/pseudo/clone@REDACTED:bge0", O_RDWR) ? ?Err#2 ENOENT > ?4146/6: ? ? ? ? open("/dev/bge", O_RDWR) ? ? ? ? ? ? ? ? ? ? ? ?Err#13 EACCES [net_rawaccess] > ?4146/6: ? ? ? ? open("/devices/pseudo/clone@REDACTED:bge", O_RDWR) ? ? Err#13 EACCES [net_rawaccess] > ?Is there some nasty configuration I have missed to do? Obtaining the mac address is considered a "privileged" operation as I pointed out in my original email. You can verify this by running: ifconfig -a as a normal user, and then as a privileged user. The normal user will only see: bge0: flags=2004841 mtu 1500 index 2 inet6 fe80::203:baff:fec8:b13d/10 whereas the privileged shell will give you: bge0: flags=2004841 mtu 1500 index 2 inet6 fe80::203:baff:fec8:b13d/10 ether 0:3:ba:c8:b1:3d Your truss output also points out that you don't have access (missing net_rawaccess). Try adding the privilege to beam and see what happens pfexec ppriv -s EIP+net_rawaccess > ?This run was without the -R flag but that should have given worse errors. Right? > ?> inet:getif("bge0", [hwaddr]). > ?{ok,[]} > > Right now the diff is this awkward (against your patch merged to master > with a small conflict resolved): > ------------------------------ erts/configure.in ------------------------------ > index 992df94..d8d15ad 100644 > @@ -1482,6 +1482,34 @@ AC_CHECK_HEADERS(fcntl.h limits.h unistd.h syslog.h dlfcn.h ieeefp.h \ > ? ? ? ? ? ? ? ? ?net/errno.h malloc.h arpa/nameser.h libdlpi.h \ > ? ? ? ? ? ? ? ? pty.h util.h utmp.h langinfo.h poll.h sdkddkver.h) > > +AC_CHECK_MEMBERS([struct ifreq.ifr_hwaddr]) > + > +dnl ---------------------------------------------------------------------- > +dnl Check the availability for libdlpi > +dnl ---------------------------------------------------------------------- > +AC_CHECK_LIB(dlpi, dlpi_open) > +if test $ac_cv_lib_dlpi_dlpi_open = no; then > + ? dnl Try again now with -L/lib (or ditto 64) as argument to linker since > + ? dnl gcc makes ld ignore the crle configured linker default paths > + ? save_ldflags="$LDFLAGS" > + ? if test "x$ac_cv_sizeof_void_p" = "x8"; then > + ? ? ?if test -d "/lib64"; then > + ? ? ? ? LDFLAGS="-L/lib64 -R/lib64 $LDFLAGS" > + ? ? ?elif test -d "/lib/64"; then > + ? ? ? ? LDFLAGS="-L/lib/64 -R/lib/64 $LDFLAGS" > + ? ? ?else > + ? ? ? ? LDFLAGS="-L/lib -R/lib $LDFLAGS" > + ? ? ?fi > + ? else > + ? ? ?LDFLAGS="-L/lib -R/lib $LDFLAGS" > + ? fi > + ? unset -v ac_cv_lib_dlpi_dlpi_open > + ? AC_CHECK_LIB(dlpi, dlpi_open) > + ? if test $ac_cv_lib_dlpi_dlpi_open = no; then > + ? ? ?LDFLAGS="$save_ldflags" > + ? fi > +fi I rewrote that block to a bit more "autoconf" like way and added a test for the missing symbolic links: AS_IF([test $ac_cv_lib_dlpi_dlpi_open = no ], [ dnl Try again now with -L/lib (or ditto 64) as argument to linker since dnl gcc makes ld ignore the crle configured linker default paths save_ldflags="$LDFLAGS" AS_IF([test "x$ac_cv_sizeof_void_p" = "x8"], [ AS_IF([ test -d "/lib64" ], [ LDFLAGS="-L/lib64 -R/lib64 $LDFLAGS"], [ AS_IF([test -d "/lib/64"], [ dnl It looks like solaris 10 is missing some dnl links.. let be helpful and notify the dnl user if that's the case AS_IF([test -f /lib/64/libdlpi.so.1 -a ! -h /lib/64/libdlpi.so], [AC_MSG_ERROR( [Your Solaris installation is missing a symbolic link. Please execute the following command: # ln -s libdlpi.so.1 /lib/64/libdlpi.so ])]) LDFLAGS="-L/lib/64 -R/lib/64 $LDFLAGS"], [ LDFLAGS="-L/lib -R/lib $LDFLAGS"])]) ], [ AS_IF([test -f /lib/libdlpi.so.1 -a ! -h /lib/libdlpi.so], [AC_MSG_ERROR([ Your Solaris installation is missing a symbolic link. Please execute the following command: # ln -s libdlpi.so.1 /lib/libdlpi.so ])]) LDFLAGS="-L/lib -R/lib $LDFLAGS" ]) unset -v ac_cv_lib_dlpi_dlpi_open AC_MSG_NOTICE([Extend the search to include /lib]) AC_CHECK_LIB(dlpi, dlpi_open) AS_IF([test $ac_cv_lib_dlpi_dlpi_open = no], [ LDFLAGS="$save_ldflags" ]) ]) Cheers, Trond From dave@REDACTED Fri Nov 25 10:06:50 2011 From: dave@REDACTED (Dave Cottlehuber) Date: Fri, 25 Nov 2011 10:06:50 +0100 Subject: [erlang-patches] [erlang-questions] A potential fix for escript on Windows In-Reply-To: References: Message-ID: Hi EP, escript currently only supports being started as "escript.exe" from the Windows command shell. The far more common "escript" which when called directly from the Windows cmd.exe shell does not parse the remaining arguments correctly. For comparison, you'd not type in "dir.exe" on Windows much. I've also hit the same issue as Pierre whilst using rebar on Windows, and he's agreed to allow me to submit his straightforward patch, now against the R15A master branch, to support both styles: git fetch git://github.com/dch/otp.git dch-fix-win32-escript https://github.com/dch/otp/compare/dch-fix-win32-escript https://github.com/dch/otp/compare/dch-fix-win32-escript.patch Thanks Dave On 5 June 2011 00:33, Pierre Rouleau wrote: > OK, I think I know why escript is not accepting scrips unless it's invoked > as escript.exe. > I took a look at erts/etc/common/escript.c which I?believe?is the source for > escript. > I think one of the problem under Windows is the fact that when ?escript's > main() is looking for the escript basename, it does not consider that, under > Windows, it could very well be escript (just as much as escript.exe). ?If > the invocation line is "escript the_scrip_file.erl arguments", then escript > thinks the argv[0] is the name of the script (instead of escript executable) > and appends ".escript" to it. > One way to solve this problem under Windows, from what I can tell so far, > would be to check for escript.exe as well as escript under Windows, as the > following patch to escript does (from the R14B03 source taken at > erlang.org): > > @@ -377,7 +377,8 @@ > ? ? ?last_opt = argv; > > ?#ifdef __WIN32__ > - ? ?if (_stricmp(basename, "escript.exe") == 0) { > + ? ?if ( (_stricmp(basename, "escript.exe") == 0) > + ? ? ? ||(_stricmp(basename, "escript") == 0)) { > ?#else > ? ? ?if (strcmp(basename, "escript") == 0) { > ?#endif > > I have not yet tested that patch (I am still downloading Cygwin's > development package to be able to build Erlang from source on the Windows > box). > If I get it working, should I (and where should I) submit a patch to > escript.c? > Also, is there a bug tracker for Erlang where one can browse through bug > reports, submit one and identify patches or is everything done through the > mailing lists? ?I did not see links to a bug tracker in the erlang.org site > except for a mention about submitting patches via github. > And finally, is there a documented process for development? > Thanks > -- Pierre Rouleau > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > From raimo+erlang-patches@REDACTED Fri Nov 25 15:00:56 2011 From: raimo+erlang-patches@REDACTED (Raimo Niskanen) Date: Fri, 25 Nov 2011 15:00:56 +0100 Subject: [erlang-patches] Tiny patch to inet_drv.c for Solaris Open Indiana and Illumos In-Reply-To: References: <9923.1322091448@snookles.snookles.com> <20111124170746.GA3895@erix.ericsson.se> Message-ID: <20111125140056.GA19467@erix.ericsson.se> On Fri, Nov 25, 2011 at 07:15:20AM +0100, Trond Norbye wrote: > On Thu, Nov 24, 2011 at 6:07 PM, Raimo Niskanen > wrote: > > > > I have three problems: > > 1. On my machine (the only I found with libdlpi (we have not installed > > ?an OpenIndiana box yet)) there is no /lib/libdlpi.so and > > ?/lib/64/libdlpi.so symlinks to the corresponding *.so.1 files > > ?so the linking always fails. I suspect it is an installation issue > > ?so I did the symlinks by hand. > > ? ?$ uname -a > > ? ?SunOS fenris 5.10 Generic_142909-17 sun4u sparc SUNW,Sun-Fire-V245 > > ?Does this seem reasonable? > > Yes, I just looked at my Solaris 10 box, and it is missing the link > from: libdlpi.so -> libdlpi.so.1, so one needs to manually create that > until Sun^H^H^HOracle fix that. (I guess I could add a test for this > in configure and notify the user if this is the case..) A theory was suggested here and that is that the *.so.* files satisfy runtime dependencies and the *.so files are needed for linking against, so there might be some in the Linux world know as *-devel package(s) missing. : > > 3. When I run it does not succeed in finding the hwaddr. Truss shows this: > > ?4146/6: ? ? ? ? so_socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP, "", SOV_XPG4_2) = 7 > > ?4146/6: ? ? ? ? fcntl(7, F_GETFL) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? = 2 > > ?4146/6: ? ? ? ? fcntl(7, F_SETFL, FWRITE|FNONBLOCK) ? ? ? ? ? ? = 0 > > ?4146/6: ? ? ? ? setsockopt(7, SOL_SOCKET, SO_RCVBUF, 0xFEAF9C2C, 4, SOV_DEFAULT) = 0 > > ?4146/6: ? ? ? ? bind(7, 0xFEAFA020, 16, SOV_XPG4_2) ? ? ? ? ? ? = 0 > > ?4146/6: ? ? ? ? getsockname(7, 0xFEAFA020, 0xFEAFAC00, SOV_DEFAULT) = 0 > > ?4146/6: ? ? ? ? open("/dev/bge0", O_RDWR) ? ? ? ? ? ? ? ? ? ? ? Err#13 EACCES [net_rawaccess] > > ?4146/6: ? ? ? ? open("/devices/pseudo/clone@REDACTED:bge0", O_RDWR) ? ?Err#2 ENOENT > > ?4146/6: ? ? ? ? open("/dev/bge", O_RDWR) ? ? ? ? ? ? ? ? ? ? ? ?Err#13 EACCES [net_rawaccess] > > ?4146/6: ? ? ? ? open("/devices/pseudo/clone@REDACTED:bge", O_RDWR) ? ? Err#13 EACCES [net_rawaccess] > > ?Is there some nasty configuration I have missed to do? > > Obtaining the mac address is considered a "privileged" operation as I > pointed out in my original email. You can verify this by running: > ifconfig -a as a normal user, and then as a privileged user. The > normal user will only see: > > bge0: flags=2004841 mtu 1500 index 2 > inet6 fe80::203:baff:fec8:b13d/10 > > whereas the privileged shell will give you: > bge0: flags=2004841 mtu 1500 index 2 > inet6 fe80::203:baff:fec8:b13d/10 > ether 0:3:ba:c8:b1:3d > > Your truss output also points out that you don't have access (missing > net_rawaccess). Try adding the privilege to beam and see what happens Sorry I did not go back and read your original email this time... This is an old privilege property of Solaris making it hard for our daily builds and tests. > > pfexec ppriv -s EIP+net_rawaccess Excellent! That works like a charm. : > > I rewrote that block to a bit more "autoconf" like way and added a > test for the missing symbolic links: > > AS_IF([test $ac_cv_lib_dlpi_dlpi_open = no ], > [ dnl Try again now with -L/lib (or ditto 64) as argument to linker since > dnl gcc makes ld ignore the crle configured linker default paths > save_ldflags="$LDFLAGS" > AS_IF([test "x$ac_cv_sizeof_void_p" = "x8"], > [ > AS_IF([ test -d "/lib64" ], > [ LDFLAGS="-L/lib64 -R/lib64 $LDFLAGS"], > [ AS_IF([test -d "/lib/64"], > [ dnl It looks like solaris 10 is missing some > dnl links.. let be helpful and notify the > dnl user if that's the case > AS_IF([test -f /lib/64/libdlpi.so.1 > -a ! -h /lib/64/libdlpi.so], > [AC_MSG_ERROR( > [Your Solaris installation is missing a symbolic link. Please execute > the following command: > # ln -s libdlpi.so.1 /lib/64/libdlpi.so > ])]) > LDFLAGS="-L/lib/64 -R/lib/64 $LDFLAGS"], > [ LDFLAGS="-L/lib -R/lib $LDFLAGS"])]) > ], [ > AS_IF([test -f /lib/libdlpi.so.1 -a ! -h /lib/libdlpi.so], > [AC_MSG_ERROR([ > Your Solaris installation is missing a symbolic link. Please execute > the following command: > # ln -s libdlpi.so.1 /lib/libdlpi.so > ])]) > LDFLAGS="-L/lib -R/lib $LDFLAGS" > ]) > unset -v ac_cv_lib_dlpi_dlpi_open > AC_MSG_NOTICE([Extend the search to include /lib]) > AC_CHECK_LIB(dlpi, dlpi_open) > AS_IF([test $ac_cv_lib_dlpi_dlpi_open = no], > [ LDFLAGS="$save_ldflags" ]) > ]) Nice, but our minimal autoconf version is 2.59 and I can not find the AS_* macros in that documentation, so it will have to be the old fashion way... Here it is again reworked with your additions above: AC_CHECK_LIB(dlpi, dlpi_open) if test $ac_cv_lib_dlpi_dlpi_open = no; then unset -v ac_cv_lib_dlpi_dlpi_open dnl Try again now with -L/lib (or ditto 64) as argument to linker since dnl gcc makes /usr/ccs/bin/ld ignore the crle configured linker default paths dnl typically causing dlpi not being found on Solaris et.al save_ldflags="$LDFLAGS" try_dlpi_lib=/lib if test "x$ac_cv_sizeof_void_p" = "x8"; then if test -d /lib64; then try_dlpi_lib=/lib64 elif test -d /lib/64; then try_dlpi_lib=/lib/64 fi fi if test ! -f $try_dlpi_lib/libdlpi.so && test -f $try_dlpi_lib/libdlpi.so.1; then dnl It looks like there is a missing symlink dnl - let's be helpful and notify the user dnl NOTE this help is far from perfect e.g if there would be no dnl *.so.1 but a *.so.1.123 or *.so.2 this will be no help AC_MSG_ERROR( [Your OS installation is missing a symbolic link. Maybe it lacks some development package(s)... It can anyhow be fixed with the following command: # ln -s libdlpi.so.1 $try_dlpi_lib/libdlpi.so ]) fi LDFLAGS="-L$try_dlpi_lib -R$try_dlpi_lib $LDFLAGS" unset -v try_dlpi_lib AC_MSG_NOTICE([Extending the search to include /lib]) AC_CHECK_LIB(dlpi, dlpi_open) if test $ac_cv_lib_dlpi_dlpi_open = no; then LDFLAGS="$save_ldflags" fi unset -v save_ldflags fi > > > Cheers, > > Trond > _______________________________________________ > erlang-patches mailing list > erlang-patches@REDACTED > http://erlang.org/mailman/listinfo/erlang-patches -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From vinoski@REDACTED Fri Nov 25 23:08:53 2011 From: vinoski@REDACTED (Steve Vinoski) Date: Fri, 25 Nov 2011 17:08:53 -0500 Subject: [erlang-patches] fix for OTP-9389 "Allow longer lines in http packet protocol with gen_tcp" Message-ID: git fetch git://github.com/vinoski/otp.git sv-OTP-9389 You can see the diffs here: https://github.com/vinoski/otp/commit/7a923ed4b89db4ebce31dedd83cb156907196598 This patch fixes OTP-9389 by allowing an application to set packet_size to control the length of HTTP header lines it's willing to accept. Without this fix, applications trying to receive long HTTP header lines get unexpected errors, as described in this erlang-questions thread: http://erlang.org/pipermail/erlang-questions/2011-June/059563.html This patch leaves the original default behavior in place, so as not to break backward compatibility. With this change, if an app sets packet_size while in http, httph, http_bin, or httph_bin packet parsing mode, and an HTTP header line is received that exceeds the default TCP buffer size (1460 bytes), the packet parser tells the TCP code to realloc the buffer to a larger size to receive the longer header line. As long as the line in question does not exceed the packet_size setting, it will be received and parsed properly. If it's too long, the caller gets an error. Note that realloc occurs only when needed. Also fix the http parsing code to honor line_length, which is documented under erlang:decode_packet but was not fully implemented. Also add support for packet_size for line parsing mode, for consistency. Add regression tests. You can read more details in the commit message. Many thanks to Sverker Eriksson for his guidance on creating this patch and for reviewing several patch attempts prior to this one. --steve From fritchie@REDACTED Fri Nov 25 23:42:53 2011 From: fritchie@REDACTED (Scott Lystig Fritchie) Date: Fri, 25 Nov 2011 16:42:53 -0600 Subject: [erlang-patches] erlang-patches Digest, Vol 35, Issue 3 In-Reply-To: Message of "Wed, 23 Nov 2011 11:51:22 +0100." Message-ID: <201111252242.pAPMgrir005785@snookles.snookles.com> erlang-patches-request@REDACTED wrote: b-ed> OTP-9632 An ERTS internal, generic, many to one, lock-free queue b-ed> for communication between threads has been introduced. The many to b-ed> one scenario is very common in ERTS, so it can be used in a lot of b-ed> places in the future. Currently it is used by scheduling of b-ed> certain jobs, and the async thread pool, but more uses are planned b-ed> for the future. Hi, Bj?rn-Egil, I noticed that new data structure created a conflict with my DTrace patches. The conflict was easy to fix, but there was something in the old data structure that seems missing from the new one: a count of the queue size. With my limited squinting at the new structure, what would be required to make the queue length available? It'd be very nice if DTrace probes could report the length of the queue when enqueueing/dequeueing. Knowing the queue length is easy in R14B04 but seems difficult with the new data structure. -Scott From wallentin.dahlberg@REDACTED Sat Nov 26 02:58:17 2011 From: wallentin.dahlberg@REDACTED (=?ISO-8859-1?Q?Bj=F6rn=2DEgil_Dahlberg?=) Date: Sat, 26 Nov 2011 02:58:17 +0100 Subject: [erlang-patches] erlang-patches Digest, Vol 35, Issue 3 In-Reply-To: <201111252242.pAPMgrir005785@snookles.snookles.com> References: <201111252242.pAPMgrir005785@snookles.snookles.com> Message-ID: 2011/11/25 Scott Lystig Fritchie > erlang-patches-request@REDACTED wrote: > > > a count of the queue size. > > With my limited squinting at the new structure, what would be required to > make the queue length available? It'd be very nice if DTrace probes could > report the length of the queue when enqueueing/dequeueing. Knowing the > queue length is easy in R14B04 but seems difficult with the new data > structure. I think that in order not to impact the performance of the lock free queue we cannot keep an updated record of the queue length around. Another queue function could be implemented to count the length of queue when needed. An O(n) operation. Nothing planned as of yet and probably not for R15B, but I mentioned this to Richard Green so he will keep it in mind. // Bj?rn-Egil -------------- next part -------------- An HTML attachment was scrubbed... URL: From fritchie@REDACTED Sat Nov 26 03:39:26 2011 From: fritchie@REDACTED (Scott Lystig Fritchie) Date: Fri, 25 Nov 2011 20:39:26 -0600 Subject: [erlang-patches] erlang-patches Digest, Vol 35, Issue 3 In-Reply-To: Message of "Sat\, 26 Nov 2011 02\:58\:17 +0100." Message-ID: <21451.1322275166@snookles.snookles.com> Bj?rn-Egil Dahlberg wrote: b-ed> I think that in order not to impact the performance of the lock b-ed> free queue we cannot keep an updated record of the queue length b-ed> around. Another queue function could be implemented to count the b-ed> length of queue when needed. An O(n) operation. That's what I was afraid of. Something O(n) definitely wouldn't be suitable for DTrace's purposes, e.g. trying to answer the question(*), "what's the longest size of an async work queue in the last N seconds?" Well, the R14B04 flavor of my DTrace patches is able to get the queue length in O(1) time, so I guess that'll stay for now ... and create a Christmas wish list item for the R-sooner-than-19 release. -Scott (*) Given the VM's mapping of file path -> async worker thread, and given that typically work on file I/O-heavy applications, it would be really nice to know how often high file I/O latencies are due to the bad luck that many simultaneous file I/O operations for different paths simply happened to all map to the same async worker thread. From fritchie@REDACTED Sun Nov 27 09:10:10 2011 From: fritchie@REDACTED (Scott Lystig Fritchie) Date: Sun, 27 Nov 2011 02:10:10 -0600 Subject: [erlang-patches] DTrace patch, review draft 3, 27 Nov revision In-Reply-To: Message of "Thu, 24 Nov 2011 18:15:19 +0100." <4ECE7BA7.9040605@erlang.org> Message-ID: <41311.1322381410@snookles.snookles.com> Hej, hi, I've got another draft of the DTrace review patch. It's still on the same repo (git://github.com/slfritchie/otp) and same branch (dtrace-review3). The old head for the previous version of the dtrace-review patch was 4242b9c0eca65b767eabcc192d980fa3754d5b33. The new head for that branch is 2913fb96db4ab35776bd4c11afd82b494f554689. I hope that I've covered all of the review comments since the last draft. The exceptions are related to comments about adding overhead to the prim_file.erl<->efile_drv.c driver protocol and adding extra data/vars/struct members of various parts of efile_drv.c: I've done nothing, pending replies to my replies late last week. Using "git diff 4242b9c0eca65b767eabcc192d980fa3754d5b33..dtrace-review3" ought to show what's changed between the last draft and the new forced push. I've reviewed each of the 3 email messages & their requested changes, compared them to the diff, and all seem to be addressed. (Except for the exceptions noted above.) I hope the barley beer isn't interfering too much with the review. :-) I'm not 100% certain if I've managed to address all of the set-but-unused variables that were initially commented up: I made a single pass after looking at some GCC 4.5 output, adding ERTS_DECLARE_DUMMY() macros at various places, but I don't know if I found 100% of the ones that the DTrace code touches. There are many more for code that I haven't modified, so I left them alone. I hope I've fixed all of the Windows problems. If not, please yell at me ASAP with the bitter details. There is one problem that I'm aware of at the moment: on my Solaris 10 box, attempts to use the following when DTrace is enabled: ok = dtrace:init(). dtrace:p(42). ... will cause a core dump. There's some problem with the linker that I don't understand yet. This branch is full of so many changes, and the code freeze is coming soon, that I'll try to investigate this problem on Sunday 27 November and see what I can see. -Scott From aronisstav@REDACTED Mon Nov 28 11:30:47 2011 From: aronisstav@REDACTED (Stavros Aronis) Date: Mon, 28 Nov 2011 11:30:47 +0100 Subject: [erlang-patches] Dialyzer fixes Message-ID: Suppression of some function underspecification-related warnings, small fixes in Dialyzer and HiPE, repair broken typer and update of test suite results: git fetch git://github.com/aronisstav/otp.git dialyzer-fixes Stavros -------------- next part -------------- An HTML attachment was scrubbed... URL: From henrik@REDACTED Mon Nov 28 12:19:01 2011 From: henrik@REDACTED (Henrik Nord) Date: Mon, 28 Nov 2011 12:19:01 +0100 Subject: [erlang-patches] DTrace patch, review draft 3, 27 Nov revision In-Reply-To: <41311.1322381410@snookles.snookles.com> References: <41311.1322381410@snookles.snookles.com> Message-ID: <4ED36E25.5020908@erlang.org> On 11/27/2011 09:10 AM, Scott Lystig Fritchie wrote: > Hej, hi, I've got another draft of the DTrace review patch. It's still > on the same repo (git://github.com/slfritchie/otp) and same branch > (dtrace-review3). > > The old head for the previous version of the dtrace-review patch was > 4242b9c0eca65b767eabcc192d980fa3754d5b33. The new head for that branch > is 2913fb96db4ab35776bd4c11afd82b494f554689. > > I hope that I've covered all of the review comments since the last > draft. The exceptions are related to comments about adding overhead to > the prim_file.erl<->efile_drv.c driver protocol and adding extra > data/vars/struct members of various parts of efile_drv.c: I've done > nothing, pending replies to my replies late last week. > > Using "git diff 4242b9c0eca65b767eabcc192d980fa3754d5b33..dtrace-review3" > ought to show what's changed between the last draft and the new forced > push. I've reviewed each of the 3 email messages& their requested > changes, compared them to the diff, and all seem to be addressed. > (Except for the exceptions noted above.) I hope the barley beer isn't > interfering too much with the review. :-) > > I'm not 100% certain if I've managed to address all of the > set-but-unused variables that were initially commented up: I made a > single pass after looking at some GCC 4.5 output, adding > ERTS_DECLARE_DUMMY() macros at various places, but I don't know if I > found 100% of the ones that the DTrace code touches. There are many > more for code that I haven't modified, so I left them alone. > > I hope I've fixed all of the Windows problems. If not, please yell at > me ASAP with the bitter details. > > There is one problem that I'm aware of at the moment: on my Solaris 10 > box, attempts to use the following when DTrace is enabled: > > ok = dtrace:init(). > dtrace:p(42). > > ... will cause a core dump. There's some problem with the linker that I > don't understand yet. This branch is full of so many changes, and the > code freeze is coming soon, that I'll try to investigate this problem on > Sunday 27 November and see what I can see. > > -Scott > _______________________________________________ > erlang-patches mailing list > erlang-patches@REDACTED > http://erlang.org/mailman/listinfo/erlang-patches I will get the new version cooking here in 'pu'. -- /Henrik Nord Erlang/OTP From henrik@REDACTED Mon Nov 28 15:59:55 2011 From: henrik@REDACTED (Henrik Nord) Date: Mon, 28 Nov 2011 15:59:55 +0100 Subject: [erlang-patches] fix for OTP-9389 "Allow longer lines in http packet protocol with gen_tcp" In-Reply-To: References: Message-ID: <4ED3A1EB.2040502@erlang.org> On 11/25/2011 11:08 PM, Steve Vinoski wrote: > git fetch git://github.com/vinoski/otp.git sv-OTP-9389 > > You can see the diffs here: > > https://github.com/vinoski/otp/commit/7a923ed4b89db4ebce31dedd83cb156907196598 > > This patch fixes OTP-9389 by allowing an application to set > packet_size to control the length of HTTP header lines it's willing to > accept. Without this fix, applications trying to receive long HTTP > header lines get unexpected errors, as described in this > erlang-questions thread: > > http://erlang.org/pipermail/erlang-questions/2011-June/059563.html > > This patch leaves the original default behavior in place, so as not to > break backward compatibility. With this change, if an app sets > packet_size while in http, httph, http_bin, or httph_bin packet > parsing mode, and an HTTP header line is received that exceeds the > default TCP buffer size (1460 bytes), the packet parser tells the TCP > code to realloc the buffer to a larger size to receive the longer > header line. As long as the line in question does not exceed the > packet_size setting, it will be received and parsed properly. If it's > too long, the caller gets an error. Note that realloc occurs only when > needed. > > Also fix the http parsing code to honor line_length, which is > documented under erlang:decode_packet but was not fully implemented. > > Also add support for packet_size for line parsing mode, for consistency. > > Add regression tests. > > You can read more details in the commit message. > > Many thanks to Sverker Eriksson for his guidance on creating this > patch and for reviewing several patch attempts prior to this one. > > --steve > _______________________________________________ > erlang-patches mailing list > erlang-patches@REDACTED > http://erlang.org/mailman/listinfo/erlang-patches Thank you for the contribution! I have included this in 'pu', and sofar no issues -- /Henrik Nord Erlang/OTP From henrik@REDACTED Mon Nov 28 16:37:56 2011 From: henrik@REDACTED (Henrik Nord) Date: Mon, 28 Nov 2011 16:37:56 +0100 Subject: [erlang-patches] Dialyzer fixes In-Reply-To: References: Message-ID: <4ED3AAD4.7050707@erlang.org> On 11/28/2011 11:30 AM, Stavros Aronis wrote: > Suppression of some function underspecification-related warnings, > small fixes in Dialyzer and HiPE, repair broken typer and update of > test suite results: > > git fetch git://github.com/aronisstav/otp.git > dialyzer-fixes > > Stavros > > > _______________________________________________ > erlang-patches mailing list > erlang-patches@REDACTED > http://erlang.org/mailman/listinfo/erlang-patches Hi Stavros. Your patch is included in 'pu', and we aim for it to be in R15 -- /Henrik Nord Erlang/OTP -------------- next part -------------- An HTML attachment was scrubbed... URL: From bgustavsson@REDACTED Mon Nov 28 16:43:02 2011 From: bgustavsson@REDACTED (=?UTF-8?Q?Bj=C3=B6rn_Gustavsson?=) Date: Mon, 28 Nov 2011 16:43:02 +0100 Subject: [erlang-patches] [PATCH] erts: remove variable processes_busy In-Reply-To: References: Message-ID: On 11/13/11, Jovi Zhang wrote: > How about this patch? > > On Wed, Nov 9, 2011 at 5:04 PM, Jovi Zhang wrote: > >> >> variable processes_busy is not used in current code, it don't have >> any meaning still stay on there, so remove it. >> >> Git Tree: git pull git://github.com/bookjovi/otp.git >> Patch Review: * * >> https://github.com/bookjovi/otp/commit/d428f18f1d03c133e2b59053978509bfae4d2c8c >> Thanks for noticing the useless variable. However, I don't agree with your way of fixing it. I will fix it like this: https://github.com/bjorng/otp/commit/7e8806063fb2d4eb9e15b48bd9f9c3f788fe3aa7 -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From bookjovi@REDACTED Tue Nov 29 05:41:06 2011 From: bookjovi@REDACTED (Jovi Zhang) Date: Tue, 29 Nov 2011 12:41:06 +0800 Subject: [erlang-patches] [PATCH] erts: remove variable processes_busy In-Reply-To: References: Message-ID: 2011/11/28 Bj?rn Gustavsson : > On 11/13/11, Jovi Zhang wrote: >> How about this patch? >> >> On Wed, Nov 9, 2011 at 5:04 PM, Jovi Zhang wrote: >> >>> >>> variable processes_busy is not used in current code, it don't have >>> any meaning still stay on there, so remove it. >>> >>> Git Tree: ? ? ? ? ? ? ? git pull git://github.com/bookjovi/otp.git >>> Patch Review: * ? ? ?* >>> https://github.com/bookjovi/otp/commit/d428f18f1d03c133e2b59053978509bfae4d2c8c >>> > > Thanks for noticing the useless variable. However, I don't > agree with your way of fixing it. I will fix it like this: > > https://github.com/bjorng/otp/commit/7e8806063fb2d4eb9e15b48bd9f9c3f788fe3aa7 > > -- > Bj?rn Gustavsson, Erlang/OTP, Ericsson AB > By the way, my name is "Jovi Zhang", not "Jovi Shang", :) But note that global variable is also not used in benchmark.c, that's why I removed all processes_busy. .jovi From bgustavsson@REDACTED Tue Nov 29 09:44:18 2011 From: bgustavsson@REDACTED (=?UTF-8?Q?Bj=C3=B6rn_Gustavsson?=) Date: Tue, 29 Nov 2011 09:44:18 +0100 Subject: [erlang-patches] [PATCH] erts: remove variable processes_busy In-Reply-To: References: Message-ID: 2011/11/29 Jovi Zhang : > > By the way, my name is "Jovi Zhang", not "Jovi Shang", :) Sorry. I will correct that before merging the branch to 'master'. > But note that global variable is also not used in benchmark.c, that's > why I removed all processes_busy. It is used in hipe_bifs_process_info_0() in hipe_bif1.c. -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From bookjovi@REDACTED Tue Nov 29 10:03:49 2011 From: bookjovi@REDACTED (Jovi Zhang) Date: Tue, 29 Nov 2011 17:03:49 +0800 Subject: [erlang-patches] [PATCH] erts: remove variable processes_busy In-Reply-To: References: Message-ID: 2011/11/29 Bj?rn Gustavsson : > 2011/11/29 Jovi Zhang : >> >> By the way, my name is "Jovi Zhang", not "Jovi Shang", :) > > Sorry. I will correct that before merging the branch to 'master'. > >> But note that global variable is also not used in benchmark.c, that's >> why I removed all processes_busy. > > It is used in hipe_bifs_process_info_0() in hipe_bif1.c. > Hmm, sorry, I haven't noticed that, I agree with your patch. From kruber@REDACTED Wed Nov 30 10:32:33 2011 From: kruber@REDACTED (Nico Kruber) Date: Wed, 30 Nov 2011 10:32:33 +0100 Subject: [erlang-patches] Fix for: extremely slow Erlang to/from Java communication via JInterface Message-ID: <10958143.tlbGcITqxT@csr-pc40.zib.de> We discovered, that the communication between Erlang and Java is extremely slow when sending longer lists. We had two lists, each containing about **700.000** Strings (typically of length 20-30). This resulted in a message size of about **40MB** when being sent over to Erlang. The transformation of these lists into the (binary) message took Java about **10 minutes** in an RPC call. The reason for this is in the JInterface, which incrementally allocates memory for the send-buffer in OtpOutputStream and increases this buffer by a constant size of 2KB in each iteration. Each increase involves a complete copying of the old buffer to a new one - for this **40MB** message, about 20000 memory copies are needed! We can reduce the send time from 10 minutes to less than 10 seconds (almost two orders of magnitude) with the patch below. It allocates 50% more memory in each step, instead of constantly adding only 2k. (This behaviour was inspired by the one used by java.util.ArrayList.) The following table provides some examples of how many memory copies are needed in order to reach a certain size: size n*2048 (n*3)/2+1 and at least +2048 1K 1 1 2K 1 1 5K 3 3 10K 5 5 20K 10 6 100K 50 10 500K 250 14 1024K=1M 512 16 10M 5120 22 50M 25600 26 100M 51200 28 git fetch git://github.com/NicoK/otp.git jinterface_better_buffer_alloc https://github.com/NicoK/otp/compare/jinterface_better_buffer_alloc https://github.com/NicoK/otp/compare/jinterface_better_buffer_alloc.patch It would be nice to see this in R15B as it significantly improves performance for large messages as shown. Regards Nico Kruber Note: Sending binary data is not affected, as it already allocates as much memory as needed to include the bytes. -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 198 bytes Desc: This is a digitally signed message part. URL: From henrik@REDACTED Wed Nov 30 11:20:30 2011 From: henrik@REDACTED (Henrik Nord) Date: Wed, 30 Nov 2011 11:20:30 +0100 Subject: [erlang-patches] Fix for: extremely slow Erlang to/from Java communication via JInterface In-Reply-To: <10958143.tlbGcITqxT@csr-pc40.zib.de> References: <10958143.tlbGcITqxT@csr-pc40.zib.de> Message-ID: <4ED6036E.3070202@erlang.org> Hello Thank you for the contribution! If the tests pass, the patch is likely to be included in R15B. On 11/30/2011 10:32 AM, Nico Kruber wrote: > We discovered, that the communication between Erlang and Java is > extremely slow when sending longer lists. > > We had two lists, each containing about **700.000** Strings (typically of > length 20-30). This resulted in a message size of about **40MB** when being > sent over to Erlang. The transformation of these lists into the (binary) > message took Java about **10 minutes** in an RPC call. > > The reason for this is in the JInterface, which incrementally allocates memory > for the send-buffer in OtpOutputStream and increases this buffer by a constant > size of 2KB in each iteration. Each increase involves a complete copying of > the old buffer to a new one - for this **40MB** message, about 20000 memory > copies are needed! > > We can reduce the send time from 10 minutes to less than 10 seconds (almost > two orders of magnitude) with the patch below. It allocates 50% more > memory in each step, instead of constantly adding only 2k. (This behaviour was > inspired by the one used by java.util.ArrayList.) > > The following table provides some examples of how many memory copies are > needed in order to reach a certain size: > > size n*2048 (n*3)/2+1 and at least +2048 > 1K 1 1 > 2K 1 1 > 5K 3 3 > 10K 5 5 > 20K 10 6 > 100K 50 10 > 500K 250 14 > 1024K=1M 512 16 > 10M 5120 22 > 50M 25600 26 > 100M 51200 28 > > > git fetch git://github.com/NicoK/otp.git jinterface_better_buffer_alloc > > https://github.com/NicoK/otp/compare/jinterface_better_buffer_alloc > https://github.com/NicoK/otp/compare/jinterface_better_buffer_alloc.patch > > > It would be nice to see this in R15B as it significantly improves performance > for large messages as shown. > > > Regards > Nico Kruber > > Note: Sending binary data is not affected, as it already allocates as much > memory as needed to include the bytes. > > > _______________________________________________ > erlang-patches mailing list > erlang-patches@REDACTED > http://erlang.org/mailman/listinfo/erlang-patches -- /Henrik Nord Erlang/OTP -------------- next part -------------- An HTML attachment was scrubbed... URL: From vladdu55@REDACTED Wed Nov 30 12:16:29 2011 From: vladdu55@REDACTED (Vlad Dumitrescu) Date: Wed, 30 Nov 2011 12:16:29 +0100 Subject: [erlang-patches] Fix for: extremely slow Erlang to/from Java communication via JInterface In-Reply-To: <10958143.tlbGcITqxT@csr-pc40.zib.de> References: <10958143.tlbGcITqxT@csr-pc40.zib.de> Message-ID: Hi! 2011/11/30 Nico Kruber : > We discovered, that the communication between Erlang and Java is > extremely slow when sending longer lists. > > git fetch git://github.com/NicoK/otp.git jinterface_better_buffer_alloc > > https://github.com/NicoK/otp/compare/jinterface_better_buffer_alloc > https://github.com/NicoK/otp/compare/jinterface_better_buffer_alloc.patch This patch uses Java 6 features. Isn't jinterface supporting even Java 5? regards, Vlad From raimo+erlang-patches@REDACTED Wed Nov 30 12:29:18 2011 From: raimo+erlang-patches@REDACTED (Raimo Niskanen) Date: Wed, 30 Nov 2011 12:29:18 +0100 Subject: [erlang-patches] Fix for: extremely slow Erlang to/from Java communication via JInterface In-Reply-To: References: <10958143.tlbGcITqxT@csr-pc40.zib.de> Message-ID: <20111130112918.GB18376@erix.ericsson.se> On Wed, Nov 30, 2011 at 12:16:29PM +0100, Vlad Dumitrescu wrote: > Hi! > > 2011/11/30 Nico Kruber : > > We discovered, that the communication between Erlang and Java is > > extremely slow when sending longer lists. > > > > git fetch git://github.com/NicoK/otp.git jinterface_better_buffer_alloc > > > > https://github.com/NicoK/otp/compare/jinterface_better_buffer_alloc > > https://github.com/NicoK/otp/compare/jinterface_better_buffer_alloc.patch > > This patch uses Java 6 features. Isn't jinterface supporting even Java 5? That is correct. JDK 1.5 is the least common denominator. Then it will not pass our tests. Is it the java.util.Arrays.copyOf method that is too new, or is it more? Can the patch be rewritten? > > regards, > Vlad > _______________________________________________ > erlang-patches mailing list > erlang-patches@REDACTED > http://erlang.org/mailman/listinfo/erlang-patches -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From vladdu55@REDACTED Wed Nov 30 12:35:14 2011 From: vladdu55@REDACTED (Vlad Dumitrescu) Date: Wed, 30 Nov 2011 12:35:14 +0100 Subject: [erlang-patches] Fix for: extremely slow Erlang to/from Java communication via JInterface In-Reply-To: <20111130112918.GB18376@erix.ericsson.se> References: <10958143.tlbGcITqxT@csr-pc40.zib.de> <20111130112918.GB18376@erix.ericsson.se> Message-ID: Hi, I think that it's easy to fix, just replace that line with final byte[] tmp = new byte[super.count]; System.arraycopy(super.buf, 0, tmp, 0, super.count); super.buf = tmp; regards, Vlad On Wed, Nov 30, 2011 at 12:29, Raimo Niskanen wrote: > On Wed, Nov 30, 2011 at 12:16:29PM +0100, Vlad Dumitrescu wrote: >> Hi! >> >> 2011/11/30 Nico Kruber : >> > We discovered, that the communication between Erlang and Java is >> > extremely slow when sending longer lists. >> > >> > git fetch git://github.com/NicoK/otp.git jinterface_better_buffer_alloc >> > >> > https://github.com/NicoK/otp/compare/jinterface_better_buffer_alloc >> > https://github.com/NicoK/otp/compare/jinterface_better_buffer_alloc.patch >> >> This patch uses Java 6 features. Isn't jinterface supporting even Java 5? > > That is correct. JDK 1.5 is the least common denominator. > > Then it will not pass our tests. > > Is it the java.util.Arrays.copyOf method that is too new, or is > it more? Can the patch be rewritten? > > >> >> regards, >> Vlad >> _______________________________________________ >> erlang-patches mailing list >> erlang-patches@REDACTED >> http://erlang.org/mailman/listinfo/erlang-patches > > -- > > / Raimo Niskanen, Erlang/OTP, Ericsson AB > _______________________________________________ > erlang-patches mailing list > erlang-patches@REDACTED > http://erlang.org/mailman/listinfo/erlang-patches > From kostis@REDACTED Wed Nov 30 12:49:04 2011 From: kostis@REDACTED (Kostis Sagonas) Date: Wed, 30 Nov 2011 12:49:04 +0100 Subject: [erlang-patches] Fix for: extremely slow Erlang to/from Java communication via JInterface In-Reply-To: References: <10958143.tlbGcITqxT@csr-pc40.zib.de> Message-ID: <4ED61830.3050706@cs.ntua.gr> On 11/30/2011 12:16 PM, Vlad Dumitrescu wrote: > Hi! > > 2011/11/30 Nico Kruber: >> We discovered, that the communication between Erlang and Java is >> extremely slow when sending longer lists. >> >> git fetch git://github.com/NicoK/otp.git jinterface_better_buffer_alloc >> >> https://github.com/NicoK/otp/compare/jinterface_better_buffer_alloc >> https://github.com/NicoK/otp/compare/jinterface_better_buffer_alloc.patch > > This patch uses Java 6 features. Isn't jinterface supporting even Java 5? I think it's a pity not to include this patch because of support for Java 5 (which is quite old, if not very old by now). If support for java 5 is really required, perhaps this can be added with some sort of ifdef/configure option? Kostis From carlos.varela.paz@REDACTED Wed Nov 30 14:20:43 2011 From: carlos.varela.paz@REDACTED (Carlos Varela) Date: Wed, 30 Nov 2011 14:20:43 +0100 Subject: [erlang-patches] Update timezone information before convert the Epoch time to reflect system configuration changes Message-ID: Details in the commit message: git fetch git://github.com/carlosvarelap/otp.gitupdate_localtime_configuration https://github.com/carlosvarelap/otp/compare/update_localtime_configuration https://github.com/carlosvarelap/otp/compare/update_localtime_configuration.patch Regards, Carlos -------------- next part -------------- An HTML attachment was scrubbed... URL: From kruber@REDACTED Wed Nov 30 14:21:29 2011 From: kruber@REDACTED (Nico Kruber) Date: Wed, 30 Nov 2011 14:21:29 +0100 Subject: [erlang-patches] Fix for: extremely slow Erlang to/from Java communication via JInterface In-Reply-To: References: <10958143.tlbGcITqxT@csr-pc40.zib.de> <20111130112918.GB18376@erix.ericsson.se> Message-ID: <1926567.ACSj03UWza@csr-pc40.zib.de> thank you for that tip - I wasn't even aware of Arrays.copyOf being Java6 only. I replaced it by your code in my branch. Nico On Wednesday 30 November 2011 12:35:14 Vlad Dumitrescu wrote: > Hi, > > I think that it's easy to fix, just replace that line with > > final byte[] tmp = new byte[super.count]; > System.arraycopy(super.buf, 0, tmp, 0, super.count); > super.buf = tmp; > > regards, > Vlad > > > On Wed, Nov 30, 2011 at 12:29, Raimo Niskanen > > wrote: > > On Wed, Nov 30, 2011 at 12:16:29PM +0100, Vlad Dumitrescu wrote: > >> Hi! > >> > >> 2011/11/30 Nico Kruber : > >> > We discovered, that the communication between Erlang and Java is > >> > extremely slow when sending longer lists. > >> > > >> > git fetch git://github.com/NicoK/otp.git > >> > jinterface_better_buffer_alloc > >> > > >> > https://github.com/NicoK/otp/compare/jinterface_better_buffer_allo > >> > c > >> > https://github.com/NicoK/otp/compare/jinterface_better_buffer_allo > >> > c.patch>> > >> This patch uses Java 6 features. Isn't jinterface supporting even Java > >> 5?> > > That is correct. JDK 1.5 is the least common denominator. > > > > Then it will not pass our tests. > > > > Is it the java.util.Arrays.copyOf method that is too new, or is > > it more? Can the patch be rewritten? > > > >> regards, > >> Vlad -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 198 bytes Desc: This is a digitally signed message part. URL: