From opendev@REDACTED Mon Sep 3 14:35:16 2007 From: opendev@REDACTED (Joern) Date: Mon, 3 Sep 2007 14:35:16 +0200 Subject: [erlang-bugs] Linter support for packages Message-ID: <9e009ad0709030535h3bede176pdfa6a307819ae4c8@mail.gmail.com> Dear erlang-bugs, following a conversation with Ulf Wiger I'd like to request a modification of the linter to emit warnings if a non-namespaced module is used in a namespaced module without a fitting import. I am aware that namespace / packages are not officially supported but they are part of the official OTP distribution after all. This is especially a problem with trivial (and therefore usually not test covered) case such as _ -> error_logger:error_msg("...") where the error that error_logger is not defined in the current namespace will obfuscate the reason for the crash or produce the crash all by itself. With best regards, Joern From paul-trapexit@REDACTED Mon Sep 3 21:13:16 2007 From: paul-trapexit@REDACTED (Paul Mineiro) Date: Mon, 3 Sep 2007 12:13:16 -0700 (PDT) Subject: [erlang-bugs] http client relative redirects Message-ID: Dear maintainers, Relative urls in redirects result in an unexpected (to me) error. ------- pmineiro@REDACTED% erl ~ Erlang (BEAM) emulator version 5.5.5 [source] [async-threads:0] [kernel-poll:false] Eshell V5.5.5 (abort with ^G) 1> http:request ("http://yexsely.spaces.live.com/"). =INFO REPORT==== 3-Sep-2007::12:06:30 === The inets application was not started. Has now been started as a temporary application. {error,no_scheme} ------- The server is handing back a relative url in the location header: ------- pmineiro@REDACTED% telnet yexsely.spaces.live.com 80 Trying 207.46.123.236... Connected to yexsely.spaces.live.com. Escape character is '^]'. GET / HTTP/1.1 Host: yexsely.spaces.live.com HTTP/1.1 302 Found Connection: close Date: Mon, 03 Sep 2007 19:05:28 GMT Server: Microsoft-IIS/6.0 P3P:CP="BUS CUR CONo FIN IVDo ONL OUR PHY SAMo TELo" MSNSERVER: H: BY2SPCWEBA047 V: 1 D: 1/1/2000 X-Powered-By: ASP.NET X-AspNet-Version: 2.0.50727 Location: /AccessDenied.aspx?space=yexsely Set-Cookie: wlru=http%3a%2f%2fyexsely.spaces.live.com%2fdefault.aspx; domain=spaces.live.com; path=/ Cache-Control: private Content-Type: text/html Object moved

Object moved to here.

Connection closed by foreign host. ------- I'm not sure what the RFC says, but my browser does a redirect treating the ref as relative, i.e., to http://yexsely.spaces.live.com/AccessDenied.aspx?space=yexsely . Thanks, -- p From paul-trapexit@REDACTED Mon Sep 3 22:12:30 2007 From: paul-trapexit@REDACTED (Paul Mineiro) Date: Mon, 3 Sep 2007 13:12:30 -0700 (PDT) Subject: [erlang-bugs] http client hang (on https redirect?) Message-ID: Dear maintainers, When I try ------------ pmineiro@REDACTED% erl Erlang (BEAM) emulator version 5.5.5 [source] [async-threads:0] [kernel-poll:false] Eshell V5.5.5 (abort with ^G) 1> http:request ("http://mitch-alex.blogspot.com/"). =INFO REPORT==== 3-Sep-2007::13:00:25 === The inets application was not started. Has now been started as a temporary application. ------------ it just hangs there. If I set a timeout this does not help ------------ pmineiro@REDACTED% erl ~ Erlang (BEAM) emulator version 5.5.5 [source] [async-threads:0] [kernel-poll:false] Eshell V5.5.5 (abort with ^G) 1> http:request (get, { "http://mitch-alex.blogspot.com/", [] }, [ { timeout, 1000 } ], []). =INFO REPORT==== 3-Sep-2007::13:02:54 === The inets application was not started. Has now been started as a temporary application. ------------ I also tried setting a Connection: close header but that didn't help either. ------------ Eshell V5.5.5 (abort with ^G) 1> http:request (get, { "http://mitch-alex.blogspot.com/", [ { "connection", "close" } ] }, [ { timeout, 1000 } ], []). =INFO REPORT==== 3-Sep-2007::13:06:20 === The inets application was not started. Has now been started as a temporary application. ------------ Using telnet the page is being redirected to an https: url ------------ pmineiro@REDACTED% telnet mitch-alex.blogspot.com 80 ~ Trying 72.14.207.191... Connected to blogspot.l.google.com. Escape character is '^]'. GET / HTTP/1.1 Host: mitch-alex.blogspot.com Connection: close HTTP/1.1 302 Moved Temporarily Location: https://www.blogger.com/blogin.g?blogspotURL=http%3A%2F%2Fmitch-alex.blogspot.com%2F Content-Type: text/html; charset=UTF-8 Cache-control: private Content-Length: 266 Date: Mon, 03 Sep 2007 20:05:43 GMT Server: GFE/1.3 Moved Temporarily

Moved Temporarily

The document has moved here. Connection closed by foreign host. ------------- I don't know if that is the reason for the difficulty. Thanks, -- p From paul-trapexit@REDACTED Mon Sep 3 22:56:35 2007 From: paul-trapexit@REDACTED (Paul Mineiro) Date: Mon, 3 Sep 2007 13:56:35 -0700 (PDT) Subject: [erlang-bugs] http client parse (noncompliant) status-line Message-ID: Dear maintainers, ---------- pmineiro@REDACTED% erl Erlang (BEAM) emulator version 5.5.5 [source] [async-threads:0] [kernel-poll:false] Eshell V5.5.5 (abort with ^G) 1> http:request ("http://g-shock.trend-now.net/"). =INFO REPORT==== 3-Sep-2007::13:45:22 === The inets application was not started. Has now been started as a temporary application. {error,{badarg,[{erlang,list_to_integer,["302\r\nDate:"]}, {httpc_response,parse_status_code,4}, {httpc_handler,handle_info,2}, {gen_server,handle_msg,6}, {proc_lib,init_p,5}]}} ---------- The response clearly violates the rfc (http://www.w3.org/Protocols/rfc2616/rfc2616-sec6.html#sec6.1) since the response phrase is missing: ---------- pmineiro@REDACTED% printf "GET / HTTP/1.1\r\nHost: g-shock.trend-now.net\r\nConnection: close\r\n\r\n" | nc g-shock.trend-now.net 80 | head -1 | hexdump -c 0000000 H T T P / 1 . 1 3 0 2 \r \n 000000e ---------- and yet the server claims to be apache 2.0: ---------- pmineiro@REDACTED% telnet g-shock.trend-now.net 80 ~ Trying 208.113.213.164... Connected to g-shock.trend-now.net. Escape character is '^]'. GET / HTTP/1.1 Host: g-shock.trend-now.net Connection: close HTTP/1.1 302 Date: Mon, 03 Sep 2007 20:48:38 GMT Server: Apache/2.0.54 (Unix) PHP/4.4.7 mod_ssl/2.0.54 OpenSSL/0.9.7e mod_fastcgi/2.4.2 DAV/2 SVN/1.4.2 X-Powered-By: PHP/5.2.2 Location: http://g-shock.brand-items.com/ Vary: Accept-Encoding Content-Length: 0 Connection: close Content-Type: text/html; charset=UTF-8 Connection closed by foreign host. ---------- Anyway IMHO I think it would be good to be more robust in the parsing of the response status-line. Thanks, -- p From dougedmunds@REDACTED Wed Sep 5 19:09:39 2007 From: dougedmunds@REDACTED (Doug Edmunds) Date: Wed, 5 Sep 2007 10:09:39 -0700 Subject: [erlang-bugs] ets:from_dets/2 documentation error Message-ID: /lib/stdlib-1.14.5/doc/html/ets.html documentation incorrectly shows the output of ets:from_dets(Tab,DetsTab) -> Tab. Output is not Tab. Filling the ETS table is a side effect of the function call. The corrected statement is ets:from_dets(Tab,DetsTab) -> true (Note "error in process" if either Tab or DetsTab is not open). Doug Edmunds -------------- next part -------------- An HTML attachment was scrubbed... URL: From mogorman@REDACTED Thu Sep 6 02:01:57 2007 From: mogorman@REDACTED (Matthew O'Gorman) Date: Wed, 5 Sep 2007 19:01:57 -0500 Subject: [erlang-bugs] inet_res:getbyname Message-ID: inet_res:getbyname fails unless started with -name erl Erlang (BEAM) emulator version 5.5.5 [source] [64-bit] [async-threads:0] [hipe] [kernel-poll:false] Eshell V5.5.5 (abort with ^G) 1> inet_res:getbyname("_xmpp-server._tcp.digium.com",srv). {error,timeout} 2> erl -sname matt Erlang (BEAM) emulator version 5.5.5 [source] [64-bit] [async-threads:0] [hipe] [kernel-poll:false] Eshell V5.5.5 (abort with ^G) (matt@REDACTED)1> inet_res:getbyname("_xmpp-server._tcp.digium.com",srv). {error,timeout} (matt@REDACTED)2> erl -name matt Erlang (BEAM) emulator version 5.5.5 [source] [64-bit] [async-threads:0] [hipe] [kernel-poll:false] Eshell V5.5.5 (abort with ^G) (matt@REDACTED)1> inet_res:getbyname("_xmpp-server._tcp.digium.com",srv). {ok,{hostent,"_xmpp-server._tcp.digium.com", [], srv, 1, [{5,0,5269,"jabber.digium.com"}]}} (matt@REDACTED)2> This seems to have existed since r10b i was wondering if there are any intentions on ever fixing it? Mog From paul-trapexit@REDACTED Thu Sep 6 05:03:27 2007 From: paul-trapexit@REDACTED (Paul Mineiro) Date: Wed, 5 Sep 2007 20:03:27 -0700 (PDT) Subject: [erlang-bugs] http client relative redirects In-Reply-To: References: Message-ID: Hey maintainers, (As you probably already know) the RFC does state that Location: headers are supposed to be absolute http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.30 But IMHO I still think it would be a good idea to try and handle this. -- p On Mon, 3 Sep 2007, Paul Mineiro wrote: > Dear maintainers, > > Relative urls in redirects result in an unexpected (to me) error. > > ------- > pmineiro@REDACTED% erl ~ > Erlang (BEAM) emulator version 5.5.5 [source] [async-threads:0] [kernel-poll:false] > > Eshell V5.5.5 (abort with ^G) > 1> http:request ("http://yexsely.spaces.live.com/"). > > =INFO REPORT==== 3-Sep-2007::12:06:30 === > The inets application was not started. Has now been started as a temporary application. > {error,no_scheme} > ------- > > The server is handing back a relative url in the location header: > > ------- > pmineiro@REDACTED% telnet yexsely.spaces.live.com 80 > Trying 207.46.123.236... > Connected to yexsely.spaces.live.com. > Escape character is '^]'. > GET / HTTP/1.1 > Host: yexsely.spaces.live.com > > HTTP/1.1 302 Found > Connection: close > Date: Mon, 03 Sep 2007 19:05:28 GMT > Server: Microsoft-IIS/6.0 > P3P:CP="BUS CUR CONo FIN IVDo ONL OUR PHY SAMo TELo" > MSNSERVER: H: BY2SPCWEBA047 V: 1 D: 1/1/2000 > X-Powered-By: ASP.NET > X-AspNet-Version: 2.0.50727 > Location: /AccessDenied.aspx?space=yexsely > Set-Cookie: wlru=http%3a%2f%2fyexsely.spaces.live.com%2fdefault.aspx; domain=spaces.live.com; path=/ > Cache-Control: private > Content-Type: text/html > > Object moved >

Object moved to here.

> > Connection closed by foreign host. > ------- > > I'm not sure what the RFC says, but my browser does a redirect treating > the ref as relative, i.e., to > http://yexsely.spaces.live.com/AccessDenied.aspx?space=yexsely . > > Thanks, > > -- p > "A hot dog and bun, you have to have a style and strategy that's different from a chicken wing, which is different from a matzo ball," he says. "Athletics are not really about superior fitness. They're about superior refinement of skill. That's what Babe Ruth did. That's what this is." http://en.wikipedia.org/wiki/Competitive_eating From raimo+erlang-bugs@REDACTED Thu Sep 6 09:28:23 2007 From: raimo+erlang-bugs@REDACTED (Raimo Niskanen) Date: Thu, 6 Sep 2007 09:28:23 +0200 Subject: [erlang-bugs] inet_res:getbyname In-Reply-To: References: Message-ID: <20070906072823.GA22783@erix.ericsson.se> Well, since this resolver is kind of deprecated; not really - we have paying customers using it, but almost deprecated. The native resolver is the one we want everyone to use since it calls the OS resolver and therefore should be perfectly bug compatible. Anyway, we have no strong reasons to put a lot of work into inet_res. But if it behaves strangely and we can fix it easily we will do it. I took a quick look into ets:tab2list(inet_db) for both -sname and -name and it seems res_domain, res_ns and res_search does not get initialized if started with -sname. It seems my host resolver configuration file is not read (/etc/resolv.conf). This rings a bell about cleanups we did about which host configuration files are read at startup (/etc{resolv.conf,nsswitch.conf, hosts,host.conf,irs.conf,...}. It was a mess and very bug prone. The idea is that the native resolver does it right so we shall use it. I have to talk to some people... Anyway, this means there are workarounds, at least using the infamous inetrc file, to set an inet_res configuration of your own. On Wed, Sep 05, 2007 at 07:01:57PM -0500, Matthew O'Gorman wrote: > inet_res:getbyname fails unless started with -name > > erl > > Erlang (BEAM) emulator version 5.5.5 [source] [64-bit] > [async-threads:0] [hipe] [kernel-poll:false] > > > > Eshell V5.5.5 (abort with ^G) > > 1> inet_res:getbyname("_xmpp-server._tcp.digium.com",srv). > > {error,timeout} > > 2> > > > > erl -sname matt > > Erlang (BEAM) emulator version 5.5.5 [source] [64-bit] > [async-threads:0] [hipe] [kernel-poll:false] > > > > Eshell V5.5.5 (abort with ^G) > > (matt@REDACTED)1> inet_res:getbyname("_xmpp-server._tcp.digium.com",srv). > > {error,timeout} > > (matt@REDACTED)2> > > > > erl -name matt > > Erlang (BEAM) emulator version 5.5.5 [source] [64-bit] > [async-threads:0] [hipe] [kernel-poll:false] > > > > Eshell V5.5.5 (abort with ^G) > > (matt@REDACTED)1> > inet_res:getbyname("_xmpp-server._tcp.digium.com",srv). > > {ok,{hostent,"_xmpp-server._tcp.digium.com", > > [], > > srv, > > 1, > > [{5,0,5269,"jabber.digium.com"}]}} > > (matt@REDACTED)2> > > > > > This seems to have existed since r10b i was wondering if there are any > intentions on ever fixing it? > > Mog > _______________________________________________ > erlang-bugs mailing list > erlang-bugs@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-bugs -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From ingela@REDACTED Thu Sep 6 16:23:21 2007 From: ingela@REDACTED (Ingela Anderton Andin) Date: Thu, 06 Sep 2007 16:23:21 +0200 Subject: [erlang-bugs] http client relative redirects Message-ID: <46E00D59.7040704@erix.ericsson.se> FYI! (As I was not yet a member of erlang-bugs when I wrote the answer) Hi! It is handled if you sepecify the HTTP-option {relaxed, true} in http:request/4. Although it is not currently documented, mainly because we have not really decided on all things that may be relaxed. But I will add it to the documentation. By default the client will conform to the spec. Regards Ingela -OTP team > Hey maintainers, > (As you probably already know) the RFC does state that Location: headers > are supposed to be absolute > http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.30 > But IMHO I still think it could be a good idea to try and handle this. From ingela@REDACTED Thu Sep 6 16:28:58 2007 From: ingela@REDACTED (Ingela Anderton Andin) Date: Thu, 06 Sep 2007 16:28:58 +0200 Subject: [erlang-bugs] http client parse (noncompliant) status-line Message-ID: <46E00EAA.7080803@erix.ericsson.se> FYI! (As I was not yet a member of erlang-bugs when I wrote the answer) Hi! I think parsing is robust enough the client did not die, it returned an error message. However it ended up in the default clause e.i. an unexpected error and hence the error-reason was set to the call stack for what went wrong in in the temporary internal http client process that handles the request. That is the intention since then we can easily understand what went wrong if it crash in an unexpected way and maybe find a better way of handling it. It would in this case perhaps be better to return something like {error, {"Response not compliant to http can not parse", Data}} It is not really reasonable to make the client bug-compatible with apache, but perhaps if it is a known bug and no too much work to fix, it could be added to the relaxed mode I mentioned in our earlier correspondence. I will put this matter on the TODO list. Regards - Ingela OTP team > Dear maintainers, > > ---------- > % erl > Erlang (BEAM) emulator version 5.5.5 [source] [async-threads:0] > [kernel-poll:false] > > Eshell V5.5.5 (abort with ^G) > 1> http:request ("http://g-shock.trend-now.net/"). > > =INFO REPORT==== 3-Sep-2007::13:45:22 === > The inets application was not started. Has now been started as a > temporary > application. > {error,{badarg,[{erlang,list_to_integer,["302\r\nDate:"]}, > {httpc_response,parse_status_code,4}, > {httpc_handler,handle_info,2}, > {gen_server,handle_msg,6}, > {proc_lib,init_p,5}]}} > ---------- > > The response clearly violates the rfc > (http://www.w3.org/Protocols/rfc2616/rfc2616-sec6.html#sec6.1) since > the response phrase is missing: > > ---------- > % printf "GET / HTTP/1.1\r\nHost: g-shock.trend-now.net\r\nConnection: > close\r\n\r\n" | nc g-shock.trend-now.net 80 | head -1 | hexdump -c > 0000000 H T T P / 1 . 1 3 0 2 \r \n > 000000e > ---------- > > and yet the server claims to be apache 2.0: > > ---------- > % telnet g-shock.trend-now.net 80 > ~ > Trying 208.113.213.164... > Connected to g-shock.trend-now.net. > Escape character is '^]'. > GET / HTTP/1.1 > Host: g-shock.trend-now.net > Connection: close > > HTTP/1.1 302 > Date: Mon, 03 Sep 2007 20:48:38 GMT > Server: Apache/2.0.54 (Unix) PHP/4.4.7 mod_ssl/2.0.54 OpenSSL/0.9.7e > mod_fastcgi/2.4.2 DAV/2 SVN/1.4.2 > X-Powered-By: PHP/5.2.2 > Location: http://g-shock.brand-items.com/ > Vary: Accept-Encoding > Content-Length: 0 > Connection: close > Content-Type: text/html; charset=UTF-8 > > Connection closed by foreign host. > ---------- > > Anyway IMHO I think it would be good to be more robust in the parsing of > the response status-line. > > Thanks, > > -- p From ingela@REDACTED Thu Sep 6 17:05:33 2007 From: ingela@REDACTED (Ingela Anderton Andin) Date: Thu, 06 Sep 2007 17:05:33 +0200 Subject: [erlang-bugs] http client hang (on https redirect?) Message-ID: <46E0173D.3020402@erix.ericsson.se> Hi! This sounds like a bug that was fixed in inets-4.7.16. Could you make sure you have that version, and if there is still a problem contact us again. Regards Ingela - OTP team > Dear maintainers, > > When I try > ------------ > % erl > Erlang (BEAM) emulator version 5.5.5 [source] [async-threads:0] > [kernel-poll:false] > > Eshell V5.5.5 (abort with ^G) > 1> http:request ("http://mitch-alex.blogspot.com/"). > > =INFO REPORT==== 3-Sep-2007::13:00:25 === > The inets application was not started. Has now been started as a temporary > application. > ------------ > > it just hangs there. If I set a timeout this does not help > > ------------ > % erl ~ > Erlang (BEAM) emulator version 5.5.5 [source] [async-threads:0] [kernel-poll:false] > > Eshell V5.5.5 (abort with ^G) > 1> http:request (get, { "http://mitch-alex.blogspot.com/", [] }, [ { timeout, 1000 } ], []). > > =INFO REPORT==== 3-Sep-2007::13:02:54 === > The inets application was not started. Has now been started as a temporary application. > ------------ > > I also tried setting a Connection: close header but that didn't help > either. > > ------------ > Eshell V5.5.5 (abort with ^G) > 1> http:request (get, { "http://mitch-alex.blogspot.com/", [ { "connection", "close" } ] }, [ { timeout, 1000 } ], []). > > =INFO REPORT==== 3-Sep-2007::13:06:20 === > The inets application was not started. Has now been started as a temporary application. > ------------ > > Using telnet the page is being redirected to an https: url > > ------------ > % telnet mitch-alex.blogspot.com 80 ~ > Trying 72.14.207.191... > Connected to blogspot.l.google.com. > Escape character is '^]'. > GET / HTTP/1.1 > Host: mitch-alex.blogspot.com > Connection: close > > HTTP/1.1 302 Moved Temporarily > Location: https://www.blogger.com/blogin.g?blogspotURL=http%3A%2F%2Fmitch-alex.blogspot.com%2F > Content-Type: text/html; charset=UTF-8 > Cache-control: private > Content-Length: 266 > Date: Mon, 03 Sep 2007 20:05:43 GMT > Server: GFE/1.3 > > > > Moved Temporarily > > >

Moved Temporarily

> The document has moved here. > > > Connection closed by foreign host. > ------------- > > I don't know if that is the reason for the difficulty. > > Thanks, From paul-trapexit@REDACTED Thu Sep 6 18:01:13 2007 From: paul-trapexit@REDACTED (Paul Mineiro) Date: Thu, 6 Sep 2007 09:01:13 -0700 (PDT) Subject: [erlang-bugs] http client hang (on https redirect?) In-Reply-To: <46E0173D.3020402@erix.ericsson.se> References: <46E0173D.3020402@erix.ericsson.se> Message-ID: I have inets-4.7.16 --------- pmineiro@REDACTED% erl ~ Erlang (BEAM) emulator version 5.5.5 [source] [async-threads:0] [kernel-poll:false] Eshell V5.5.5 (abort with ^G) 1> http:module_info (). [{exports,[{request,1}, {request,4}, {cancel_request,1}, {set_options,1}, {verify_cookies,2}, {cookie_header,1}, {module_info,0}, {module_info,1}]}, {imports,[]}, {attributes,[{vsn,[106656174981009331805006427346058383543]}, {app_vsn,"inets-4.7.16"}]}, {compile,[{options,[{d,'SERVER_SOFTWARE',"inets/4.7.16"}, {cwd,"/ldisk/daily_build/otp_prebuild_r11b.2007-06-11_19/otp_src_R11B-5/lib/inets/src/http_client"}, {outdir,"/ldisk/daily_build/otp_prebuild_r11b.2007-06-11_19/otp_src_R11B-5/lib/inets/src/http_client/../../ebin"}, {i,"/ldisk/daily_build/otp_prebuild_r11b.2007-06-11_19/otp_src_R11B-5/lib/inets/src/http_client/../http_lib"}, {i,"/ldisk/daily_build/otp_prebuild_r11b.2007-06-11_19/otp_src_R11B-5/lib/inets/src/http_client/../inets_app"}, {attribute,insert,app_vsn,"inets-4.7.16"}, {parse_transform,sys_pre_attributes}, debug_info]}, {version,"4.4.5"}, {time,{2007,6,11,17,54,41}}, {source,"/ldisk/daily_build/otp_prebuild_r11b.2007-06-11_19/otp_src_R11B-5/lib/inets/src/http_client/http.erl"}]}] 2> http:request (get, { "http://mitch-alex.blogspot.com/", [] }, [ { timeout, 1000 } ], []). =INFO REPORT==== 6-Sep-2007::08:58:55 === The inets application was not started. Has now been started as a temporary application. BREAK: (a)bort (c)ontinue (p)roc info (i)nfo (l)oaded (v)ersion (k)ill (D)b-tables (d)istribution a ---------- Thanks, -- p On Thu, 6 Sep 2007, Ingela Anderton Andin wrote: > Hi! > > This sounds like a bug that was fixed in inets-4.7.16. > Could you make sure you have that version, and if there is still a problem > contact us again. > > Regards Ingela - OTP team > > > > Dear maintainers, > > > > When I try > > ------------ > > % erl > > Erlang (BEAM) emulator version 5.5.5 [source] [async-threads:0] > > [kernel-poll:false] > > > > Eshell V5.5.5 (abort with ^G) > > 1> http:request ("http://mitch-alex.blogspot.com/"). > > > > =INFO REPORT==== 3-Sep-2007::13:00:25 === > > The inets application was not started. Has now been started as a temporary > > application. > > ------------ > > > > it just hangs there. If I set a timeout this does not help > > > > ------------ > > % erl ~ > > Erlang (BEAM) emulator version 5.5.5 [source] [async-threads:0] [kernel-poll:false] > > > > Eshell V5.5.5 (abort with ^G) > > 1> http:request (get, { "http://mitch-alex.blogspot.com/", [] }, [ { timeout, 1000 } ], []). > > > > =INFO REPORT==== 3-Sep-2007::13:02:54 === > > The inets application was not started. Has now been started as a temporary application. > > ------------ > > > > I also tried setting a Connection: close header but that didn't help > > either. > > > > ------------ > > Eshell V5.5.5 (abort with ^G) > > 1> http:request (get, { "http://mitch-alex.blogspot.com/", [ { "connection", "close" } ] }, [ { timeout, 1000 } ], []). > > > > =INFO REPORT==== 3-Sep-2007::13:06:20 === > > The inets application was not started. Has now been started as a temporary application. > > ------------ > > > > Using telnet the page is being redirected to an https: url > > > > ------------ > > % telnet mitch-alex.blogspot.com 80 ~ > > Trying 72.14.207.191... > > Connected to blogspot.l.google.com. > > Escape character is '^]'. > > GET / HTTP/1.1 > > Host: mitch-alex.blogspot.com > > Connection: close > > > > HTTP/1.1 302 Moved Temporarily > > Location: https://www.blogger.com/blogin.g?blogspotURL=http%3A%2F%2Fmitch-alex.blogspot.com%2F > > Content-Type: text/html; charset=UTF-8 > > Cache-control: private > > Content-Length: 266 > > Date: Mon, 03 Sep 2007 20:05:43 GMT > > Server: GFE/1.3 > > > > > > > > Moved Temporarily > > > > > >

Moved Temporarily

> > The document has moved here. > > > > > > Connection closed by foreign host. > > ------------- > > > > I don't know if that is the reason for the difficulty. > > > > Thanks, > > Speakers of right-to-left languages use web 0.2 From mogorman@REDACTED Thu Sep 6 16:08:43 2007 From: mogorman@REDACTED (Matthew O'Gorman) Date: Thu, 6 Sep 2007 09:08:43 -0500 Subject: [erlang-bugs] inet_res:getbyname In-Reply-To: <20070906072823.GA22783@erix.ericsson.se> References: <20070906072823.GA22783@erix.ericsson.se> Message-ID: oh im sorry i didn't see that it was deprecated. What is the replacement for what I am trying to do, or is there no replacement you just don't intend to support it anymore? Matt On 9/6/07, Raimo Niskanen wrote: > Well, since this resolver is kind of deprecated; not really - we have > paying customers using it, but almost deprecated. The native resolver > is the one we want everyone to use since it calls the OS resolver > and therefore should be perfectly bug compatible. > > Anyway, we have no strong reasons to put a lot of work into > inet_res. But if it behaves strangely and we can fix it > easily we will do it. > > I took a quick look into ets:tab2list(inet_db) for both > -sname and -name and it seems res_domain, res_ns and > res_search does not get initialized if started with > -sname. It seems my host resolver configuration file is > not read (/etc/resolv.conf). This rings a bell about > cleanups we did about which host configuration files > are read at startup (/etc{resolv.conf,nsswitch.conf, > hosts,host.conf,irs.conf,...}. It was a mess and very bug prone. > The idea is that the native resolver does it right > so we shall use it. > > I have to talk to some people... > > Anyway, this means there are workarounds, at least using > the infamous inetrc file, to set an inet_res configuration of your own. > > > > On Wed, Sep 05, 2007 at 07:01:57PM -0500, Matthew O'Gorman wrote: > > inet_res:getbyname fails unless started with -name > > > > erl > > > > Erlang (BEAM) emulator version 5.5.5 [source] [64-bit] > > [async-threads:0] [hipe] [kernel-poll:false] > > > > > > > > Eshell V5.5.5 (abort with ^G) > > > > 1> inet_res:getbyname("_xmpp-server._tcp.digium.com",srv). > > > > {error,timeout} > > > > 2> > > > > > > > > erl -sname matt > > > > Erlang (BEAM) emulator version 5.5.5 [source] [64-bit] > > [async-threads:0] [hipe] [kernel-poll:false] > > > > > > > > Eshell V5.5.5 (abort with ^G) > > > > (matt@REDACTED)1> inet_res:getbyname("_xmpp-server._tcp.digium.com",srv). > > > > {error,timeout} > > > > (matt@REDACTED)2> > > > > > > > > erl -name matt > > > > Erlang (BEAM) emulator version 5.5.5 [source] [64-bit] > > [async-threads:0] [hipe] [kernel-poll:false] > > > > > > > > Eshell V5.5.5 (abort with ^G) > > > > (matt@REDACTED)1> > > inet_res:getbyname("_xmpp-server._tcp.digium.com",srv). > > > > {ok,{hostent,"_xmpp-server._tcp.digium.com", > > > > [], > > > > srv, > > > > 1, > > > > [{5,0,5269,"jabber.digium.com"}]}} > > > > (matt@REDACTED)2> > > > > > > > > > > This seems to have existed since r10b i was wondering if there are any > > intentions on ever fixing it? > > > > Mog > > _______________________________________________ > > erlang-bugs mailing list > > erlang-bugs@REDACTED > > http://www.erlang.org/mailman/listinfo/erlang-bugs > > -- > > / Raimo Niskanen, Erlang/OTP, Ericsson AB > From raimo+erlang-bugs@REDACTED Fri Sep 7 10:13:47 2007 From: raimo+erlang-bugs@REDACTED (Raimo Niskanen) Date: Fri, 7 Sep 2007 10:13:47 +0200 Subject: [erlang-bugs] : inet_res:getbyname In-Reply-To: References: <20070906072823.GA22783@erix.ericsson.se> Message-ID: <20070907081347.GB4406@erix.ericsson.se> The general call is inet:gethostbyname/2. See erl -man inet. There are lots of useful functions there. inet:gethostbyname/2 will in its turn call inet_res:getbyname/2 if 'dns' is in the list returned from inet_db:res_option(lookup). See http://www.erlang.org/doc/apps/erts/part_frame.html: "7 Inet configuration", option 'lookup'. But the default configuration is to have only 'native' in the lookup option list, which will make inet:gethostbyname call inet_gethost_native:gethostbyname, that itself uses a pool of external port programs that call the C resolver library functions. How did you stumble on the inet_res module? It is not documented. On Thu, Sep 06, 2007 at 09:08:43AM -0500, Matthew O'Gorman wrote: > oh im sorry i didn't see that it was deprecated. What is the > replacement for what I am trying to do, or is there no replacement you > just don't intend to support it anymore? > > Matt > > On 9/6/07, Raimo Niskanen wrote: > > Well, since this resolver is kind of deprecated; not really - we have > > paying customers using it, but almost deprecated. The native resolver > > is the one we want everyone to use since it calls the OS resolver > > and therefore should be perfectly bug compatible. > > > > Anyway, we have no strong reasons to put a lot of work into > > inet_res. But if it behaves strangely and we can fix it > > easily we will do it. > > > > I took a quick look into ets:tab2list(inet_db) for both > > -sname and -name and it seems res_domain, res_ns and > > res_search does not get initialized if started with > > -sname. It seems my host resolver configuration file is > > not read (/etc/resolv.conf). This rings a bell about > > cleanups we did about which host configuration files > > are read at startup (/etc{resolv.conf,nsswitch.conf, > > hosts,host.conf,irs.conf,...}. It was a mess and very bug prone. > > The idea is that the native resolver does it right > > so we shall use it. > > > > I have to talk to some people... > > > > Anyway, this means there are workarounds, at least using > > the infamous inetrc file, to set an inet_res configuration of your own. > > > > > > > > On Wed, Sep 05, 2007 at 07:01:57PM -0500, Matthew O'Gorman wrote: > > > inet_res:getbyname fails unless started with -name > > > > > > erl > > > > > > Erlang (BEAM) emulator version 5.5.5 [source] [64-bit] > > > [async-threads:0] [hipe] [kernel-poll:false] > > > > > > > > > > > > Eshell V5.5.5 (abort with ^G) > > > > > > 1> inet_res:getbyname("_xmpp-server._tcp.digium.com",srv). > > > > > > {error,timeout} > > > > > > 2> > > > > > > > > > > > > erl -sname matt > > > > > > Erlang (BEAM) emulator version 5.5.5 [source] [64-bit] > > > [async-threads:0] [hipe] [kernel-poll:false] > > > > > > > > > > > > Eshell V5.5.5 (abort with ^G) > > > > > > (matt@REDACTED)1> inet_res:getbyname("_xmpp-server._tcp.digium.com",srv). > > > > > > {error,timeout} > > > > > > (matt@REDACTED)2> > > > > > > > > > > > > erl -name matt > > > > > > Erlang (BEAM) emulator version 5.5.5 [source] [64-bit] > > > [async-threads:0] [hipe] [kernel-poll:false] > > > > > > > > > > > > Eshell V5.5.5 (abort with ^G) > > > > > > (matt@REDACTED)1> > > > inet_res:getbyname("_xmpp-server._tcp.digium.com",srv). > > > > > > {ok,{hostent,"_xmpp-server._tcp.digium.com", > > > > > > [], > > > > > > srv, > > > > > > 1, > > > > > > [{5,0,5269,"jabber.digium.com"}]}} > > > > > > (matt@REDACTED)2> > > > > > > > > > > > > > > > This seems to have existed since r10b i was wondering if there are any > > > intentions on ever fixing it? > > > > > > Mog > > > _______________________________________________ > > > erlang-bugs mailing list > > > erlang-bugs@REDACTED > > > http://www.erlang.org/mailman/listinfo/erlang-bugs > > > > -- > > > > / Raimo Niskanen, Erlang/OTP, Ericsson AB > > > _______________________________________________ > erlang-bugs mailing list > erlang-bugs@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-bugs -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From mogorman@REDACTED Fri Sep 7 15:50:39 2007 From: mogorman@REDACTED (Matthew O'Gorman) Date: Fri, 7 Sep 2007 08:50:39 -0500 Subject: [erlang-bugs] : inet_res:getbyname In-Reply-To: <20070907081347.GB4406@erix.ericsson.se> References: <20070906072823.GA22783@erix.ericsson.se> <20070907081347.GB4406@erix.ericsson.se> Message-ID: It is used in ejabberd and other projects for looking up srv records, something that inet:gethostbyname doesnt appear to do. Which is why I was reporting it as a bug. Mog On 9/7/07, Raimo Niskanen wrote: > The general call is inet:gethostbyname/2. See erl -man inet. > There are lots of useful functions there. > > inet:gethostbyname/2 will in its turn call inet_res:getbyname/2 > if 'dns' is in the list returned from inet_db:res_option(lookup). > See http://www.erlang.org/doc/apps/erts/part_frame.html: > "7 Inet configuration", option 'lookup'. > > But the default configuration is to have only 'native' in > the lookup option list, which will make inet:gethostbyname > call inet_gethost_native:gethostbyname, that itself uses > a pool of external port programs that call the C resolver > library functions. > > How did you stumble on the inet_res module? It is not documented. > > > > On Thu, Sep 06, 2007 at 09:08:43AM -0500, Matthew O'Gorman wrote: > > oh im sorry i didn't see that it was deprecated. What is the > > replacement for what I am trying to do, or is there no replacement you > > just don't intend to support it anymore? > > > > Matt > > > > On 9/6/07, Raimo Niskanen wrote: > > > Well, since this resolver is kind of deprecated; not really - we have > > > paying customers using it, but almost deprecated. The native resolver > > > is the one we want everyone to use since it calls the OS resolver > > > and therefore should be perfectly bug compatible. > > > > > > Anyway, we have no strong reasons to put a lot of work into > > > inet_res. But if it behaves strangely and we can fix it > > > easily we will do it. > > > > > > I took a quick look into ets:tab2list(inet_db) for both > > > -sname and -name and it seems res_domain, res_ns and > > > res_search does not get initialized if started with > > > -sname. It seems my host resolver configuration file is > > > not read (/etc/resolv.conf). This rings a bell about > > > cleanups we did about which host configuration files > > > are read at startup (/etc{resolv.conf,nsswitch.conf, > > > hosts,host.conf,irs.conf,...}. It was a mess and very bug prone. > > > The idea is that the native resolver does it right > > > so we shall use it. > > > > > > I have to talk to some people... > > > > > > Anyway, this means there are workarounds, at least using > > > the infamous inetrc file, to set an inet_res configuration of your own. > > > > > > > > > > > > On Wed, Sep 05, 2007 at 07:01:57PM -0500, Matthew O'Gorman wrote: > > > > inet_res:getbyname fails unless started with -name > > > > > > > > erl > > > > > > > > Erlang (BEAM) emulator version 5.5.5 [source] [64-bit] > > > > [async-threads:0] [hipe] [kernel-poll:false] > > > > > > > > > > > > > > > > Eshell V5.5.5 (abort with ^G) > > > > > > > > 1> inet_res:getbyname("_xmpp-server._tcp.digium.com",srv). > > > > > > > > {error,timeout} > > > > > > > > 2> > > > > > > > > > > > > > > > > erl -sname matt > > > > > > > > Erlang (BEAM) emulator version 5.5.5 [source] [64-bit] > > > > [async-threads:0] [hipe] [kernel-poll:false] > > > > > > > > > > > > > > > > Eshell V5.5.5 (abort with ^G) > > > > > > > > (matt@REDACTED)1> inet_res:getbyname("_xmpp-server._tcp.digium.com",srv). > > > > > > > > {error,timeout} > > > > > > > > (matt@REDACTED)2> > > > > > > > > > > > > > > > > erl -name matt > > > > > > > > Erlang (BEAM) emulator version 5.5.5 [source] [64-bit] > > > > [async-threads:0] [hipe] [kernel-poll:false] > > > > > > > > > > > > > > > > Eshell V5.5.5 (abort with ^G) > > > > > > > > (matt@REDACTED)1> > > > > inet_res:getbyname("_xmpp-server._tcp.digium.com",srv). > > > > > > > > {ok,{hostent,"_xmpp-server._tcp.digium.com", > > > > > > > > [], > > > > > > > > srv, > > > > > > > > 1, > > > > > > > > [{5,0,5269,"jabber.digium.com"}]}} > > > > > > > > (matt@REDACTED)2> > > > > > > > > > > > > > > > > > > > > This seems to have existed since r10b i was wondering if there are any > > > > intentions on ever fixing it? > > > > > > > > Mog > > > > _______________________________________________ > > > > erlang-bugs mailing list > > > > erlang-bugs@REDACTED > > > > http://www.erlang.org/mailman/listinfo/erlang-bugs > > > > > > -- > > > > > > / Raimo Niskanen, Erlang/OTP, Ericsson AB > > > > > _______________________________________________ > > erlang-bugs mailing list > > erlang-bugs@REDACTED > > http://www.erlang.org/mailman/listinfo/erlang-bugs > > -- > > / Raimo Niskanen, Erlang/OTP, Ericsson AB > From mogorman@REDACTED Fri Sep 7 16:00:07 2007 From: mogorman@REDACTED (Matthew O'Gorman) Date: Fri, 7 Sep 2007 09:00:07 -0500 Subject: [erlang-bugs] : inet_res:getbyname In-Reply-To: References: <20070906072823.GA22783@erix.ericsson.se> <20070907081347.GB4406@erix.ericsson.se> Message-ID: also just a quick grep through the source it looks like srv is only mentioned in inet_res and inet_dns. On 9/7/07, Matthew O'Gorman wrote: > It is used in ejabberd and other projects for looking up srv records, > something that inet:gethostbyname doesnt appear to do. Which is why I > was reporting it as a bug. > > Mog > > On 9/7/07, Raimo Niskanen wrote: > > The general call is inet:gethostbyname/2. See erl -man inet. > > There are lots of useful functions there. > > > > inet:gethostbyname/2 will in its turn call inet_res:getbyname/2 > > if 'dns' is in the list returned from inet_db:res_option(lookup). > > See http://www.erlang.org/doc/apps/erts/part_frame.html: > > "7 Inet configuration", option 'lookup'. > > > > But the default configuration is to have only 'native' in > > the lookup option list, which will make inet:gethostbyname > > call inet_gethost_native:gethostbyname, that itself uses > > a pool of external port programs that call the C resolver > > library functions. > > > > How did you stumble on the inet_res module? It is not documented. > > > > > > > > On Thu, Sep 06, 2007 at 09:08:43AM -0500, Matthew O'Gorman wrote: > > > oh im sorry i didn't see that it was deprecated. What is the > > > replacement for what I am trying to do, or is there no replacement you > > > just don't intend to support it anymore? > > > > > > Matt > > > > > > On 9/6/07, Raimo Niskanen wrote: > > > > Well, since this resolver is kind of deprecated; not really - we have > > > > paying customers using it, but almost deprecated. The native resolver > > > > is the one we want everyone to use since it calls the OS resolver > > > > and therefore should be perfectly bug compatible. > > > > > > > > Anyway, we have no strong reasons to put a lot of work into > > > > inet_res. But if it behaves strangely and we can fix it > > > > easily we will do it. > > > > > > > > I took a quick look into ets:tab2list(inet_db) for both > > > > -sname and -name and it seems res_domain, res_ns and > > > > res_search does not get initialized if started with > > > > -sname. It seems my host resolver configuration file is > > > > not read (/etc/resolv.conf). This rings a bell about > > > > cleanups we did about which host configuration files > > > > are read at startup (/etc{resolv.conf,nsswitch.conf, > > > > hosts,host.conf,irs.conf,...}. It was a mess and very bug prone. > > > > The idea is that the native resolver does it right > > > > so we shall use it. > > > > > > > > I have to talk to some people... > > > > > > > > Anyway, this means there are workarounds, at least using > > > > the infamous inetrc file, to set an inet_res configuration of your own. > > > > > > > > > > > > > > > > On Wed, Sep 05, 2007 at 07:01:57PM -0500, Matthew O'Gorman wrote: > > > > > inet_res:getbyname fails unless started with -name > > > > > > > > > > erl > > > > > > > > > > Erlang (BEAM) emulator version 5.5.5 [source] [64-bit] > > > > > [async-threads:0] [hipe] [kernel-poll:false] > > > > > > > > > > > > > > > > > > > > Eshell V5.5.5 (abort with ^G) > > > > > > > > > > 1> inet_res:getbyname("_xmpp-server._tcp.digium.com",srv). > > > > > > > > > > {error,timeout} > > > > > > > > > > 2> > > > > > > > > > > > > > > > > > > > > erl -sname matt > > > > > > > > > > Erlang (BEAM) emulator version 5.5.5 [source] [64-bit] > > > > > [async-threads:0] [hipe] [kernel-poll:false] > > > > > > > > > > > > > > > > > > > > Eshell V5.5.5 (abort with ^G) > > > > > > > > > > (matt@REDACTED)1> inet_res:getbyname("_xmpp-server._tcp.digium.com",srv). > > > > > > > > > > {error,timeout} > > > > > > > > > > (matt@REDACTED)2> > > > > > > > > > > > > > > > > > > > > erl -name matt > > > > > > > > > > Erlang (BEAM) emulator version 5.5.5 [source] [64-bit] > > > > > [async-threads:0] [hipe] [kernel-poll:false] > > > > > > > > > > > > > > > > > > > > Eshell V5.5.5 (abort with ^G) > > > > > > > > > > (matt@REDACTED)1> > > > > > inet_res:getbyname("_xmpp-server._tcp.digium.com",srv). > > > > > > > > > > {ok,{hostent,"_xmpp-server._tcp.digium.com", > > > > > > > > > > [], > > > > > > > > > > srv, > > > > > > > > > > 1, > > > > > > > > > > [{5,0,5269,"jabber.digium.com"}]}} > > > > > > > > > > (matt@REDACTED)2> > > > > > > > > > > > > > > > > > > > > > > > > > This seems to have existed since r10b i was wondering if there are any > > > > > intentions on ever fixing it? > > > > > > > > > > Mog > > > > > _______________________________________________ > > > > > erlang-bugs mailing list > > > > > erlang-bugs@REDACTED > > > > > http://www.erlang.org/mailman/listinfo/erlang-bugs > > > > > > > > -- > > > > > > > > / Raimo Niskanen, Erlang/OTP, Ericsson AB > > > > > > > _______________________________________________ > > > erlang-bugs mailing list > > > erlang-bugs@REDACTED > > > http://www.erlang.org/mailman/listinfo/erlang-bugs > > > > -- > > > > / Raimo Niskanen, Erlang/OTP, Ericsson AB > > > From raimo+erlang-bugs@REDACTED Fri Sep 7 18:13:44 2007 From: raimo+erlang-bugs@REDACTED (Raimo Niskanen) Date: Fri, 7 Sep 2007 18:13:44 +0200 Subject: [erlang-bugs] : : inet_res:getbyname In-Reply-To: References: <20070906072823.GA22783@erix.ericsson.se> <20070907081347.GB4406@erix.ericsson.se> Message-ID: <20070907161344.GA11723@erix.ericsson.se> That means you really want to do a DNS query, and only a DNS query, since that kind of lookup is not implemented anywhere else. I will have to look at it again on monday... On Fri, Sep 07, 2007 at 09:00:07AM -0500, Matthew O'Gorman wrote: > also just a quick grep through the source it looks like srv is only > mentioned in inet_res and inet_dns. > > On 9/7/07, Matthew O'Gorman wrote: > > It is used in ejabberd and other projects for looking up srv records, > > something that inet:gethostbyname doesnt appear to do. Which is why I > > was reporting it as a bug. > > > > Mog > > > > On 9/7/07, Raimo Niskanen wrote: > > > The general call is inet:gethostbyname/2. See erl -man inet. > > > There are lots of useful functions there. > > > > > > inet:gethostbyname/2 will in its turn call inet_res:getbyname/2 > > > if 'dns' is in the list returned from inet_db:res_option(lookup). > > > See http://www.erlang.org/doc/apps/erts/part_frame.html: > > > "7 Inet configuration", option 'lookup'. > > > > > > But the default configuration is to have only 'native' in > > > the lookup option list, which will make inet:gethostbyname > > > call inet_gethost_native:gethostbyname, that itself uses > > > a pool of external port programs that call the C resolver > > > library functions. > > > > > > How did you stumble on the inet_res module? It is not documented. > > > > > > > > > > > > On Thu, Sep 06, 2007 at 09:08:43AM -0500, Matthew O'Gorman wrote: > > > > oh im sorry i didn't see that it was deprecated. What is the > > > > replacement for what I am trying to do, or is there no replacement you > > > > just don't intend to support it anymore? > > > > > > > > Matt > > > > > > > > On 9/6/07, Raimo Niskanen wrote: > > > > > Well, since this resolver is kind of deprecated; not really - we have > > > > > paying customers using it, but almost deprecated. The native resolver > > > > > is the one we want everyone to use since it calls the OS resolver > > > > > and therefore should be perfectly bug compatible. > > > > > > > > > > Anyway, we have no strong reasons to put a lot of work into > > > > > inet_res. But if it behaves strangely and we can fix it > > > > > easily we will do it. > > > > > > > > > > I took a quick look into ets:tab2list(inet_db) for both > > > > > -sname and -name and it seems res_domain, res_ns and > > > > > res_search does not get initialized if started with > > > > > -sname. It seems my host resolver configuration file is > > > > > not read (/etc/resolv.conf). This rings a bell about > > > > > cleanups we did about which host configuration files > > > > > are read at startup (/etc{resolv.conf,nsswitch.conf, > > > > > hosts,host.conf,irs.conf,...}. It was a mess and very bug prone. > > > > > The idea is that the native resolver does it right > > > > > so we shall use it. > > > > > > > > > > I have to talk to some people... > > > > > > > > > > Anyway, this means there are workarounds, at least using > > > > > the infamous inetrc file, to set an inet_res configuration of your own. > > > > > > > > > > > > > > > > > > > > On Wed, Sep 05, 2007 at 07:01:57PM -0500, Matthew O'Gorman wrote: > > > > > > inet_res:getbyname fails unless started with -name > > > > > > > > > > > > erl > > > > > > > > > > > > Erlang (BEAM) emulator version 5.5.5 [source] [64-bit] > > > > > > [async-threads:0] [hipe] [kernel-poll:false] > > > > > > > > > > > > > > > > > > > > > > > > Eshell V5.5.5 (abort with ^G) > > > > > > > > > > > > 1> inet_res:getbyname("_xmpp-server._tcp.digium.com",srv). > > > > > > > > > > > > {error,timeout} > > > > > > > > > > > > 2> > > > > > > > > > > > > > > > > > > > > > > > > erl -sname matt > > > > > > > > > > > > Erlang (BEAM) emulator version 5.5.5 [source] [64-bit] > > > > > > [async-threads:0] [hipe] [kernel-poll:false] > > > > > > > > > > > > > > > > > > > > > > > > Eshell V5.5.5 (abort with ^G) > > > > > > > > > > > > (matt@REDACTED)1> inet_res:getbyname("_xmpp-server._tcp.digium.com",srv). > > > > > > > > > > > > {error,timeout} > > > > > > > > > > > > (matt@REDACTED)2> > > > > > > > > > > > > > > > > > > > > > > > > erl -name matt > > > > > > > > > > > > Erlang (BEAM) emulator version 5.5.5 [source] [64-bit] > > > > > > [async-threads:0] [hipe] [kernel-poll:false] > > > > > > > > > > > > > > > > > > > > > > > > Eshell V5.5.5 (abort with ^G) > > > > > > > > > > > > (matt@REDACTED)1> > > > > > > inet_res:getbyname("_xmpp-server._tcp.digium.com",srv). > > > > > > > > > > > > {ok,{hostent,"_xmpp-server._tcp.digium.com", > > > > > > > > > > > > [], > > > > > > > > > > > > srv, > > > > > > > > > > > > 1, > > > > > > > > > > > > [{5,0,5269,"jabber.digium.com"}]}} > > > > > > > > > > > > (matt@REDACTED)2> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > This seems to have existed since r10b i was wondering if there are any > > > > > > intentions on ever fixing it? > > > > > > > > > > > > Mog > > > > > > _______________________________________________ > > > > > > erlang-bugs mailing list > > > > > > erlang-bugs@REDACTED > > > > > > http://www.erlang.org/mailman/listinfo/erlang-bugs > > > > > > > > > > -- > > > > > > > > > > / Raimo Niskanen, Erlang/OTP, Ericsson AB > > > > > > > > > _______________________________________________ > > > > erlang-bugs mailing list > > > > erlang-bugs@REDACTED > > > > http://www.erlang.org/mailman/listinfo/erlang-bugs > > > > > > -- > > > > > > / Raimo Niskanen, Erlang/OTP, Ericsson AB > > > > > > _______________________________________________ > erlang-bugs mailing list > erlang-bugs@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-bugs -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From mogorman@REDACTED Fri Sep 7 19:55:29 2007 From: mogorman@REDACTED (Matthew O'Gorman) Date: Fri, 7 Sep 2007 12:55:29 -0500 Subject: [erlang-bugs] : : inet_res:getbyname In-Reply-To: <20070907161344.GA11723@erix.ericsson.se> References: <20070906072823.GA22783@erix.ericsson.se> <20070907081347.GB4406@erix.ericsson.se> <20070907161344.GA11723@erix.ericsson.se> Message-ID: Exactly, I do want to do a dns query on the srv, currently the only way i know to do that is using inet_res, which is deprecated and broken for everything but -name, if there is to be a replacement or there is another way to make it work I would appreciate knowing it. Mog From ingela@REDACTED Fri Sep 7 13:22:16 2007 From: ingela@REDACTED (Ingela Anderton Andin) Date: Fri, 07 Sep 2007 13:22:16 +0200 Subject: [erlang-bugs] http client hang (on https redirect?) In-Reply-To: References: <46E0173D.3020402@erix.ericsson.se> Message-ID: <46E13468.2020901@erix.ericsson.se> Ok, then we will have to investigate. I have a problem recreating the situation as the link seems to be redirected to a https link, and I have no direct Internet access and alas https through a proxy is not supported as yet by the client. (The reason is that ssl has not had the necessary API functions to implement it. It will soon though.) Well anyway could you do: http:set_options([{verbose, trace}]). **http:request (get, { "http://mitch-alex.blogspot.com/", [] }, [ { timeout, 1000 } ], []). And then send us the result. Regards Ingela - OTP team Paul Mineiro wrote: > I have inets-4.7.16 > > --------- > pmineiro@REDACTED% erl ~ > Erlang (BEAM) emulator version 5.5.5 [source] [async-threads:0] [kernel-poll:false] > > Eshell V5.5.5 (abort with ^G) > 1> http:module_info (). > [{exports,[{request,1}, > {request,4}, > {cancel_request,1}, > {set_options,1}, > {verify_cookies,2}, > {cookie_header,1}, > {module_info,0}, > {module_info,1}]}, > {imports,[]}, > {attributes,[{vsn,[106656174981009331805006427346058383543]}, > {app_vsn,"inets-4.7.16"}]}, > {compile,[{options,[{d,'SERVER_SOFTWARE',"inets/4.7.16"}, > {cwd,"/ldisk/daily_build/otp_prebuild_r11b.2007-06-11_19/otp_src_R11B-5/lib/inets/src/http_client"}, > {outdir,"/ldisk/daily_build/otp_prebuild_r11b.2007-06-11_19/otp_src_R11B-5/lib/inets/src/http_client/../../ebin"}, > {i,"/ldisk/daily_build/otp_prebuild_r11b.2007-06-11_19/otp_src_R11B-5/lib/inets/src/http_client/../http_lib"}, > {i,"/ldisk/daily_build/otp_prebuild_r11b.2007-06-11_19/otp_src_R11B-5/lib/inets/src/http_client/../inets_app"}, > {attribute,insert,app_vsn,"inets-4.7.16"}, > {parse_transform,sys_pre_attributes}, > debug_info]}, > {version,"4.4.5"}, > {time,{2007,6,11,17,54,41}}, > {source,"/ldisk/daily_build/otp_prebuild_r11b.2007-06-11_19/otp_src_R11B-5/lib/inets/src/http_client/http.erl"}]}] > 2> http:request (get, { "http://mitch-alex.blogspot.com/", [] }, [ { timeout, 1000 } ], []). > > =INFO REPORT==== 6-Sep-2007::08:58:55 === > The inets application was not started. Has now been started as a temporary application. > > BREAK: (a)bort (c)ontinue (p)roc info (i)nfo (l)oaded > (v)ersion (k)ill (D)b-tables (d)istribution > a > ---------- > > Thanks, > > -- p > > On Thu, 6 Sep 2007, Ingela Anderton Andin wrote: > > >> Hi! >> >> This sounds like a bug that was fixed in inets-4.7.16. >> Could you make sure you have that version, and if there is still a problem >> contact us again. >> >> Regards Ingela - OTP team >> >> >> >>> Dear maintainers, >>> >>> When I try >>> ------------ >>> % erl >>> Erlang (BEAM) emulator version 5.5.5 [source] [async-threads:0] >>> [kernel-poll:false] >>> >>> Eshell V5.5.5 (abort with ^G) >>> 1> http:request ("http://mitch-alex.blogspot.com/"). >>> >>> =INFO REPORT==== 3-Sep-2007::13:00:25 === >>> The inets application was not started. Has now been started as a temporary >>> application. >>> ------------ >>> >>> it just hangs there. If I set a timeout this does not help >>> >>> ------------ >>> % erl ~ >>> Erlang (BEAM) emulator version 5.5.5 [source] [async-threads:0] [kernel-poll:false] >>> >>> Eshell V5.5.5 (abort with ^G) >>> 1> http:request (get, { "http://mitch-alex.blogspot.com/", [] }, [ { timeout, 1000 } ], []). >>> >>> =INFO REPORT==== 3-Sep-2007::13:02:54 === >>> The inets application was not started. Has now been started as a temporary application. >>> ------------ >>> >>> I also tried setting a Connection: close header but that didn't help >>> either. >>> >>> ------------ >>> Eshell V5.5.5 (abort with ^G) >>> 1> http:request (get, { "http://mitch-alex.blogspot.com/", [ { "connection", "close" } ] }, [ { timeout, 1000 } ], []). >>> >>> =INFO REPORT==== 3-Sep-2007::13:06:20 === >>> The inets application was not started. Has now been started as a temporary application. >>> ------------ >>> >>> Using telnet the page is being redirected to an https: url >>> >>> ------------ >>> % telnet mitch-alex.blogspot.com 80 ~ >>> Trying 72.14.207.191... >>> Connected to blogspot.l.google.com. >>> Escape character is '^]'. >>> GET / HTTP/1.1 >>> Host: mitch-alex.blogspot.com >>> Connection: close >>> >>> HTTP/1.1 302 Moved Temporarily >>> Location: https://www.blogger.com/blogin.g?blogspotURL=http%3A%2F%2Fmitch-alex.blogspot.com%2F >>> Content-Type: text/html; charset=UTF-8 >>> Cache-control: private >>> Content-Length: 266 >>> Date: Mon, 03 Sep 2007 20:05:43 GMT >>> Server: GFE/1.3 >>> >>> >>> >>> Moved Temporarily >>> >>> >>>

Moved Temporarily

>>> The document has moved here. >>> >>> >>> Connection closed by foreign host. >>> ------------- >>> >>> I don't know if that is the reason for the difficulty. >>> >>> Thanks, >>> >> > > Speakers of right-to-left languages use web 0.2 > _______________________________________________ > erlang-bugs mailing list > erlang-bugs@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-bugs > > From mikma264@REDACTED Sat Sep 8 11:41:37 2007 From: mikma264@REDACTED (Mikael Magnusson) Date: Sat, 08 Sep 2007 11:41:37 +0200 Subject: [erlang-bugs] : : inet_res:getbyname In-Reply-To: References: <20070906072823.GA22783@erix.ericsson.se> <20070907081347.GB4406@erix.ericsson.se> <20070907161344.GA11723@erix.ericsson.se> Message-ID: <46E26E51.2000201@gmail.com> Matthew O'Gorman wrote: > Exactly, I do want to do a dns query on the srv, currently the only > way i know to do that is using inet_res, which is deprecated and > broken for everything but -name, if there is to be a replacement or > there is another way to make it work I would appreciate knowing it. > > Mog I'm able to use inet_res also on nodes with short names (-sname) if I call inet_db:add_resolv: inet_db:add_resolv("/etc/resolv.conf"). Btw, why not always use long node names (-name)? Mikael From raimo+erlang-bugs@REDACTED Mon Sep 10 09:45:20 2007 From: raimo+erlang-bugs@REDACTED (Raimo Niskanen) Date: Mon, 10 Sep 2007 09:45:20 +0200 Subject: [erlang-bugs] : : : inet_res:getbyname In-Reply-To: <46E26E51.2000201@gmail.com> References: <20070906072823.GA22783@erix.ericsson.se> <20070907081347.GB4406@erix.ericsson.se> <20070907161344.GA11723@erix.ericsson.se> <46E26E51.2000201@gmail.com> Message-ID: <20070910074520.GB22979@erix.ericsson.se> Well, it is deprecated for A and AAAA lookups since it was impossible to make it behave like the native resolver on all platforms. For DNS lookups where you really want just a DNS lookup it is still needed, so we can not remove it and have to fix bugs in it. In other words: it is and will be maintained. That it only works in conjunction with the -name option I also regard as a bug, but behaviour in this area has always been very sensitive to change, so improving this might break code for paying customers. I will try to investigate the possibility to always read /etc/resolv.conf on all Unixes to set up inet_res. That does not sound like a too dangerous change for R12, but I do not have the final word here... The workaround below does work, but that function is on the "possible to remove" list. Another more supported way of doing exactly the same thing is to create a file e.g "~/.inetrc" containing: ---------------cut {file,resolv,"/etc/resolv.conf"}. ---------------cut and then either set the environment variable ERL_INETRC="~/.inetrc" or, set the Erlang kernel application parameter "inetrc" to the same filename either on the command line like this: $ erl -kernel inetrc "\"~/.inetrc\"" or in the Erlang start script (I have never done it). On Sat, Sep 08, 2007 at 11:41:37AM +0200, Mikael Magnusson wrote: > Matthew O'Gorman wrote: > > Exactly, I do want to do a dns query on the srv, currently the only > > way i know to do that is using inet_res, which is deprecated and > > broken for everything but -name, if there is to be a replacement or > > there is another way to make it work I would appreciate knowing it. > > > > Mog > > I'm able to use inet_res also on nodes with short names (-sname) if I > call inet_db:add_resolv: > > inet_db:add_resolv("/etc/resolv.conf"). > > Btw, why not always use long node names (-name)? > > Mikael > _______________________________________________ > erlang-bugs mailing list > erlang-bugs@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-bugs -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From mogorman@REDACTED Mon Sep 10 10:14:56 2007 From: mogorman@REDACTED (Matthew O'Gorman) Date: Mon, 10 Sep 2007 03:14:56 -0500 Subject: [erlang-bugs] : : : inet_res:getbyname In-Reply-To: <20070910074520.GB22979@erix.ericsson.se> References: <20070906072823.GA22783@erix.ericsson.se> <20070907081347.GB4406@erix.ericsson.se> <20070907161344.GA11723@erix.ericsson.se> <46E26E51.2000201@gmail.com> <20070910074520.GB22979@erix.ericsson.se> Message-ID: any possible solutions for windows users? I ask as the reason I posted in first place is my friend installed ejabberd for windows and didnt work out of the box for him do to this issue. I was able to get it working for him with -name though, so he is fine now, I just imagine its a common problem. Anyways thanks for looking in to it and letting me know it will be supported and maintained. Mog On 9/10/07, Raimo Niskanen wrote: > Well, it is deprecated for A and AAAA lookups since it was > impossible to make it behave like the native resolver on all > platforms. For DNS lookups where you really want just a DNS > lookup it is still needed, so we can not remove it and > have to fix bugs in it. > > In other words: it is and will be maintained. > > That it only works in conjunction with the -name option > I also regard as a bug, but behaviour in this area has always > been very sensitive to change, so improving this might > break code for paying customers. > > I will try to investigate the possibility to always read > /etc/resolv.conf on all Unixes to set up inet_res. That does > not sound like a too dangerous change for R12, but I do not > have the final word here... > > The workaround below does work, but that function is on the > "possible to remove" list. Another more supported way of > doing exactly the same thing is to create a file e.g > "~/.inetrc" containing: > ---------------cut > {file,resolv,"/etc/resolv.conf"}. > ---------------cut > and then either set the environment variable > ERL_INETRC="~/.inetrc" > or, set the Erlang kernel application parameter "inetrc" to > the same filename either on the command line like this: > $ erl -kernel inetrc "\"~/.inetrc\"" > or in the Erlang start script (I have never done it). > > > > On Sat, Sep 08, 2007 at 11:41:37AM +0200, Mikael Magnusson wrote: > > Matthew O'Gorman wrote: > > > Exactly, I do want to do a dns query on the srv, currently the only > > > way i know to do that is using inet_res, which is deprecated and > > > broken for everything but -name, if there is to be a replacement or > > > there is another way to make it work I would appreciate knowing it. > > > > > > Mog > > > > I'm able to use inet_res also on nodes with short names (-sname) if I > > call inet_db:add_resolv: > > > > inet_db:add_resolv("/etc/resolv.conf"). > > > > Btw, why not always use long node names (-name)? > > > > Mikael > > _______________________________________________ > > erlang-bugs mailing list > > erlang-bugs@REDACTED > > http://www.erlang.org/mailman/listinfo/erlang-bugs > > -- > > / Raimo Niskanen, Erlang/OTP, Ericsson AB > _______________________________________________ > erlang-bugs mailing list > erlang-bugs@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-bugs > From samuelrivas@REDACTED Mon Sep 10 11:57:36 2007 From: samuelrivas@REDACTED (Samuel Rivas) Date: Mon, 10 Sep 2007 11:57:36 +0200 Subject: [erlang-bugs] filelib:wildcard Message-ID: <20070910095736.GA8940@lambdastream.com> Hi, I'm getting strange results with filelib:wildcard/2 (tested in R11B-1 and R11B-5): 3> filelib:wildcard("ebin/*.app", "/home/samuel/local/src/yaws"). [] 4> filelib:wildcard("*/*.app", "/home/samuel/local/src/yaws"). ["ebin/yaws.app"] If I move to Cwd it works as I expected (even though it is a symlink): 8> cd("/home/samuel/local/src/yaws"). /var/local/scratch/samuel/src/yaws-1.58 ok 9> filelib:wildcard("ebin/*.app", "/home/samuel/local/src/yaws"). ["ebin/yaws.app"] If this is a bug, a simple workaround is using filelib:wildcard/1 and filename:join/2 to build an absolute wildcard. Regards -- Samuel From raimo+erlang-bugs@REDACTED Mon Sep 10 12:02:40 2007 From: raimo+erlang-bugs@REDACTED (Raimo Niskanen) Date: Mon, 10 Sep 2007 12:02:40 +0200 Subject: [erlang-bugs] : : : : inet_res:getbyname In-Reply-To: References: <20070906072823.GA22783@erix.ericsson.se> <20070907081347.GB4406@erix.ericsson.se> <20070907161344.GA11723@erix.ericsson.se> <46E26E51.2000201@gmail.com> <20070910074520.GB22979@erix.ericsson.se> Message-ID: <20070910100240.GA27329@erix.ericsson.se> If you could test a solution for me it would be nice (Windows is a bit in the backwater here; we build and test but our personal build and test platform is Solaris8 as for now). Test the same solution I described below, but the file contents should be: ---------------cut {registry,win32}. ---------------cut That should load the data corresponding to /etc/hosts and /etc/resolv.conf. The /etc/hosts data will not be used (unless you have 'file' in the lookup order (that defaults to 'native' only)). This could (if it works fine) be something to always do on Windows to initialize inet_res. On Mon, Sep 10, 2007 at 03:14:56AM -0500, Matthew O'Gorman wrote: > any possible solutions for windows users? I ask as the reason I posted > in first place is my friend installed ejabberd for windows and didnt > work out of the box for him do to this issue. I was able to get it > working for him with -name though, so he is fine now, I just imagine > its a common problem. > Anyways thanks for looking in to it and letting me know it will be > supported and maintained. > > Mog > > On 9/10/07, Raimo Niskanen wrote: > > Well, it is deprecated for A and AAAA lookups since it was > > impossible to make it behave like the native resolver on all > > platforms. For DNS lookups where you really want just a DNS > > lookup it is still needed, so we can not remove it and > > have to fix bugs in it. > > > > In other words: it is and will be maintained. > > > > That it only works in conjunction with the -name option > > I also regard as a bug, but behaviour in this area has always > > been very sensitive to change, so improving this might > > break code for paying customers. > > > > I will try to investigate the possibility to always read > > /etc/resolv.conf on all Unixes to set up inet_res. That does > > not sound like a too dangerous change for R12, but I do not > > have the final word here... > > > > The workaround below does work, but that function is on the > > "possible to remove" list. Another more supported way of > > doing exactly the same thing is to create a file e.g > > "~/.inetrc" containing: > > ---------------cut > > {file,resolv,"/etc/resolv.conf"}. > > ---------------cut > > and then either set the environment variable > > ERL_INETRC="~/.inetrc" > > or, set the Erlang kernel application parameter "inetrc" to > > the same filename either on the command line like this: > > $ erl -kernel inetrc "\"~/.inetrc\"" > > or in the Erlang start script (I have never done it). > > > > > > > > On Sat, Sep 08, 2007 at 11:41:37AM +0200, Mikael Magnusson wrote: > > > Matthew O'Gorman wrote: > > > > Exactly, I do want to do a dns query on the srv, currently the only > > > > way i know to do that is using inet_res, which is deprecated and > > > > broken for everything but -name, if there is to be a replacement or > > > > there is another way to make it work I would appreciate knowing it. > > > > > > > > Mog > > > > > > I'm able to use inet_res also on nodes with short names (-sname) if I > > > call inet_db:add_resolv: > > > > > > inet_db:add_resolv("/etc/resolv.conf"). > > > > > > Btw, why not always use long node names (-name)? > > > > > > Mikael > > > _______________________________________________ > > > erlang-bugs mailing list > > > erlang-bugs@REDACTED > > > http://www.erlang.org/mailman/listinfo/erlang-bugs > > > > -- > > > > / Raimo Niskanen, Erlang/OTP, Ericsson AB > > _______________________________________________ > > erlang-bugs mailing list > > erlang-bugs@REDACTED > > http://www.erlang.org/mailman/listinfo/erlang-bugs > > > _______________________________________________ > erlang-bugs mailing list > erlang-bugs@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-bugs -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From mogorman@REDACTED Tue Sep 11 01:23:14 2007 From: mogorman@REDACTED (Matthew O'Gorman) Date: Mon, 10 Sep 2007 18:23:14 -0500 Subject: [erlang-bugs] : : : : inet_res:getbyname In-Reply-To: <20070910100240.GA27329@erix.ericsson.se> References: <20070906072823.GA22783@erix.ericsson.se> <20070907081347.GB4406@erix.ericsson.se> <20070907161344.GA11723@erix.ericsson.se> <46E26E51.2000201@gmail.com> <20070910074520.GB22979@erix.ericsson.se> <20070910100240.GA27329@erix.ericsson.se> Message-ID: On my friends box that did not solve the problem, all queries there just fail, however on is box I was also unable to use -name as it crashed the shell, saying it couldn't get long name. Mog On 9/10/07, Raimo Niskanen wrote: > If you could test a solution for me it would be nice (Windows is a bit > in the backwater here; we build and test but our personal build and > test platform is Solaris8 as for now). > > Test the same solution I described below, but the file contents should be: > ---------------cut > {registry,win32}. > ---------------cut > That should load the data corresponding to /etc/hosts and /etc/resolv.conf. > The /etc/hosts data will not be used (unless you have 'file' in the lookup > order (that defaults to 'native' only)). > > This could (if it works fine) be something to always do on Windows > to initialize inet_res. > > > > On Mon, Sep 10, 2007 at 03:14:56AM -0500, Matthew O'Gorman wrote: > > any possible solutions for windows users? I ask as the reason I posted > > in first place is my friend installed ejabberd for windows and didnt > > work out of the box for him do to this issue. I was able to get it > > working for him with -name though, so he is fine now, I just imagine > > its a common problem. > > Anyways thanks for looking in to it and letting me know it will be > > supported and maintained. > > > > Mog > > > > On 9/10/07, Raimo Niskanen wrote: > > > Well, it is deprecated for A and AAAA lookups since it was > > > impossible to make it behave like the native resolver on all > > > platforms. For DNS lookups where you really want just a DNS > > > lookup it is still needed, so we can not remove it and > > > have to fix bugs in it. > > > > > > In other words: it is and will be maintained. > > > > > > That it only works in conjunction with the -name option > > > I also regard as a bug, but behaviour in this area has always > > > been very sensitive to change, so improving this might > > > break code for paying customers. > > > > > > I will try to investigate the possibility to always read > > > /etc/resolv.conf on all Unixes to set up inet_res. That does > > > not sound like a too dangerous change for R12, but I do not > > > have the final word here... > > > > > > The workaround below does work, but that function is on the > > > "possible to remove" list. Another more supported way of > > > doing exactly the same thing is to create a file e.g > > > "~/.inetrc" containing: > > > ---------------cut > > > {file,resolv,"/etc/resolv.conf"}. > > > ---------------cut > > > and then either set the environment variable > > > ERL_INETRC="~/.inetrc" > > > or, set the Erlang kernel application parameter "inetrc" to > > > the same filename either on the command line like this: > > > $ erl -kernel inetrc "\"~/.inetrc\"" > > > or in the Erlang start script (I have never done it). > > > > > > > > > > > > On Sat, Sep 08, 2007 at 11:41:37AM +0200, Mikael Magnusson wrote: > > > > Matthew O'Gorman wrote: > > > > > Exactly, I do want to do a dns query on the srv, currently the only > > > > > way i know to do that is using inet_res, which is deprecated and > > > > > broken for everything but -name, if there is to be a replacement or > > > > > there is another way to make it work I would appreciate knowing it. > > > > > > > > > > Mog > > > > > > > > I'm able to use inet_res also on nodes with short names (-sname) if I > > > > call inet_db:add_resolv: > > > > > > > > inet_db:add_resolv("/etc/resolv.conf"). > > > > > > > > Btw, why not always use long node names (-name)? > > > > > > > > Mikael > > > > _______________________________________________ > > > > erlang-bugs mailing list > > > > erlang-bugs@REDACTED > > > > http://www.erlang.org/mailman/listinfo/erlang-bugs > > > > > > -- > > > > > > / Raimo Niskanen, Erlang/OTP, Ericsson AB > > > _______________________________________________ > > > erlang-bugs mailing list > > > erlang-bugs@REDACTED > > > http://www.erlang.org/mailman/listinfo/erlang-bugs > > > > > _______________________________________________ > > erlang-bugs mailing list > > erlang-bugs@REDACTED > > http://www.erlang.org/mailman/listinfo/erlang-bugs > > -- > > / Raimo Niskanen, Erlang/OTP, Ericsson AB > From s.egner@REDACTED Wed Sep 12 14:37:15 2007 From: s.egner@REDACTED (Sebastian Egner) Date: Wed, 12 Sep 2007 14:37:15 +0200 Subject: [erlang-bugs] possible bug in 'ic' (the CORBA IDL compiler) Message-ID: <46E7DD7B.8010909@specs.de> Dear maintainers, The IDL compiler 'ic' seems to produce invalid Erlang code for a CORBA module I have. The code offending the Erlang compiler (R11B-5) looks like this: % 668 correct lines left out... oe_tc('GetDwellTimeLimits') -> 'Device_I_SyncDataDevice':oe_tc(GetDwellTimeLimits); % ...lots of other lines with unbound variables that are probably meant to be atoms. The IDL is a part in a larger set of IDLs, which I could provide for inspection if necessary. Sebastian. From nick@REDACTED Thu Sep 13 15:36:02 2007 From: nick@REDACTED (Niclas Eklund) Date: Thu, 13 Sep 2007 15:36:02 +0200 (MEST) Subject: [erlang-bugs] possible bug in 'ic' (the CORBA IDL compiler) Message-ID: Hello! It will be fixed in the next release. Update the following in the ic_erlbe.erl module or use the attached file: 291,292c291,292 < emit(Fd, "oe_tc(~p) -> ~p:oe_tc(~s);\n", < [FunctionAtom, N, Function]), --- > emit(Fd, "oe_tc(~p) -> ~p:oe_tc(~p);\n", > [FunctionAtom, N, FunctionAtom]), /Nick > Date: Wed, 12 Sep 2007 14:37:15 +0200 > From: Sebastian Egner > To: erlang-bugs@REDACTED > > Dear maintainers, > > The IDL compiler 'ic' seems to produce invalid Erlang code for a CORBA > module I have. > > The code offending the Erlang compiler (R11B-5) looks like this: > > % 668 correct lines left out... > oe_tc('GetDwellTimeLimits') -> > 'Device_I_SyncDataDevice':oe_tc(GetDwellTimeLimits); > % ...lots of other lines with unbound variables that are probably meant > to be atoms. > > The IDL is a part in a larger set of IDLs, which I could provide for > inspection if necessary. > > Sebastian. > _______________________________________________ > erlang-bugs mailing list > erlang-bugs@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-bugs > -------------- next part -------------- %% ``The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in %% compliance with the License. You should have received a copy of the %% Erlang Public License along with this software. If not, it can be %% retrieved via the world wide web at http://www.erlang.org/. %% %% Software distributed under the License is distributed on an "AS IS" %% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See %% the License for the specific language governing rights and limitations %% under the License. %% %% The Initial Developer of the Original Code is Ericsson Utvecklings AB. %% Portions created by Ericsson are Copyright 1999, Ericsson Utvecklings %% AB. All Rights Reserved.'' %% %% $Id$ %% -module(ic_erlbe). -export([do_gen/3]). %%------------------------------------------------------------ %% %% Internal stuff %% %%------------------------------------------------------------ -export([unfold/1, mk_attr_func_names/2]). -import(ic_util, [mk_name/2, mk_var/1, mk_oe_name/2, to_atom/1, to_list/1]). -import(ic_forms, [get_id/1, get_id2/1, get_body/1, is_oneway/1]). -import(ic_codegen, [emit/2, emit/3, nl/1]). -import(ic_options, [get_opt/2]). -import(lists, [foreach/2, foldr/3, map/2]). -include("icforms.hrl"). -include("ic.hrl"). -include_lib("stdlib/include/erl_compile.hrl"). %%------------------------------------------------------------ %% %% Generate the client side Erlang stubs. %% %% Each module is generated to a separate file. %% %% Export declarations for all interface functions must be %% generated. Each function then needs to generate a function head and %% a body. IDL parameters must be converted into Erlang parameters %% (variables, capitalised) and a type signature list must be %% generated (for later encode/decode). %% %%------------------------------------------------------------ do_gen(G, File, Form) -> GT = get_opt(G, be), G2 = ic_file:filename_push(G, [], mk_oe_name(G, ic_file:remove_ext(to_list(File))), erlang), Light = ic_options:get_opt(G, light_ifr), R = if GT == erl_corba, Light == false -> case ic_genobj:is_stubfile_open(G2) of true -> emit(ic_genobj:stubfiled(G2), "-include_lib(\"~s/include/~s\").\n\n", [?ORBNAME, ?IFRTYPESHRL]); false -> ok end, gen_head(G2, [], Form), ic_codegen:export(ic_genobj:stubfiled(G2), [{ictk:register_name(G2), 0}, {ictk:unregister_name(G2), 0}, {oe_get_module,5}, {oe_dependency,0}]), R0= gen(G2, [], Form), ictk:reg_gen(G2, [], Form), ictk:unreg_gen(G2, [], Form), % "new" unreg_gen/3 genDependency(G2), % creates code for dependency list R0; GT == erl_corba, Light == true -> case ic_genobj:is_stubfile_open(G2) of true -> emit(ic_genobj:stubfiled(G2), "-include_lib(\"~s/include/~s\").\n\n", [?ORBNAME, ?IFRTYPESHRL]); false -> ok end, gen_head(G2, [], Form), ic_codegen:export(ic_genobj:stubfiled(G2), [{ictk:register_name(G2), 0}, {ictk:register_name(G2), 1}, {ictk:unregister_name(G2), 0}, {ictk:unregister_name(G2), 1}]), R0= gen(G2, [], Form), ictk:reg_gen(G2, [], Form), ictk:unreg_gen(G2, [], Form), % "new" unreg_gen/3 R0; true -> gen_head(G2, [], Form), gen(G2, [], Form) end, ic_file:filename_pop(G2, erlang), R. gen(G, N, [X|Xs]) when record(X, preproc) -> NewG = ic:handle_preproc(G, N, X#preproc.cat, X), gen(NewG, N, Xs); gen(G, N, [X|Xs]) when record(X, module) -> CD = ic_code:codeDirective(G,X), G2 = ic_file:filename_push(G, N, X, CD), N2 = [get_id2(X) | N], gen_head(G2, N2, X), gen(G2, N2, get_body(X)), G3 = ic_file:filename_pop(G2, CD), gen(G3, N, Xs); gen(G, N, [X|Xs]) when record(X, interface) -> G2 = ic_file:filename_push(G, N, X, erlang), N2 = [get_id2(X) | N], gen_head(G2, N2, X), gen(G2, N2, get_body(X)), foreach(fun({_Name, Body}) -> gen(G2, N2, Body) end, X#interface.inherit_body), gen_serv(G2, N, X), G3 = ic_file:filename_pop(G2, erlang), gen(G3, N, Xs); gen(G, N, [X|Xs]) when record(X, const) -> % N2 = [get_id2(X) | N], emit_constant_func(G, X#const.id, X#const.val), gen(G, N, Xs); %% N2 or N? gen(G, N, [X|Xs]) when record(X, op) -> {Name, ArgNames, TypeList, OutArgs} = extract_info(G, N, X), emit_stub_func(G, N, X, Name, ArgNames, TypeList, OutArgs, is_oneway(X), get_opt(G, be)), gen(G, N, Xs); gen(G, N, [X|Xs]) when record(X, attr) -> emit_attr(G, N, X, fun emit_stub_func/9), gen(G, N, Xs); gen(G, N, [X|Xs]) when record(X, except) -> icstruct:except_gen(G, N, X, erlang), gen(G, N, Xs); gen(G, N, [X|Xs]) -> case may_contain_structs(X) of true -> icstruct:struct_gen(G, N, X, erlang); false -> ok end, gen(G, N, Xs); gen(_G, _N, []) -> ok. may_contain_structs(X) when record(X, typedef) -> true; may_contain_structs(X) when record(X, struct) -> true; may_contain_structs(X) when record(X, union) -> true; may_contain_structs(_X) -> false. %%-------------------------------------------------------------------- %% %% Generate the server side (handle_call and handle_cast) %% gen_serv(G, N, X) -> case ic_genobj:is_stubfile_open(G) of true -> GT = get_opt(G, be), gen_oe_is_a(G, N, X, GT), N2 = [get_id2(X) | N], gen_oe_tc(G, N2, X, GT), emit_serv_std(GT, G, N, X), gen_calls(G, N2, get_body(X)), lists:foreach(fun({_Name, Body}) -> gen_calls(G, N2, Body) end, X#interface.inherit_body), gen_end_of_call(GT, G), gen_casts(G, N2, get_body(X)), lists:foreach(fun({_Name, Body}) -> gen_casts(G, N2, Body) end, X#interface.inherit_body), gen_end_of_cast(GT, G), emit_skel_footer(GT, G, N, X); % Note N instead of N2 false -> ok end. gen_oe_is_a(G, N, X, erl_corba) when record(X, interface) -> Fd = ic_genobj:stubfiled(G), ic_codegen:mcomment(Fd, ["Inherited Interfaces"]), emit(Fd, "oe_is_a(~p) -> true;\n", [ictk:get_IR_ID(G, N, X)]), lists:foreach(fun(ScopedName) -> emit(Fd, "oe_is_a(~p) -> true;\n", [ic_pragma:scope2id(G, ScopedName)]) end, X#interface.inherit), emit(Fd, "oe_is_a(_) -> false.\n"), nl(Fd), ok; gen_oe_is_a(_G, _N, _X, _BE) -> ok. %% Generates the oe_tc function gen_oe_tc(G, N, X, erl_corba) -> Fd = ic_genobj:stubfiled(G), ic_codegen:mcomment(Fd, ["Interface TypeCode"]), LocalInterface = gen_oe_tc2(G, N, get_body(X), Fd, []), CompleteInterface = lists:foldl(fun({Name, Body}, FunAcc) -> AName = ic_util:to_atom(ic_util:to_undersc(Name)), gen_oe_tc3(G, AName, Body, Fd, FunAcc) end, LocalInterface, X#interface.inherit_body), emit(Fd, "oe_tc(_) -> undefined.\n"), nl(Fd), emit(Fd, "oe_get_interface() -> \n\t["), emit_oe_get_interface(Fd, CompleteInterface), nl(Fd), ok; gen_oe_tc(_, _, _, _) -> ok. emit_oe_get_interface(Fd, []) -> emit(Fd, "].\n"); emit_oe_get_interface(Fd, [Item]) -> emit(Fd, "~s].\n", [lists:flatten(Item)]); emit_oe_get_interface(Fd, [H|T]) -> emit(Fd, "~s,\n\t", [lists:flatten(H)]), emit_oe_get_interface(Fd, T). gen_oe_tc2(_,_,[],_, Acc) -> Acc; gen_oe_tc2(G, N, [X|Rest], Fd, Acc) when record(X, op) -> R = ic_forms:get_tk(X), IN = lists:map(fun(P) -> ic_forms:get_tk(P) end, ic:filter_params([in, inout], X#op.params)), OUT = lists:map(fun(P) -> ic_forms:get_tk(P) end, ic:filter_params([out, inout], X#op.params)), Function = get_id2(X), FunctionAtom = ic_util:to_atom(Function), emit(Fd, "oe_tc(~p) -> \n\t~p;\n",[FunctionAtom, {R, IN, OUT}]), GI = io_lib:format("{~p, oe_tc(~p)}",[Function, FunctionAtom]), gen_oe_tc2(G, N, Rest, Fd, [GI|Acc]); gen_oe_tc2(G, N, [X|Rest], Fd, Acc) when record(X, attr) -> {GetT, SetT} = mk_attr_func_types([], X), NewAcc = lists:foldl(fun(Id, FunAcc) -> {Get, Set} = mk_attr_func_names([], get_id(Id)), GetAttrAtom = ic_util:to_atom(Get), emit(Fd, "oe_tc(~p) -> \n\t~p;\n", [GetAttrAtom, GetT]), case X#attr.readonly of {readonly, _} -> GI = io_lib:format("{~p, oe_tc(~p)}", [Get, GetAttrAtom]), [GI|FunAcc]; _ -> SetAttrAtom = ic_util:to_atom(Set), emit(Fd, "oe_tc(~p) -> \n\t~p;\n", [SetAttrAtom, SetT]), GetGI = io_lib:format("{~p, oe_tc(~p)}", [Get, GetAttrAtom]), SetGI = io_lib:format("{~p, oe_tc(~p)}", [Set, SetAttrAtom]), [GetGI, SetGI|FunAcc] end end, Acc, ic_forms:get_idlist(X)), gen_oe_tc2(G, N, Rest, Fd, NewAcc); gen_oe_tc2(G,N,[_X|Rest], Fd, Acc) -> gen_oe_tc2(G,N,Rest, Fd, Acc). gen_oe_tc3(_,_,[],_, Acc) -> Acc; gen_oe_tc3(G, N, [X|Rest], Fd, Acc) when record(X, op) -> Function = get_id2(X), FunctionAtom = ic_util:to_atom(get_id2(X)), GI = io_lib:format("{~p, ~p:oe_tc(~p)}",[Function, N, FunctionAtom]), emit(Fd, "oe_tc(~p) -> ~p:oe_tc(~p);\n", [FunctionAtom, N, FunctionAtom]), gen_oe_tc3(G, N, Rest, Fd, [GI|Acc]); gen_oe_tc3(G, N, [X|Rest], Fd, Acc) when record(X, attr) -> NewAcc = lists:foldl(fun(Id, FunAcc) -> {Get, Set} = mk_attr_func_names([], get_id(Id)), GetAttrAtom = ic_util:to_atom(Get), emit(Fd, "oe_tc(~p) -> ~p:oe_tc(~p);\n", [GetAttrAtom, N, GetAttrAtom]), case X#attr.readonly of {readonly, _} -> [io_lib:format("{~p, ~p:oe_tc(~p)}", [Get, N, GetAttrAtom])|FunAcc]; _ -> SetAttrAtom = ic_util:to_atom(Set), emit(Fd, "oe_tc(~p) -> ~p:oe_tc(~p);\n", [SetAttrAtom, N, SetAttrAtom]), [io_lib:format("{~p, ~p:oe_tc(~p)}", [Get, N, GetAttrAtom]), io_lib:format("{~p, ~p:oe_tc(~p)}", [Set, N, SetAttrAtom])|FunAcc] end end, Acc, ic_forms:get_idlist(X)), gen_oe_tc3(G, N, Rest, Fd, NewAcc); gen_oe_tc3(G,N,[_X|Rest], Fd, Acc) -> gen_oe_tc3(G,N,Rest, Fd, Acc). gen_calls(G, N, [X|Xs]) when record(X, op) -> case is_oneway(X) of false -> {Name, ArgNames, TypeList, OutArgs} = extract_info(G, N, X), emit_skel_func(G, N, X, Name, ArgNames, TypeList, OutArgs, false, get_opt(G, be)), gen_calls(G, N, Xs); true -> gen_calls(G, N, Xs) end; gen_calls(G, N, [X|Xs]) when record(X, attr) -> emit_attr(G, N, X, fun emit_skel_func/9), gen_calls(G, N, Xs); gen_calls(G, N, [_X|Xs]) -> gen_calls(G, N, Xs); gen_calls(_G, _N, []) -> ok. gen_casts(G, N, [X|Xs]) when record(X, op) -> case is_oneway(X) of true -> {Name, ArgNames, TypeList, OutArgs} = extract_info(G, N, X), emit_skel_func(G, N, X, Name, ArgNames, TypeList, OutArgs, true, get_opt(G, be)), gen_casts(G, N, Xs); false -> gen_casts(G, N, Xs) end; gen_casts(G, N, [_X|Xs]) -> gen_casts(G, N, Xs); gen_casts(_G, _N, []) -> ok. emit_attr(G, N, X, F) -> XX = #id_of{type=X}, BE = get_opt(G, be), {GetType, SetType} = mk_attr_func_types(N, X), lists:foreach(fun(Id) -> X2 = XX#id_of{id=Id}, {Get, Set} = mk_attr_func_names(N, get_id(Id)), F(G, N, X2, Get, [], GetType, [], is_oneway(X2), BE), case X#attr.readonly of {readonly, _} -> ok; _ -> F(G, N, X2, Set, [mk_name(G, "Value")], SetType, [], is_oneway(X2), BE) end end, ic_forms:get_idlist(X)). extract_info(G, _N, X) when record(X, op) -> Name = get_id2(X), InArgs = ic:filter_params([in,inout], X#op.params), OutArgs = ic:filter_params([out,inout], X#op.params), ArgNames = mk_erl_vars(G, InArgs), TypeList = {ic_forms:get_tk(X), map(fun(Y) -> ic_forms:get_tk(Y) end, InArgs), map(fun(Y) -> ic_forms:get_tk(Y) end, OutArgs) }, {Name, ArgNames, TypeList, OutArgs}. %% This function generates the standard functions of an object %% gen_server emit_serv_std(erl_corba, G, N, X) -> Fd = ic_genobj:stubfiled(G), Impl = ic_genobj:impl(G), TypeID = ictk:get_IR_ID(G, N, X), nl(Fd), nl(Fd), nl(Fd), ic_codegen:mcomment(Fd, ["Object server implementation."]), nl(Fd), nl(Fd), ic_codegen:mcomment(Fd, ["Function for fetching the interface type ID."]), nl(Fd), emit(Fd, "typeID() ->\n"), emit(Fd, " \"~s\".\n", [TypeID]), nl(Fd), nl(Fd), ic_codegen:mcomment(Fd, ["Object creation functions."]), nl(Fd), emit(Fd, "oe_create() ->\n"), emit(Fd, " corba:create(?MODULE, \"~s\").\n", [TypeID]), nl(Fd), emit(Fd, "oe_create_link() ->\n"), emit(Fd, " corba:create_link(?MODULE, \"~s\").\n", [TypeID]), nl(Fd), emit(Fd, "oe_create(Env) ->\n"), emit(Fd, " corba:create(?MODULE, \"~s\", Env).\n", [TypeID]), nl(Fd), emit(Fd, "oe_create_link(Env) ->\n"), emit(Fd, " corba:create_link(?MODULE, \"~s\", Env).\n", [TypeID]), nl(Fd), emit(Fd, "oe_create(Env, RegName) ->\n"), emit(Fd, " corba:create(?MODULE, \"~s\", Env, RegName).\n", [TypeID]), nl(Fd), emit(Fd, "oe_create_link(Env, RegName) ->\n"), emit(Fd, " corba:create_link(?MODULE, \"~s\", Env, RegName).\n", [TypeID]), nl(Fd), ic_codegen:mcomment(Fd, ["Init & terminate functions."]), nl(Fd), emit(Fd, "init(Env) ->\n"), ic_codegen:comment(Fd, "Call to implementation init"), emit(Fd, " corba:handle_init(~p, Env).\n", [to_atom(Impl)]), nl(Fd), emit(Fd, "terminate(Reason, State) ->\n"), emit(Fd, " corba:handle_terminate(~p, Reason, State).\n", [to_atom(Impl)]), nl(Fd), nl(Fd), Fd; emit_serv_std(erl_genserv, G, N, X) -> Fd = ic_genobj:stubfiled(G), Impl = ic_genobj:impl(G), TypeID = ictk:get_IR_ID(G, N, X), nl(Fd), nl(Fd), nl(Fd), ic_codegen:mcomment(Fd, ["Server implementation."]), nl(Fd), nl(Fd), ic_codegen:mcomment(Fd, ["Function for fetching the interface type ID."]), nl(Fd), emit(Fd, "typeID() ->\n"), emit(Fd, " \"~s\".\n", [TypeID]), nl(Fd), nl(Fd), ic_codegen:mcomment(Fd, ["Server creation functions."]), nl(Fd), emit(Fd, "oe_create() ->\n"), emit(Fd, " start([], []).\n", []), nl(Fd), emit(Fd, "oe_create_link() ->\n"), emit(Fd, " start_link([], []).\n", []), nl(Fd), emit(Fd, "oe_create(Env) ->\n"), emit(Fd, " start(Env, []).\n", []), nl(Fd), emit(Fd, "oe_create_link(Env) ->\n"), emit(Fd, " start_link(Env, []).\n", []), nl(Fd), emit(Fd, "oe_create(Env, RegName) ->\n"), emit(Fd, " start(RegName, Env, []).\n", []), nl(Fd), emit(Fd, "oe_create_link(Env, RegName) ->\n"), emit(Fd, " start_link(RegName, Env, []).\n", []), nl(Fd), ic_codegen:mcomment(Fd, ["Start functions."]), nl(Fd), emit(Fd, "start(Env, Opt) ->\n"), emit(Fd, " gen_server:start(?MODULE, Env, Opt).\n"), nl(Fd), emit(Fd, "start_link(Env, Opt) ->\n"), emit(Fd, " gen_server:start_link(?MODULE, Env, Opt).\n"), nl(Fd), emit(Fd, "start(RegName, Env, Opt) ->\n"), emit(Fd, " gen_server:start(RegName, ?MODULE, Env, Opt).\n"), nl(Fd), emit(Fd, "start_link(RegName, Env, Opt) ->\n"), emit(Fd, " gen_server:start_link(RegName, ?MODULE, Env, Opt).\n"), nl(Fd), ic_codegen:comment(Fd, "Standard gen_server termination"), emit(Fd, "stop(OE_THIS) ->\n"), emit(Fd, " gen_server:cast(OE_THIS,stop).\n"), nl(Fd), ic_codegen:comment(Fd, "Call to implementation init"), emit(Fd, "init(Env) ->\n"), emit(Fd, " ~p:~p(Env).\n", [to_atom(Impl), init]), nl(Fd), emit(Fd, "terminate(Reason, State) ->\n"), emit(Fd, " ~p:~p(Reason, State).\n", [to_atom(Impl), terminate]), nl(Fd), nl(Fd), Fd. gen_end_of_call(erl_corba, G) -> Fd = ic_genobj:stubfiled(G), nl(Fd), nl(Fd), ic_codegen:mcomment_light(Fd, ["Standard gen_server call handle"]), emit(Fd, "handle_call(stop, _, State) ->\n"), emit(Fd, " {stop, normal, ok, State}"), case get_opt(G, serv_last_call) of exception -> emit(Fd, ";\n"), nl(Fd), emit(Fd, "handle_call(_, _, State) ->\n"), emit(Fd, " {reply, catch corba:raise(#'BAD_OPERATION'{minor=1163001857, completion_status='COMPLETED_NO'}), State}.\n"); exit -> emit(Fd, ".\n"), nl(Fd), nl(Fd) end, ok; gen_end_of_call(erl_genserv, G) -> Fd = ic_genobj:stubfiled(G), nl(Fd), nl(Fd), ic_codegen:mcomment_light(Fd, ["Standard gen_server call handle"]), emit(Fd, "handle_call(stop, _, State) ->\n"), emit(Fd, " {stop, normal, ok, State}"), emit(Fd, ".\n"), nl(Fd), nl(Fd), ok. gen_end_of_cast(erl_corba, G) -> Fd = ic_genobj:stubfiled(G), nl(Fd), nl(Fd), ic_codegen:mcomment_light(Fd, ["Standard gen_server cast handle"]), emit(Fd, "handle_cast(stop, State) ->\n"), emit(Fd, " {stop, normal, State}"), case get_opt(G, serv_last_call) of exception -> emit(Fd, ";\n"), nl(Fd), emit(Fd, "handle_cast(_, State) ->\n"), emit(Fd, " {noreply, State}.\n"); exit -> emit(Fd, ".\n"), nl(Fd), nl(Fd) end, ok; gen_end_of_cast(erl_genserv, G) -> Fd = ic_genobj:stubfiled(G), nl(Fd), nl(Fd), ic_codegen:mcomment_light(Fd, ["Standard gen_server cast handle"]), emit(Fd, "handle_cast(stop, State) ->\n"), emit(Fd, " {stop, normal, State}"), emit(Fd, ".\n"), nl(Fd), nl(Fd), ok. emit_skel_footer(erl_corba, G, N, X) -> Fd = ic_genobj:stubfiled(G), nl(Fd), nl(Fd), ic_codegen:mcomment_light(Fd, ["Standard gen_server handles"]), case use_impl_handle_info(G, N, X) of true -> emit(Fd, "handle_info(Info, State) ->\n"), emit(Fd, " corba:handle_info(~p, Info, State).\n\n", [list_to_atom(ic_genobj:impl(G))]); false -> emit(Fd, "handle_info(_, State) ->\n"), emit(Fd, " {noreply, State}.\n\n") end, nl(Fd), case get_opt(G, no_codechange) of false -> emit(Fd, "code_change(OldVsn, State, Extra) ->\n"), emit(Fd, " corba:handle_code_change(~p, OldVsn, State, Extra).\n\n", [list_to_atom(ic_genobj:impl(G))]); true -> emit(Fd, "code_change(_, State, _) ->\n"), emit(Fd, " {ok, State}.\n\n") end, ok; emit_skel_footer(erl_genserv, G, N, X) -> Fd = ic_genobj:stubfiled(G), nl(Fd), nl(Fd), ic_codegen:mcomment_light(Fd, ["Standard gen_server handles"]), case use_impl_handle_info(G, N, X) of true -> emit(Fd, "handle_info(Info, State) ->\n"), emit(Fd, " ~p:handle_info(Info, State).\n\n", [list_to_atom(ic_genobj:impl(G))]); false -> emit(Fd, "handle_info(_, State) ->\n"), emit(Fd, " {noreply, State}.\n\n") end, nl(Fd), nl(Fd), case get_opt(G, no_codechange) of false -> emit(Fd, "code_change(OldVsn, State, Extra) ->\n"), emit(Fd, " ~p:code_change(OldVsn, State, Extra).\n\n", [list_to_atom(ic_genobj:impl(G))]); true -> emit(Fd, "code_change(_, State, _) ->\n"), emit(Fd, " {ok, State}.\n\n") end, ok. use_impl_handle_info(G, N, X) -> FullName = ic_util:to_colon([get_id2(X) | N]), case {get_opt(G, {handle_info, true}), get_opt(G, {handle_info, FullName})} of {_, force_false} -> false; {false, false} -> false; _ -> true end. use_timeout(G, N, _X) -> FullName = ic_util:to_colon(N), case {get_opt(G, {timeout, true}), get_opt(G, {timeout, FullName})} of {_, force_false} -> false; {false, false} -> false; _ -> true end. use_precond(G, N, X) -> FullName = ic_util:to_colon([get_id2(X) | N]), case get_opt(G, {precond, FullName}) of false -> InterfaceName = ic_util:to_colon(N), case get_opt(G, {precond, InterfaceName}) of false -> case get_opt(G, precond) of false -> false; V2 -> V2 end; V2 -> V2 end; V1 -> V1 end. use_postcond(G, N, X) -> FullName = ic_util:to_colon([get_id2(X) | N]), case get_opt(G, {postcond, FullName}) of false -> InterfaceName = ic_util:to_colon(N), case get_opt(G, {postcond, InterfaceName}) of false -> case get_opt(G, postcond) of false -> false; V3 -> V3 end; V2 -> V2 end; V1 -> V1 end. %%------------------------------------------------------------ %% %% Export stuff %% %% Gathering of all names that should be exported from a stub %% file. %% gen_head_special(G, N, X) when record(X, interface) -> Fd = ic_genobj:stubfiled(G), foreach(fun({Name, Body}) -> ic_codegen:comment(Fd, "Exports from ~p", [ic_util:to_colon(Name)]), ic_codegen:export(Fd, exp_top(G, N, Body, [], get_opt(G, be))), nl(Fd) end, X#interface.inherit_body), ic_codegen:comment(Fd, "Type identification function"), ic_codegen:export(Fd, [{typeID, 0}]), nl(Fd), ic_codegen:comment(Fd, "Used to start server"), ic_codegen:export(Fd, [{oe_create, 0}, {oe_create_link, 0}, {oe_create, 1}, {oe_create_link, 1}, {oe_create, 2}, {oe_create_link, 2}]), nl(Fd), case get_opt(G, be) of erl_corba -> ic_codegen:comment(Fd, "TypeCode Functions and inheritance"), ic_codegen:export(Fd, [{oe_tc, 1}, {oe_is_a, 1}, {oe_get_interface, 0}]); _ -> ic_codegen:export(Fd, [{start, 2}, {start_link, 3}]) end, nl(Fd), ic_codegen:comment(Fd, "gen server export stuff"), emit(Fd, "-behaviour(gen_server).\n"), case get_opt(G, be) of erl_genserv -> %% stop/1 is only for erl_genserv backend ic_codegen:export(Fd, [{stop, 1}, {init, 1}, {terminate, 2}, {handle_call, 3}, {handle_cast, 2}, {handle_info, 2}, {code_change, 3}]); _ -> ic_codegen:export(Fd, [{init, 1}, {terminate, 2}, {handle_call, 3}, {handle_cast, 2}, {handle_info, 2}, {code_change, 3}]) end, case get_opt(G, be) of erl_corba -> nl(Fd), emit(Fd, "-include_lib(\"~s/include/~s\").\n", [?ORBNAME, ?CORBAHRL]); _ -> ok end, nl(Fd), nl(Fd), ic_codegen:mcomment(Fd, ["Object interface functions."]), nl(Fd), nl(Fd), nl(Fd), Fd; gen_head_special(_G, _N, _X) -> ok. %% Shall generate all export declarations gen_head(G, N, X) -> case ic_genobj:is_stubfile_open(G) of true -> F = ic_genobj:stubfiled(G), ic_codegen:comment(F, "Interface functions"), ic_codegen:export(F, exp_top(G, N, X, [], get_opt(G, be))), nl(F), gen_head_special(G, N, X); false -> ok end. exp_top(_G, _N, X, Acc, _) when element(1, X) == preproc -> Acc; exp_top(G, N, L, Acc, BE) when list(L) -> exp_list(G, N, L, Acc, BE); exp_top(G, N, M, Acc, BE) when record(M, module) -> exp_list(G, N, get_body(M), Acc, BE); exp_top(G, N, I, Acc, BE) when record(I, interface) -> exp_list(G, N, get_body(I), Acc, BE); exp_top(G, N, X, Acc, BE) -> exp3(G, N, X, Acc, BE). exp3(_G, _N, C, Acc, _BE) when record(C, const) -> [{get_id(C#const.id), 0} | Acc]; exp3(_G, _N, Op, Acc, erl_corba) when record(Op, op) -> FuncName = get_id(Op#op.id), Arity = length(ic:filter_params([in, inout], Op#op.params)) + 1, [{FuncName, Arity}, {FuncName, Arity+1} | Acc]; exp3(G, N, Op, Acc, _BE) when record(Op, op) -> FuncName = get_id(Op#op.id), Arity = case use_timeout(G,N,Op) of true -> %% NO TimeOut on ONEWAYS here !!!! case is_oneway(Op) of true -> length(ic:filter_params([in, inout], Op#op.params)) + 1; false -> length(ic:filter_params([in, inout], Op#op.params)) + 2 end; false -> length(ic:filter_params([in, inout], Op#op.params)) + 1 end, [{FuncName, Arity} | Acc]; exp3(_G, _N, A, Acc, erl_corba) when record(A, attr) -> lists:foldr(fun(Id, Acc2) -> {Get, Set} = mk_attr_func_names([], get_id(Id)), case A#attr.readonly of {readonly, _} -> [{Get, 1}, {Get, 2} | Acc2]; _ -> [{Get, 1}, {Get, 2}, {Set, 2}, {Set, 3} | Acc2] end end, Acc, ic_forms:get_idlist(A)); exp3(_G, _N, A, Acc, _BE) when record(A, attr) -> lists:foldr(fun(Id, Acc2) -> {Get, Set} = mk_attr_func_names([], get_id(Id)), case A#attr.readonly of {readonly, _} -> [{Get, 1} | Acc2]; _ -> [{Get, 1}, {Set, 2} | Acc2] end end, Acc, ic_forms:get_idlist(A)); exp3(_G, _N, _X, Acc, _BE) -> Acc. exp_list(G, N, L, OrigAcc, BE) -> lists:foldr(fun(X, Acc) -> exp3(G, N, X, Acc, BE) end, OrigAcc, L). %%------------------------------------------------------------ %% %% Emit stuff %% %% Low level generation primitives %% emit_stub_func(G, N, X, Name, ArgNames, _TypeList, OutArgs, Oneway, Backend) -> case ic_genobj:is_stubfile_open(G) of false -> ok; true -> Fd = ic_genobj:stubfiled(G), StubName = list_to_atom(Name), UsingTimeout = use_timeout(G, N, X), Timeout = case UsingTimeout of true -> mk_name(G, "Timeout"); false -> "infinity" end, Options = mk_name(G, "Options"), This = mk_name(G, "THIS"), CallOrCast = case is_oneway(X) of true -> ?CAST; _ -> ?CALL end, emit_op_comment(G, Fd, X, StubName, ArgNames, OutArgs), case Backend of erl_corba -> emit(Fd, "~p(~s) ->\n", [StubName, mk_list([This | ArgNames])]), emit(Fd, " ~s:~s(~s, ~p, [~s], ?MODULE).\n\n", [?CORBAMOD, CallOrCast, This, StubName, mk_list(ArgNames)]), emit(Fd, "~p(~s) ->\n", [StubName, mk_list([This, Options| ArgNames])]), emit(Fd, " ~s:~s(~s, ~p, [~s], ?MODULE, ~s).\n\n", [?CORBAMOD, CallOrCast, This, StubName, mk_list(ArgNames), Options]); _ -> FunName = case ic_options:get_opt(G, scoped_op_calls) of true -> list_to_atom(ic_util:to_undersc([Name | N])); false -> StubName end, %% NO TimeOut on ONEWAYS here !!!! case Oneway of true -> emit(Fd, "~p(~s) ->\n", [StubName, mk_list([This | ArgNames])]); false -> case UsingTimeout of true -> emit(Fd, "~p(~s) ->\n", [StubName, mk_list([This, Timeout| ArgNames])]); false -> emit(Fd, "~p(~s) ->\n", [StubName, mk_list([This | ArgNames])]) end end, %% NO TimeOut on ONEWAYS here !!!! if length(ArgNames) == 0 -> case is_oneway(X) of true -> emit(Fd, " ~s:~s(~s, ~p).\n\n", [?GENSERVMOD, CallOrCast, This, FunName]); false -> emit(Fd, " ~s:~s(~s, ~p, ~s).\n\n", [?GENSERVMOD, CallOrCast, This, FunName, Timeout]) end; true -> case is_oneway(X) of true -> emit(Fd, " ~s:~s(~s, {~p, ~s}).\n\n", [?GENSERVMOD, CallOrCast, This, FunName, mk_list(ArgNames)]); false -> emit(Fd, " ~s:~s(~s, {~p, ~s}, ~s).\n\n", [?GENSERVMOD, CallOrCast, This, FunName, mk_list(ArgNames), Timeout]) end end end end. emit_skel_func(G, N, X, OpName, ArgNames, TypeList, OutArgs, Oneway, Backend) -> case ic_genobj:is_stubfile_open(G) of false -> ok; true -> emit_skel_func_helper(G, N, X, OpName, ArgNames, TypeList, OutArgs, Oneway, Backend) end. emit_skel_func_helper(G, N, X, OpName, ArgNames, _TypeList, OutArgs, Oneway, erl_corba) -> Fd = ic_genobj:stubfiled(G), Name = list_to_atom(OpName), ImplF = Name, ImplM = list_to_atom(ic_genobj:impl(G)), ThisStr = mk_name(G, "THIS"), FromStr = mk_name(G, "From"), State = mk_name(G, "State"), Context = mk_name(G, "Context"), {UseFrom, From} = case Oneway of false -> case use_from(G, N, OpName) of true -> {FromStr, FromStr}; false -> {"false", "_"} end; true -> {"false", "_"} end, {UseThis, This} = case use_this(G, N, OpName) of true -> {ThisStr, ThisStr}; false -> {"false", "_"} end, %% Create argument list string CallArgs = mk_list(ArgNames), emit_op_comment(G, Fd, X, Name, ArgNames, OutArgs), %% Check if pre and post conditions are specified for this operation Precond = use_precond(G, N, X), Postcond = use_postcond(G, N, X), case Oneway of true -> emit(Fd, "handle_cast({~s, ~s, ~p, [~s]}, ~s) ->\n", [This, Context, Name, CallArgs, State]), case {Precond, Postcond} of {false, false} -> emit(Fd, " corba:handle_cast(~p, ~p, [~s], ~s, ~s, ~s);\n\n", [ImplM, ImplF, CallArgs, State, Context, UseThis]); _ -> emit(Fd, " corba:handle_cast(~p, ~p, [~s], ~s, ~s, ~s, ~p, ~p, ?MODULE);\n\n", [ImplM, ImplF, CallArgs, State, Context, UseThis, Precond, Precond]) end; false -> emit(Fd, "handle_call({~s, ~s, ~p, [~s]}, ~s, ~s) ->\n", [This, Context, Name, CallArgs, From, State]), case {Precond, Postcond} of {false, false} -> emit(Fd, " corba:handle_call(~p, ~p, [~s], ~s, ~s, ~s, ~s);\n\n", [ImplM, ImplF, CallArgs, State, Context, UseThis, UseFrom]); _-> emit(Fd, " corba:handle_call(~p, ~p, [~s], ~s, ~s, ~s, ~s, ~p, ~p, ?MODULE);\n\n", [ImplM, ImplF, CallArgs, State, Context, UseThis, UseFrom, Precond, Postcond]) end end; emit_skel_func_helper(G, N, X, OpName, ArgNames, _TypeList, OutArgs, Oneway, _Backend) -> Fd = ic_genobj:stubfiled(G), Name = list_to_atom(OpName), ImplF = Name, ImplM = list_to_atom(ic_genobj:impl(G)), FromStr = mk_name(G, "From"), State = mk_name(G, "State"), %% Create argument list CallArgs1 = [State | ArgNames], {CallArgs2, From} = case is_oneway(X) of false -> case use_from(G, N, OpName) of true -> {[FromStr | CallArgs1], FromStr}; false -> {CallArgs1, "_"} end; true -> {CallArgs1, "_"} end, %% Create argument list string CallArgs = mk_list(CallArgs2), emit_op_comment(G, Fd, X, Name, ArgNames, OutArgs), FunName = case ic_options:get_opt(G, scoped_op_calls) of true -> list_to_atom(ic_util:to_undersc([OpName | N])); false -> list_to_atom(OpName) end, case Oneway of true -> if length(ArgNames) == 0 -> emit(Fd, "handle_cast(~p, ~s) ->\n", [FunName, State]); true -> emit(Fd, "handle_cast({~p, ~s}, ~s) ->\n", [FunName, mk_list(ArgNames), State]) end, emit(Fd, " ~p:~p(~s);\n\n", [ImplM, ImplF, CallArgs]); false -> if length(ArgNames) == 0 -> emit(Fd, "handle_call(~p, ~s, ~s) ->\n", [FunName, From, State]); true -> emit(Fd, "handle_call({~p, ~s}, ~s, ~s) ->\n", [FunName, mk_list(ArgNames), From, State]) end, emit(Fd, " ~p:~p(~s);\n\n", [ImplM, ImplF, CallArgs]) end. use_this(G, N, OpName) -> FullOp = ic_util:to_colon([OpName|N]), FullIntf = ic_util:to_colon(N), case {get_opt(G, {this, FullIntf}), get_opt(G, {this, FullOp}), get_opt(G, {this, true})} of {_, force_false, _} -> false; {force_false, false, _} -> false; {false, false, false} -> false; _ -> true end. use_from(G, N, OpName) -> FullOp = ic_util:to_colon([OpName|N]), FullIntf = ic_util:to_colon(N), case {get_opt(G, {from, FullIntf}), get_opt(G, {from, FullOp}), get_opt(G, {from, true})} of {_, force_false, _} -> false; {force_false, false, _} -> false; {false, false, false} -> false; _ -> true end. emit_constant_func(G, Id, Val) -> case ic_genobj:is_stubfile_open(G) of false -> ok; true -> Fd = ic_genobj:stubfiled(G), N = list_to_atom(get_id(Id)), emit_const_comment(G, Fd, Id, N), emit(Fd, "~p() -> ~p.\n\n", [N, Val]) end. emit_const_comment(_G, F, _X, Name) -> ic_codegen:mcomment_light(F, [io_lib:format("Constant: ~p", [Name])]). emit_op_comment(G, F, X, Name, InP, OutP) -> ic_codegen:mcomment_light(F, [io_lib:format("~s: ~p", [get_title(X), Name]), "", get_returns(G, X, InP, OutP) | get_raises(X)]). get_title(X) when record(X, attr) -> "Attribute Operation"; get_title(_X) -> "Operation". get_raises(X) when record(X, op) -> if X#op.raises == [] -> []; true -> [" Raises: " ++ mk_list(lists:map(fun(E) -> ic_util:to_colon(E) end, X#op.raises))] end; get_raises(_X) -> []. get_returns(_G, _X, _InP, []) -> " Returns: RetVal"; get_returns(G, _X, _InP, OutP) -> " Returns: "++mk_list(["RetVal" | mk_erl_vars(G, OutP)]). %%------------------------------------------------------------ %% %% Utilities %% %% Convenient little go-get functions %% %%------------------------------------------------------------ %% The automaticly generated get and set operation names for an %% attribute. mk_attr_func_names(_Scope, Name) -> {"_get_" ++ Name, "_set_" ++ Name}. %% {scoped_name(Scope, "_get_"++Name), scoped_name(Scope, "_set_"++Name)}. %% Returns TK of the Get and Set attribute functions. mk_attr_func_types(_N, X) -> TK = ic_forms:get_tk(X), {{TK, [], []}, {tk_void, [TK], []}}. %%------------------------------------------------------------ %% %% Generation utilities and common stuff %% %% Convenient stuff for generation %% %%------------------------------------------------------------ %% Input is a list of parameters (in parse form) and output is a list %% of capitalised variable names. mk_var is in icgen mk_erl_vars(_G, Params) -> map(fun(P) -> mk_var(get_id(P#param.id)) end, Params). %% mk_list produces a nice comma separated string of variable names mk_list([]) -> []; mk_list([Arg | Args]) -> Arg ++ mk_list2(Args). mk_list2([Arg | Args]) -> ", " ++ Arg ++ mk_list2(Args); mk_list2([]) -> []. %%------------------------------------------------------------ %% %% Parser utilities %% %% Called from the yecc parser. Expands the identifier list of an %% attribute so that the attribute generator never has to handle %% lists. %% %%------------------------------------------------------------ %% Unfold identifier lists or nested lists. Note that many records %% contain an entry named id that is a list before unfold and a single %% id afterwards. unfold(L) when list(L) -> lists:flatten(map(fun(X) -> unfold2(X) end, L)); unfold(X) -> unfold2(X). unfold2(A) when record(A, attr) -> map(fun(Id) -> A#attr{id=Id} end, A#attr.id); unfold2(M) when record(M, member) -> map(fun(Id) -> M#member{id=Id} end, M#member.id); unfold2(M) when record(M, case_dcl) -> map(fun(Id) -> M#case_dcl{label=Id} end, M#case_dcl.label); unfold2(T) when record(T, typedef) -> map(fun(Id) -> T#typedef{id=Id} end, T#typedef.id). %% Code produce for dependency function genDependency(G) -> Fd = ic_genobj:stubfiled(G), nl(Fd),nl(Fd), ic_codegen:comment(Fd, "Idl file dependency list function"), emit(Fd, "oe_dependency() ->\n\n", []), emit(Fd, " ~p.\n\n", [ic_pragma:get_dependencies(G)]). From s.egner@REDACTED Fri Sep 14 09:52:44 2007 From: s.egner@REDACTED (Sebastian Egner) Date: Fri, 14 Sep 2007 09:52:44 +0200 Subject: [erlang-bugs] possible bug in 'ic' (the CORBA IDL compiler) In-Reply-To: References: Message-ID: <46EA3DCC.8060109@specs.de> Niclas Eklund wrote: > Will be fixed in the next release. For now you can use the attached file. > Thanks for reporting this bug. > > /Nick > Many thanks for the fix! It works as intended. Sebastian. From tobbe@REDACTED Fri Sep 14 16:20:04 2007 From: tobbe@REDACTED (Torbjorn Tornkvist) Date: Fri, 14 Sep 2007 16:20:04 +0200 Subject: [erlang-bugs] strange warning from the compiler Message-ID: Compiling the following code: ----------------------------------- -module(aaa). -export([a/0]). -record(hello, {a,b}). a() -> (#hello{})#hello.a. ------------------------------------ Gives me: erlc aaa.erl ./aaa.erl:7: Warning: this clause cannot match because a previous clause at line 7 always matches Cheers, Tobbe From erlang@REDACTED Sun Sep 16 21:46:03 2007 From: erlang@REDACTED (Philip Smolen) Date: Sun, 16 Sep 2007 12:46:03 -0700 Subject: [erlang-bugs] Hipe/native and reloading modules Message-ID: <20070916194735.QZDE15797.dukecmmtao01.coxmail.com@PhilLapTop> I noticed something strange when I use the "native" option to compile my code. Code reloading doesn't work the same way as when I don't specify "native". Here's some sample code. -module(reload). -export([show/0, loop/0, version/0]). show() -> spawn(fun loop/0). loop() -> io:format("This process: ~p, Most current version: ~p ~n", [version(), reload:version()]), receive reload -> reload:loop(); exit -> void after 5000 -> loop() end. %% Change this each time: version() -> 22. When I don't use the native mode, it works as documented. When I change the version number and say "c(reload)" the first version number stays the same and the second version number is incremented. If I say "c(reload, native)" then it acts strange. In that case both version numbers change to the latest one. More precisely: * The recursive call to loop() always calls the original version of the code, as it should. (Change the io:format statement if you want to verify that.) * The recursive call to reload:loop() always calls the most recent version of the code, as it should. * The call to reload:version() always calls the most recent version of the code, as it should. * The call to version() works differently in different cases. If you compiled without the native switch, it calls the original version of the code, as it should. If you compiled with the native switch, it incorrectly calls the latest version. I noticed something else that was strange, although I'm not sure if it's a bug or a feature. When I don't use the "native" switch, I can see that there are only two versions of the code. Erlang kills my process if it's using code that's too old, exactly as documented. However, if I compile with the "native" switch then Erlang never kills my old code. I'm running otp_src_R11B-5.tar.gz on Fedora. PS The native option makes things work much faster! -------------- next part -------------- An HTML attachment was scrubbed... URL: From bengt.kleberg@REDACTED Mon Sep 17 07:54:05 2007 From: bengt.kleberg@REDACTED (Bengt Kleberg) Date: Mon, 17 Sep 2007 07:54:05 +0200 Subject: [erlang-bugs] strange warning from the compiler In-Reply-To: References: Message-ID: <46EE167D.1060300@ericsson.com> greetings, i think this bug report needs an erlang version since the code compiles without problem on my system. Erlang (BEAM) emulator version 5.5.5 [async-threads:0] [hipe] [kernel-poll:false] SunOS ws67042 5.8 Generic_117350-39 sun4u sparc SUNW,Sun-Blade-1500 bengt Those were the days... EPO guidelines 1978: "If the contribution to the known art resides solely in a computer program then the subject matter is not patentable in whatever manner it may be presented in the claims." On 2007-09-14 16:20, Torbjorn Tornkvist wrote: > Compiling the following code: > ----------------------------------- > -module(aaa). > -export([a/0]). > > -record(hello, {a,b}). > > a() -> > (#hello{})#hello.a. > ------------------------------------ > > Gives me: > > erlc aaa.erl > ./aaa.erl:7: Warning: this clause cannot match because a previous clause > at line 7 always matches > > > Cheers, Tobbe > > _______________________________________________ > erlang-bugs mailing list > erlang-bugs@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-bugs From tobbe@REDACTED Mon Sep 17 08:36:40 2007 From: tobbe@REDACTED (Torbjorn Tornkvist) Date: Mon, 17 Sep 2007 08:36:40 +0200 Subject: [erlang-bugs] strange warning from the compiler In-Reply-To: <46EE167D.1060300@ericsson.com> References: <46EE167D.1060300@ericsson.com> Message-ID: Bengt Kleberg wrote: > greetings, > > i think this bug report needs an erlang version since the code compiles > without problem on my system. Yes, how stupid of me not to give that info. I was using R11B-2, so if it is fixed in R11B-5 then all is fine. --Tobbe > > Erlang (BEAM) emulator version 5.5.5 [async-threads:0] [hipe] > [kernel-poll:false] > > SunOS ws67042 5.8 Generic_117350-39 sun4u sparc SUNW,Sun-Blade-1500 > > > bengt > Those were the days... > EPO guidelines 1978: "If the contribution to the known art resides > solely in a computer program then the subject matter is not > patentable in whatever manner it may be presented in the claims." > > > On 2007-09-14 16:20, Torbjorn Tornkvist wrote: >> Compiling the following code: >> ----------------------------------- >> -module(aaa). >> -export([a/0]). >> >> -record(hello, {a,b}). >> >> a() -> >> (#hello{})#hello.a. >> ------------------------------------ >> >> Gives me: >> >> erlc aaa.erl >> ./aaa.erl:7: Warning: this clause cannot match because a previous clause >> at line 7 always matches >> >> >> Cheers, Tobbe >> >> _______________________________________________ >> erlang-bugs mailing list >> erlang-bugs@REDACTED >> http://www.erlang.org/mailman/listinfo/erlang-bugs > _______________________________________________ > erlang-bugs mailing list > erlang-bugs@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-bugs > From ulf@REDACTED Mon Sep 17 16:22:39 2007 From: ulf@REDACTED (Ulf Wiger) Date: Mon, 17 Sep 2007 16:22:39 +0200 Subject: [erlang-bugs] documentation bug - io Message-ID: <8209f740709170722h1a628e9bxdc7b24a1c074151b@mail.gmail.com> http://www.erlang.org/doc/man/io.html "setopts([IoDevice,] Opts) -> ok | {error, Reason} Types: IoDevice = io_device() Opts = [Opt] Opt = binary | list Reason = term() Set options for standard input/output (IoDevice). Possible options are: binary ... list ... expand_fun Provide a function for tab-completion ..." The 'expand_fun' format is, I assume, {expand_fun, Fun}, but this is not clearly stated in the documentation, nor is expand_fun represented in the type grammar. Otherwise - nice option. (: BR, Ulf W From mogorman@REDACTED Fri Sep 21 09:43:24 2007 From: mogorman@REDACTED (Matthew O'Gorman) Date: Fri, 21 Sep 2007 02:43:24 -0500 Subject: [erlang-bugs] documentation issue Message-ID: The gen_fsm example, code_lock, on erlang/doc/design_principles/fsm.html#3 web docs will not compile do to a bad semicolon before the end, also it does not behave the full behaviour, or all the functions defined. Attached is a working example that I think is better and compiles with out warnings.. Mog -------------- next part -------------- A non-text attachment was scrubbed... Name: code_lock.erl Type: text/x-erlang Size: 1408 bytes Desc: not available URL: From fritchie@REDACTED Sun Sep 23 04:25:47 2007 From: fritchie@REDACTED (Scott Lystig Fritchie) Date: Sat, 22 Sep 2007 21:25:47 -0500 Subject: [erlang-bugs] SIGSEGV in R11B-5 in mbc_alloc() at beam/erl_alloc_util.c:657 Message-ID: <200709230225.l8N2Pl8a006142@snookles.snookles.com> Good evening, everyone. Has anyone managed to get a segmentation violation happening in mbc_alloc()? I'm trying to get more info from colleagues to see if this kind of crash has happened before. As far as I know so far, this thing is rare but happened during a 24-hour stress test: some protocol load generator probably had this machine running at less than 20% total CPU idle and therefore probably creating a fairly heavy load on a 2-node Mnesia cluster (symmetric table replicas) using a mix of disc_copies and ram_copies tables. Platform details: [root@REDACTED ~]$ uname -a Linux tc-40432-3s 2.6.9-42.ELsmp #1 SMP Sat Aug 12 09:39:11 CDT 2006 i686 athlon i386 GNU/Linux [root@REDACTED ~]$ cat /etc/redhat-release CentOS release 4.4 (Final) [root@REDACTED ~]$ free total used free shared buffers cached Mem: 16631988 2222040 14409948 0 158240 1864300 -/+ buffers/cache: 199500 16432488 Swap: 2031608 0 2031608 The app was running with arguments like this. If I recall correctly, the ERL_MAX_ETS_TABLES is there to help in case there are a large number of Mnesia transactions trying to execute simultaneously. I hope a SIGSEGV crash wouldn't happen if that limit were reached, but if it's possible, then that's the likely trigger, I suppose. env ERL_MAX_ETS_TABLES=10007 \ erl \ +A 64 +K true -smp auto -noinput -noshell \ -sname ${FOO}$1 \ -kernel dist_auto_connect once \ -kernel net_ticktime $CLUSTER_TIMEOUT \ -mnesia dump_log_write_threshold 500000 \ -mnesia dump_log_time_threshold 900000 \ -boot $BAR/lib/app/baz \ -pz $BOO/lib/app \ -config $BAR/var/data/node$1.config \ -zoo_config $BAR/etc/zoo.conf \ -foo_config $BAR/etc/foo.conf Thanks for listening. -Scott Core was generated by `/usr/local/gemini/ert/R11B-5/lib/erlang/erts-5.5.5/bin/beam.smp -A 64 -K true -'. Program terminated with signal 11, Segmentation fault. Reading symbols from /lib/libutil.so.1...done. Loaded symbols for /lib/libutil.so.1 Reading symbols from /lib/libdl.so.2...done. Loaded symbols for /lib/libdl.so.2 Reading symbols from /lib/tls/libm.so.6...done. Loaded symbols for /lib/tls/libm.so.6 Reading symbols from /lib/tls/libpthread.so.0...done. Loaded symbols for /lib/tls/libpthread.so.0 Reading symbols from /usr/lib/libncurses.so.5...done. Loaded symbols for /usr/lib/libncurses.so.5 Reading symbols from /lib/tls/librt.so.1...done. Loaded symbols for /lib/tls/librt.so.1 Reading symbols from /lib/tls/libc.so.6...done. Loaded symbols for /lib/tls/libc.so.6 Reading symbols from /lib/ld-linux.so.2...done. Loaded symbols for /lib/ld-linux.so.2 #0 mbc_alloc (allctr=0x818a580, size=Variable "size" is not available. ) at beam/erl_alloc_util.c:657 657 beam/erl_alloc_util.c: No such file or directory. in beam/erl_alloc_util.c (gdb) where #0 mbc_alloc (allctr=0x818a580, size=Variable "size" is not available. ) at beam/erl_alloc_util.c:657 #1 0x0807656e in erts_alcu_alloc_ts (type=106, extra=0x818a580, size=168) at beam/erl_alloc_util.c:2158 #2 0x080caa58 in db_get_term (tb=0xa7a8dd16, old=0x0, offset=2879645435, obj=8) at beam/erl_alloc.h:174 #3 0x080d737f in db_put_hash (proc=0xaaeb0424, tbl=0x8b2b726c, obj=2812862006, ret=0x80c52a9) at beam/erl_db_hash.c:2077 #4 0x080c52a9 in ets_insert_2 (A__p=0xaaeb0424, A_1=15519, A_2=2812862006) at beam/erl_db.c:627 #5 0x080fe71d in process_main () at beam/beam_emu.c:2293 #6 0x080b00cf in sched_thread_func (vesdp=0xb6e2c968) at beam/erl_process.c:947 #7 0x08147f1a in thr_wrapper (vtwd=0xbfffeee0) at common/ethread.c:503 #8 0x00444371 in start_thread () from /lib/tls/libpthread.so.0 #9 0x001f0ffe in clone () from /lib/tls/libc.so.6 (gdb) p nxt_blk $1 = (Block_t *) 0x9d4dcda4 (gdb) p *nxt_blk $2 = 634994553 (gdb) p nxt_blk_sz $3 = 634994552 (gdb) p last_blk_flg $4 = 0 (gdb) p blk $5 = (Block_t *) 0x9d4dccf4 (gdb) p *blk $6 = 176 (gdb) p *allctr $7 = {name_prefix = 0x814c232 "ets_", alloc_no = 8, name = {alloc = 0, realloc = 0, free = 0}, vsn_str = 0x814d0f9 "0.9", sbc_threshold = 524288, sbc_move_threshold = 80, main_carrier_size = 131072, max_mseg_sbcs = 256, max_mseg_mbcs = 10, largest_mbc_size = 5242880, smallest_mbc_size = 1048576, mbc_growth_stages = 10, mseg_opt = {cache = 1, preserv = 1, abs_shrink_th = 4145152, rel_shrink_th = 20}, mbc_header_size = 20, min_mbc_size = 16384, min_mbc_first_free_size = 4096, min_block_size = 32, mbc_list = {first = 0xb7ca6008, last = 0x829a5008}, sbc_list = {first = 0x0, last = 0x0}, main_carrier = 0xb7ca6008, get_free_block = 0x8078b60 , link_free_block = 0x8078a20 , unlink_free_block = 0x8078ad0 , info_options = 0x8078cc4 , get_next_mbc_size = 0x80731c0 , creating_mbc = 0, destroying_mbc = 0, init_atoms = 0x8078c2c , mutex = {mtx = { pt_mtx = {__data = {__lock = 2, __count = 0, __owner = 14990, __kind = 0, __nusers = 1, __spins = 0}, __size = "\002\000\000\000\000\000\000\000\216:\000\000\000\000\000\000\001\000\000\000\000\000\000", __align = 2}, is_rec_mtx = 0, prev = 0x81c17a0, next = 0x8189a8c}}, thread_safe = 1, ts_list = {prev = 0x0, next = 0x0}, atoms_initialized = 0, stopped = 0, calls = {this_alloc = {giga_no = 1, no = 620152686}, this_free = {giga_no = 1, no = 619361257}, this_realloc = {giga_no = 0, no = 15006964}, mseg_alloc = {giga_no = 0, no = 14}, mseg_dealloc = {giga_no = 0, no = 4}, mseg_realloc = { giga_no = 0, no = 0}, sys_alloc = {giga_no = 0, no = 396}, sys_free = { giga_no = 0, no = 246}, sys_realloc = {giga_no = 0, no = 0}}, sbcs = { curr_mseg = {no = 0, size = 0}, curr_sys_alloc = {no = 0, size = 0}, max = {no = 0, size = 0}, max_ever = {no = 0, size = 0}, blocks = {curr = { no = 0, size = 0}, max = {no = 0, size = 0}, max_ever = {no = 0, size = 0}}}, mbcs = {curr_mseg = {no = 10, size = 29376512}, curr_sys_alloc = {no = 150, size = 156368928}, max = {no = 160, size = 185745440}, max_ever = {no = 0, size = 0}, blocks = {curr = { no = 791428, size = 75470808}, max = {no = 1891844, size = 161084480}, max_ever = {no = 0, size = 0}}}} (gdb) p blk_sz $8 = 176 (gdb) p last_blk_flg $9 = 0 (gdb) p size Variable "size" is not available. (gdb) up #1 0x0807656e in erts_alcu_alloc_ts (type=106, extra=0x818a580, size=168) at beam/erl_alloc_util.c:2158 2158 in beam/erl_alloc_util.c (gdb) p size $10 = 168 (gdb) p res No symbol "res" in current context. (gdb) p allctr->calls.this_alloc No symbol "allctr" in current context. (gdb) p type $11 = 106 (gdb) p extra $12 = (void *) 0x818a580 (gdb) p (Allctr_t *) extra $13 = (struct Allctr_t_ *) 0x818a580 (gdb) p * (Allctr_t *) extra $14 = {name_prefix = 0x814c232 "ets_", alloc_no = 8, name = {alloc = 0, realloc = 0, free = 0}, vsn_str = 0x814d0f9 "0.9", sbc_threshold = 524288, sbc_move_threshold = 80, main_carrier_size = 131072, max_mseg_sbcs = 256, max_mseg_mbcs = 10, largest_mbc_size = 5242880, smallest_mbc_size = 1048576, mbc_growth_stages = 10, mseg_opt = {cache = 1, preserv = 1, abs_shrink_th = 4145152, rel_shrink_th = 20}, mbc_header_size = 20, min_mbc_size = 16384, min_mbc_first_free_size = 4096, min_block_size = 32, mbc_list = {first = 0xb7ca6008, last = 0x829a5008}, sbc_list = {first = 0x0, last = 0x0}, main_carrier = 0xb7ca6008, get_free_block = 0x8078b60 , link_free_block = 0x8078a20 , unlink_free_block = 0x8078ad0 , info_options = 0x8078cc4 , get_next_mbc_size = 0x80731c0 , creating_mbc = 0, destroying_mbc = 0, init_atoms = 0x8078c2c , mutex = {mtx = { pt_mtx = {__data = {__lock = 2, __count = 0, __owner = 14990, __kind = 0, __nusers = 1, __spins = 0}, __size = "\002\000\000\000\000\000\000\000\216:\000\000\000\000\000\000\001\000\000\000\000\000\000", __align = 2}, is_rec_mtx = 0, prev = 0x81c17a0, next = 0x8189a8c}}, thread_safe = 1, ts_list = {prev = 0x0, next = 0x0}, atoms_initialized = 0, stopped = 0, calls = {this_alloc = {giga_no = 1, no = 620152686}, this_free = {giga_no = 1, no = 619361257}, this_realloc = {giga_no = 0, no = 15006964}, mseg_alloc = {giga_no = 0, no = 14}, mseg_dealloc = {giga_no = 0, no = 4}, mseg_realloc = { giga_no = 0, no = 0}, sys_alloc = {giga_no = 0, no = 396}, sys_free = { giga_no = 0, no = 246}, sys_realloc = {giga_no = 0, no = 0}}, sbcs = { curr_mseg = {no = 0, size = 0}, curr_sys_alloc = {no = 0, size = 0}, max = {no = 0, size = 0}, max_ever = {no = 0, size = 0}, blocks = {curr = { no = 0, size = 0}, max = {no = 0, size = 0}, max_ever = {no = 0, size = 0}}}, mbcs = {curr_mseg = {no = 10, size = 29376512}, curr_sys_alloc = {no = 150, size = 156368928}, max = {no = 160, size = 185745440}, max_ever = {no = 0, size = 0}, blocks = {curr = { no = 791428, size = 75470808}, max = {no = 1891844, size = 161084480}, max_ever = {no = 0, size = 0}}}} From opfer@REDACTED Sun Sep 23 09:35:41 2007 From: opfer@REDACTED (Christian Faulhammer) Date: Sun, 23 Sep 2007 09:35:41 +0200 Subject: [erlang-bugs] Double statement in HiPE installation Message-ID: <20070923093541.5cafb057@gentoo.org> Hi, attached is a patch for a double statement in HiPE installation, which makes installation fail with current version of coreutils. V-Li -- Christian Faulhammer, Gentoo Lisp project , #gentoo-lisp on FreeNode -------------- next part -------------- A non-text attachment was scrubbed... Name: erlang-11.2.5-hipe.patch Type: text/x-patch Size: 416 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 189 bytes Desc: not available URL: From mikpe@REDACTED Sun Sep 23 11:19:49 2007 From: mikpe@REDACTED (Mikael Pettersson) Date: Sun, 23 Sep 2007 11:19:49 +0200 (MEST) Subject: [erlang-bugs] Double statement in HiPE installation Message-ID: <200709230919.l8N9JnoY009296@harpo.it.uu.se> On Sun, 23 Sep 2007 09:35:41 +0200, Christian Faulhammer wrote: > attached is a patch for a double statement in HiPE installation, which > makes installation fail with current version of coreutils. Thanks. I've applied it to HiPE CVS. /Mikael From bjorn@REDACTED Sun Sep 23 11:27:07 2007 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 23 Sep 2007 11:27:07 +0200 Subject: [erlang-bugs] Double statement in HiPE installation In-Reply-To: <200709230919.l8N9JnoY009296@harpo.it.uu.se> References: <200709230919.l8N9JnoY009296@harpo.it.uu.se> Message-ID: Mikael Pettersson writes: > On Sun, 23 Sep 2007 09:35:41 +0200, Christian Faulhammer wrote: > > attached is a patch for a double statement in HiPE installation, which > > makes installation fail with current version of coreutils. > > Thanks. I've applied it to HiPE CVS. We will include it in R12B. /Bjorn -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From bjorn@REDACTED Sun Sep 23 12:14:09 2007 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 23 Sep 2007 12:14:09 +0200 Subject: [erlang-bugs] ets:from_dets/2 documentation error In-Reply-To: References: Message-ID: "Doug Edmunds" writes: > /lib/stdlib-1.14.5/doc/html/ets.html > > documentation incorrectly shows the output of > ets:from_dets(Tab,DetsTab) -> Tab. > > Output is not Tab. Filling the ETS table is a side effect of the function > call. > The corrected statement is > > ets:from_dets(Tab,DetsTab) -> true > > (Note "error in process" if either Tab or DetsTab is not open). Thanks! The documentation will be corrected in R12B. /Bjorn -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From gbulmer@REDACTED Mon Sep 24 21:43:16 2007 From: gbulmer@REDACTED (G Bulmer) Date: Mon, 24 Sep 2007 20:43:16 +0100 Subject: [erlang-bugs] Trivial typos in HTML doc/programming_examples/funs.html Message-ID: In the documentation file file:///usr/local/lib/erlang/doc/ programming_examples/funs.html#2.4, the text "within within" should be "within" Further down the same 2.4 section, the text refers to 'the first clause of F': "The rules for importing variables into a fun has the consequence that certain pattern matching operations have to be moved into guard expressions and cannot be written in the head of the fun. For example, we might write the following code if we intend the first clause of F to be evaluated when the value of its argument is Y:" Is followed by two examples: " f(...) -> Y = ... map(fun(X) when X == Y -> ; (_) -> ... end, ...) ... instead of f(...) -> Y = ... map(fun(Y) -> ; (_) -> ... end, ...) ... " This is unclear to me. Either the text could read 'the first clause of f' as there is no 'F', but I believe this is incorrect. IMHO the intent is to say 'the first clause of the fun' - it may be improved if that is qualified with 'the first clause of the fun in in "map (fun ...end, ...)"'. Finally, it isn't immediately clear which of the two examples is correct (until you understand what is being explained :-) So, extend 'instead of' say something more definitive like: 'instead of this incorrect form, where the parameter Y in fun(Y) hides the variable bound in Y=.., and hence that clause of the fun is called irresepctive of whether the parameter is the variable Y or not.' These Erlang manuals and papers are very useful documentation. Well done, and thank you. GB From fritchie@REDACTED Tue Sep 25 03:59:41 2007 From: fritchie@REDACTED (Scott Lystig Fritchie) Date: Mon, 24 Sep 2007 20:59:41 -0500 Subject: [erlang-bugs] SIGSEGV in SMP R11B-5 in bf_unlink_free_block() at beam/erl_bestfit_alloc.c:755 Message-ID: <200709250159.l8P1xfZn014219@snookles.snookles.com> Greetings. I looks like we've hit another memory-related ETS bug, on the same machine and using the same workload as I'd reported on 23 September 2007: http://www.erlang.org/pipermail/erlang-bugs/2007-September/000444.html The only extra platform info that I should've added to that report is the data from /proc/cpuinfo. I'll include that at the end of this message. (It's a 2x Opteron 2218, 4 cores total.) The "left" pointer in the RBTree_t pointer looks suspiciously un-pointer-like. I'm going to guess that our next step will involve disabling the SMP scheduler and see if we can trigger one of these bugs (or another) during a 24 hour stress test. If the bug appears without SMP support, then that tells us something quite interesting. For what it's worth ... this bug, together with my 23 September report, is less than 2 weeks away from causing us some big headaches with customer acceptance testing. Thanks again for looking into this matter. If there's other data I can provide, please let me know. -Scott # gdb /.../R11B-5/lib/erlang/erts-5.5.5/bin/beam.smp /var/cores/beam.smp.core.6668 [...] Core was generated by `/.../R11B-5/lib/erlang/erts-5.5.5/bin/beam.smp -A 64 -K true -'. Program terminated with signal 11, Segmentation fault. [...] #0 0x08078aec in bf_unlink_free_block (allctr=0x818a580, block=0x9799c4e4) at beam/erl_bestfit_alloc.c:755 755 beam/erl_bestfit_alloc.c: No such file or directory. in beam/erl_bestfit_alloc.c (gdb) where #0 0x08078aec in bf_unlink_free_block (allctr=0x818a580, block=0x9799c4e4) at beam/erl_bestfit_alloc.c:755 #1 0x080734cc in mbc_free (allctr=0x818a580, p=Variable "p" is not available. ) at beam/erl_alloc_util.c:747 #2 0x08076680 in erts_alcu_free_ts (type=106, extra=0x818a580, p=0x9799c260) at beam/erl_alloc_util.c:2221 #3 0x080d781b in db_free_table_continue_hash (tbl=0xaa42958c, first=0) at beam/erl_alloc.h:200 #4 0x080c6202 in free_table_cont (p=0xb7e2c344, tb=0xaa42958c, first=0) at beam/erl_db.c:2486 #5 0x080c649b in ets_db_delete_1 (A__p=0x80c6424, A_1=2856490380) at beam/erl_db.c:1190 #6 0x08102fc6 in process_main () at beam/beam_emu.c:3409 #7 0x080b00cf in sched_thread_func (vesdp=0xb6e2c968) at beam/erl_process.c:947 #8 0x08147f1a in thr_wrapper (vtwd=0xbfffef00) at common/ethread.c:503 #9 0x00444371 in start_thread () from /lib/tls/libpthread.so.0 #10 0x001f0ffe in clone () from /lib/tls/libc.so.6 (gdb) p *allctr $1 = {name_prefix = 0x814c232 "ets_", alloc_no = 8, name = {alloc = 0, realloc = 0, free = 0}, vsn_str = 0x814d0f9 "0.9", sbc_threshold = 524288, sbc_move_threshold = 80, main_carrier_size = 131072, max_mseg_sbcs = 256, max_mseg_mbcs = 10, largest_mbc_size = 5242880, smallest_mbc_size = 1048576, mbc_growth_stages = 10, mseg_opt = {cache = 1, preserv = 1, abs_shrink_th = 4145152, rel_shrink_th = 20}, mbc_header_size = 20, min_mbc_size = 16384, min_mbc_first_free_size = 4096, min_block_size = 32, mbc_list = {first = 0xb7ca6008, last = 0x8a28a008}, sbc_list = {first = 0x0, last = 0x0}, main_carrier = 0xb7ca6008, get_free_block = 0x8078b60 , link_free_block = 0x8078a20 , unlink_free_block = 0x8078ad0 , info_options = 0x8078cc4 , get_next_mbc_size = 0x80731c0 , creating_mbc = 0, destroying_mbc = 0, init_atoms = 0x8078c2c , mutex = {mtx = { pt_mtx = {__data = {__lock = 1, __count = 0, __owner = 6745, __kind = 0, __nusers = 1, __spins = 0}, __size = "\001\000\000\000\000\000\000\000Y\032\000\000\000\000\000\000\ 001\000\000\000\000\000\000", __align = 1}, is_rec_mtx = 0, prev = 0x81c17a0, next = 0x8189a8c}}, thread_safe = 1, ts_list = {prev = 0x0, next = 0x0}, atoms_initialized = 0, stopped = 0, calls = {this_alloc = {giga_no = 1, no = 641792639}, this_free = {giga_no = 1, no = 640206088}, this_realloc = {giga_no = 0, no = 15206700}, mseg_alloc = {giga_no = 0, no = 21}, mseg_dealloc = {giga_no = 0, no = 11}, mseg_realloc = { giga_no = 0, no = 0}, sys_alloc = {giga_no = 0, no = 345}, sys_free = { giga_no = 0, no = 189}, sys_realloc = {giga_no = 0, no = 0}}, sbcs = { curr_mseg = {no = 0, size = 0}, curr_sys_alloc = {no = 0, size = 0}, max = {no = 0, size = 0}, max_ever = {no = 0, size = 0}, blocks = {curr = { no = 0, size = 0}, max = {no = 0, size = 0}, max_ever = {no = 0, size = 0}}}, mbcs = {curr_mseg = {no = 10, size = 29376512}, curr_sys_alloc = {no = 156, size = 162660384}, max = {no = 166, size = 192036896}, max_ever = {no = 0, size = 0}, blocks = {curr = { no = 1586551, size = 144248760}, max = {no = 1892770, size = 167527120}, max_ever = {no = 0, size = 0}}}} (gdb) p *block $2 = 332427 (gdb) p x No symbol "x" in current context. (gdb) p *(RBTree_t *)block $3 = {hdr = 332427, flags = 2543437042, parent = 0xb2cb3, left = 0x88, right = 0x680489e9} (gdb) up #1 0x080734cc in mbc_free (allctr=0x818a580, p=Variable "p" is not available. ) at beam/erl_alloc_util.c:747 747 beam/erl_alloc_util.c: No such file or directory. in beam/erl_alloc_util.c (gdb) p allctr->unlink_free_block $4 = (void (*)(Allctr_t *, Block_t *)) 0x8078ad0 (gdb) p nxt_blk $5 = (Block_t *) 0x9799c4e4 (gdb) p *nxt_blk $6 = 332427 (gdb) p is_first_blk $7 = 135833100 (gdb) p is_last_blk $8 = 0 (gdb) up #2 0x08076680 in erts_alcu_free_ts (type=106, extra=0x818a580, p=0x9799c260) at beam/erl_alloc_util.c:2221 2221 in beam/erl_alloc_util.c (gdb) up #3 0x080d781b in db_free_table_continue_hash (tbl=0xaa42958c, first=0) at beam/erl_alloc.h:200 200 beam/erl_alloc.h: No such file or directory. in beam/erl_alloc.h (gdb) up #4 0x080c6202 in free_table_cont (p=0xb7e2c344, tb=0xaa42958c, first=0) at beam/erl_db.c:2486 2486 beam/erl_db.c: No such file or directory. in beam/erl_db.c (gdb) p *p $9 = {htop = 0xa4a31af0, stop = 0xa4a31ea0, heap = 0xa4a31900, hend = 0xa4a31ee4, heap_sz = 377, min_heap_size = 233, fp_exception = 0, hipe = {nsp = 0x0, nstack = 0x0, nstend = 0x0, ncallee = 0, closure = 0, nstgraylim = 0x0, nstblacklim = 0x0, ngra = 0, ncsp = 0x0, narity = 0}, arity = 0, arg_reg = 0xb7e2c394, max_arg_reg = 6, def_arg_reg = {2856490380, 117899, 3084146865, 3084525588, 0, 2000}, cp = 0xb7c63d1c, i = 0xb7da203c, catches = 2, fcalls = 1999, status = 3, rstatus = 0, rcount = 0, id = 1059, prio = 2, skipped = 0, reds = 24967791, error_handler = 7819, tracer_proc = 4294967291, trace_flags = 0, group_leader = 931, flags = 33, fvalue = 4294967291, freason = 256, ftrace = 4294967291, dist_entry = 0x0, next = 0x0, reg = 0xb7c72f7c, nlinks = 0xb7ee994c, monitors = 0x0, nodes_monitors = 0x0, msg = {first = 0x819b8f0, last = 0x819b8f0, save = 0xb7e2c410, len = 1}, bif_timers = 0x0, dictionary = 0xb7f6cba8, debug_dictionary = 0x0, ct = 0x0, seq_trace_clock = 0, seq_trace_lastcnt = 0, seq_trace_token = 4294967291, initial = {99595, 117899, 5}, current = 0xb7da2030, parent = 995, started = 1190516698, high_water = 0xa4a31940, old_hend = 0xb7d281bc, old_htop = 0xb7d27d24, old_heap = 0xb7d27bd8, gen_gcs = 715, max_gen_gcs = 65535, off_heap = { mso = 0x0, funs = 0x0, externals = 0x0, overhead = 0}, mbuf = 0x0, mbuf_sz = 0, arith_heap = 0x0, arith_avail = 0, ptimer = 0x0, scheduler_data = 0xb6e2c968, is_exiting = 0, scheduler_flags = 1, status_flags = 12, lock_flags = 1, msg_inq = {first = 0x0, last = 0xb7e2c4a0, len = 0}, suspendee = 4294967291, pending_suspenders = 0x0, pending_exit = {reason = 0, bp = 0x0}, hipe_smp = { have_receive_locks = 0}} (gdb) p *tb $10 = {common = {ref = {counter = 2}, rwlock = {rwmtx = {pt_rwlock = { __data = {__lock = 0, __nr_readers = 0, __readers_wakeup = 0, __writer_wakeup = 983, __nr_readers_queued = 0, __nr_writers_queued = 0, __flags = 0, __writer = 6745}, __size = '\0' , "%G??????%@003", '\0' , "Y\ 032\000", __align = 0}}}, type = 32, owner = 1059, the_name = 382219, id = 80127, meth = 0x81765c0, nitems = 385564, memory_size = { counter = 29558512}, megasec = 0, sec = 0, microsec = 0, fixations = 0x0, status = 97, slot = 5007, keypos = 2, kept_items = 0}, hash = {common = {ref = {counter = 2}, rwlock = {rwmtx = {pt_rwlock = { __data = {__lock = 0, __nr_readers = 0, __readers_wakeup = 0, __writer_wakeup = 983, __nr_readers_queued = 0, __nr_writers_queued = 0, __flags = 0, __writer = 6745}, __size = '\0' , "%G??????%@003", '\0' , " Y\032\000", __align = 0}}}, type = 32, owner = 1059, the_name = 382219, id = 80127, meth = 0x81765c0, nitems = 385564, memory_size = { counter = 29558512}, megasec = 0, sec = 0, microsec = 0, fixations = 0x0, status = 97, slot = 5007, keypos = 2, kept_items = 0}, fixdel = 0x0, seg = 0x8de67038, szm = 65535, nactive = 85594, nslots = 85760, p = 126, nsegs = 384}, tree = {common = {ref = { counter = 2}, rwlock = {rwmtx = {pt_rwlock = {__data = {__lock = 0, __nr_readers = 0, __readers_wakeup = 0, __writer_wakeup = 983, __nr_readers_queued = 0, __nr_writers_queued = 0, __flags = 0, __writer = 6745}, __size = '\0' , "%G??????%@003", '\0' , " Y\032\000", __align = 0}}}, type = 32, owner = 1059, the_name = 382219, id = 80127, meth = 0x81765c0, nitems = 385564, memory_size = { counter = 29558512}, megasec = 0, sec = 0, microsec = 0, fixations = 0x0, status = 97, slot = 5007, keypos = 2, kept_items = 0}, root = 0x0, stack = 0x8de67038, stack_pos = 65535, slot_pos = 85594, deletion = 85760}} (gdb) p first $11 = 0 (gdb) up #5 0x080c649b in ets_db_delete_1 (A__p=0x80c6424, A_1=2856490380) at beam/erl_db.c:1190 1190 in beam/erl_db.c (gdb) q ------------------------------------------------------------------ [root@REDACTED ~]$ cat /proc/cpuinfo processor : 0 vendor_id : AuthenticAMD cpu family : 15 model : 65 model name : Dual-Core AMD Opteron(tm) Processor 2218 stepping : 2 cpu MHz : 2601.145 cache size : 1024 KB physical id : 0 siblings : 2 core id : 0 cpu cores : 2 fdiv_bug : no hlt_bug : no f00f_bug : no coma_bug : no fpu : yes fpu_exception : yes cpuid level : 1 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext lm 3dnowext 3dnow pni bogomips : 5203.55 processor : 1 vendor_id : AuthenticAMD cpu family : 15 model : 65 model name : Dual-Core AMD Opteron(tm) Processor 2218 stepping : 2 cpu MHz : 2601.145 cache size : 1024 KB physical id : 0 siblings : 2 core id : 1 cpu cores : 2 fdiv_bug : no hlt_bug : no f00f_bug : no coma_bug : no fpu : yes fpu_exception : yes cpuid level : 1 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext lm 3dnowext 3dnow pni bogomips : 5200.11 processor : 2 vendor_id : AuthenticAMD cpu family : 15 model : 65 model name : Dual-Core AMD Opteron(tm) Processor 2218 stepping : 2 cpu MHz : 2601.145 cache size : 1024 KB physical id : 1 siblings : 2 core id : 0 cpu cores : 2 fdiv_bug : no hlt_bug : no f00f_bug : no coma_bug : no fpu : yes fpu_exception : yes cpuid level : 1 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext lm 3dnowext 3dnow pni bogomips : 5200.46 processor : 3 vendor_id : AuthenticAMD cpu family : 15 model : 65 model name : Dual-Core AMD Opteron(tm) Processor 2218 stepping : 2 cpu MHz : 2601.145 cache size : 1024 KB physical id : 1 siblings : 2 core id : 1 cpu cores : 2 fdiv_bug : no hlt_bug : no f00f_bug : no coma_bug : no fpu : yes fpu_exception : yes cpuid level : 1 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext lm 3dnowext 3dnow pni bogomips : 5200.21 From rickard.s.green@REDACTED Tue Sep 25 10:02:53 2007 From: rickard.s.green@REDACTED (Rickard Green) Date: Tue, 25 Sep 2007 10:02:53 +0200 Subject: [erlang-bugs] SIGSEGV in SMP R11B-5 in bf_unlink_free_block() at beam/erl_bestfit_alloc.c:755 In-Reply-To: <200709250159.l8P1xfZn014219@snookles.snookles.com> References: <200709250159.l8P1xfZn014219@snookles.snookles.com> Message-ID: <46F8C0AD.1000409@ericsson.com> We've had a brief look at it without finding anything yet, but we'll dig deeper. As you suggested, it would be interesting to see if you are able to trigger it without smp support. BR, Rickard Green, Erlang/OTP, Ericsson AB. Scott Lystig Fritchie wrote: > Greetings. I looks like we've hit another memory-related ETS bug, > on the same machine and using the same workload as I'd reported on > 23 September 2007: > > http://www.erlang.org/pipermail/erlang-bugs/2007-September/000444.html > > The only extra platform info that I should've added to that report is > the data from /proc/cpuinfo. I'll include that at the end of this > message. (It's a 2x Opteron 2218, 4 cores total.) > > The "left" pointer in the RBTree_t pointer looks suspiciously > un-pointer-like. > > I'm going to guess that our next step will involve disabling the SMP > scheduler and see if we can trigger one of these bugs (or another) > during a 24 hour stress test. If the bug appears without SMP support, > then that tells us something quite interesting. > > For what it's worth ... this bug, together with my 23 September > report, is less than 2 weeks away from causing us some big headaches > with customer acceptance testing. > > Thanks again for looking into this matter. If there's other data I > can provide, please let me know. > > -Scott > > # gdb /.../R11B-5/lib/erlang/erts-5.5.5/bin/beam.smp /var/cores/beam.smp.core.6668 > [...] > Core was generated by `/.../R11B-5/lib/erlang/erts-5.5.5/bin/beam.smp -A 64 -K true -'. > Program terminated with signal 11, Segmentation fault. > [...] > #0 0x08078aec in bf_unlink_free_block (allctr=0x818a580, block=0x9799c4e4) > at beam/erl_bestfit_alloc.c:755 > 755 beam/erl_bestfit_alloc.c: No such file or directory. > in beam/erl_bestfit_alloc.c > (gdb) where > #0 0x08078aec in bf_unlink_free_block (allctr=0x818a580, block=0x9799c4e4) > at beam/erl_bestfit_alloc.c:755 > #1 0x080734cc in mbc_free (allctr=0x818a580, p=Variable "p" is not available. > ) at beam/erl_alloc_util.c:747 > #2 0x08076680 in erts_alcu_free_ts (type=106, extra=0x818a580, p=0x9799c260) > at beam/erl_alloc_util.c:2221 > #3 0x080d781b in db_free_table_continue_hash (tbl=0xaa42958c, first=0) > at beam/erl_alloc.h:200 > #4 0x080c6202 in free_table_cont (p=0xb7e2c344, tb=0xaa42958c, first=0) > at beam/erl_db.c:2486 > #5 0x080c649b in ets_db_delete_1 (A__p=0x80c6424, A_1=2856490380) > at beam/erl_db.c:1190 > #6 0x08102fc6 in process_main () at beam/beam_emu.c:3409 > #7 0x080b00cf in sched_thread_func (vesdp=0xb6e2c968) > at beam/erl_process.c:947 > #8 0x08147f1a in thr_wrapper (vtwd=0xbfffef00) at common/ethread.c:503 > #9 0x00444371 in start_thread () from /lib/tls/libpthread.so.0 > #10 0x001f0ffe in clone () from /lib/tls/libc.so.6 > > (gdb) p *allctr > $1 = {name_prefix = 0x814c232 "ets_", alloc_no = 8, name = {alloc = 0, > realloc = 0, free = 0}, vsn_str = 0x814d0f9 "0.9", sbc_threshold = 524288, > sbc_move_threshold = 80, main_carrier_size = 131072, max_mseg_sbcs = 256, > max_mseg_mbcs = 10, largest_mbc_size = 5242880, smallest_mbc_size = 1048576, > mbc_growth_stages = 10, mseg_opt = {cache = 1, preserv = 1, > abs_shrink_th = 4145152, rel_shrink_th = 20}, mbc_header_size = 20, > min_mbc_size = 16384, min_mbc_first_free_size = 4096, min_block_size = 32, > mbc_list = {first = 0xb7ca6008, last = 0x8a28a008}, sbc_list = {first = 0x0, > last = 0x0}, main_carrier = 0xb7ca6008, > get_free_block = 0x8078b60 , > link_free_block = 0x8078a20 , > unlink_free_block = 0x8078ad0 , > info_options = 0x8078cc4 , > get_next_mbc_size = 0x80731c0 , creating_mbc = 0, > destroying_mbc = 0, init_atoms = 0x8078c2c , mutex = {mtx = { > pt_mtx = {__data = {__lock = 1, __count = 0, __owner = 6745, __kind = 0, > __nusers = 1, __spins = 0}, > __size = "\001\000\000\000\000\000\000\000Y\032\000\000\000\000\000\000\ > 001\000\000\000\000\000\000", __align = 1}, is_rec_mtx = 0, prev = 0x81c17a0, > next = 0x8189a8c}}, thread_safe = 1, ts_list = {prev = 0x0, next = 0x0}, > atoms_initialized = 0, stopped = 0, calls = {this_alloc = {giga_no = 1, > no = 641792639}, this_free = {giga_no = 1, no = 640206088}, > this_realloc = {giga_no = 0, no = 15206700}, mseg_alloc = {giga_no = 0, > no = 21}, mseg_dealloc = {giga_no = 0, no = 11}, mseg_realloc = { > giga_no = 0, no = 0}, sys_alloc = {giga_no = 0, no = 345}, sys_free = { > giga_no = 0, no = 189}, sys_realloc = {giga_no = 0, no = 0}}, sbcs = { > curr_mseg = {no = 0, size = 0}, curr_sys_alloc = {no = 0, size = 0}, > max = {no = 0, size = 0}, max_ever = {no = 0, size = 0}, blocks = {curr = { > no = 0, size = 0}, max = {no = 0, size = 0}, max_ever = {no = 0, > size = 0}}}, mbcs = {curr_mseg = {no = 10, size = 29376512}, > curr_sys_alloc = {no = 156, size = 162660384}, max = {no = 166, > size = 192036896}, max_ever = {no = 0, size = 0}, blocks = {curr = { > no = 1586551, size = 144248760}, max = {no = 1892770, > size = 167527120}, max_ever = {no = 0, size = 0}}}} > (gdb) p *block > $2 = 332427 > (gdb) p x > No symbol "x" in current context. > (gdb) p *(RBTree_t *)block > $3 = {hdr = 332427, flags = 2543437042, parent = 0xb2cb3, left = 0x88, > right = 0x680489e9} > (gdb) up > #1 0x080734cc in mbc_free (allctr=0x818a580, p=Variable "p" is not available. > ) at beam/erl_alloc_util.c:747 > 747 beam/erl_alloc_util.c: No such file or directory. > in beam/erl_alloc_util.c > (gdb) p allctr->unlink_free_block > $4 = (void (*)(Allctr_t *, Block_t *)) 0x8078ad0 > (gdb) p nxt_blk > $5 = (Block_t *) 0x9799c4e4 > (gdb) p *nxt_blk > $6 = 332427 > (gdb) p is_first_blk > $7 = 135833100 > (gdb) p is_last_blk > $8 = 0 > (gdb) up > #2 0x08076680 in erts_alcu_free_ts (type=106, extra=0x818a580, p=0x9799c260) > at beam/erl_alloc_util.c:2221 > 2221 in beam/erl_alloc_util.c > (gdb) up > #3 0x080d781b in db_free_table_continue_hash (tbl=0xaa42958c, first=0) > at beam/erl_alloc.h:200 > 200 beam/erl_alloc.h: No such file or directory. > in beam/erl_alloc.h > (gdb) up > #4 0x080c6202 in free_table_cont (p=0xb7e2c344, tb=0xaa42958c, first=0) > at beam/erl_db.c:2486 > 2486 beam/erl_db.c: No such file or directory. > in beam/erl_db.c > (gdb) p *p > $9 = {htop = 0xa4a31af0, stop = 0xa4a31ea0, heap = 0xa4a31900, > hend = 0xa4a31ee4, heap_sz = 377, min_heap_size = 233, fp_exception = 0, > hipe = {nsp = 0x0, nstack = 0x0, nstend = 0x0, ncallee = 0, closure = 0, > nstgraylim = 0x0, nstblacklim = 0x0, ngra = 0, ncsp = 0x0, narity = 0}, > arity = 0, arg_reg = 0xb7e2c394, max_arg_reg = 6, def_arg_reg = {2856490380, > 117899, 3084146865, 3084525588, 0, 2000}, cp = 0xb7c63d1c, i = 0xb7da203c, > catches = 2, fcalls = 1999, status = 3, rstatus = 0, rcount = 0, id = 1059, > prio = 2, skipped = 0, reds = 24967791, error_handler = 7819, > tracer_proc = 4294967291, trace_flags = 0, group_leader = 931, flags = 33, > fvalue = 4294967291, freason = 256, ftrace = 4294967291, dist_entry = 0x0, > next = 0x0, reg = 0xb7c72f7c, nlinks = 0xb7ee994c, monitors = 0x0, > nodes_monitors = 0x0, msg = {first = 0x819b8f0, last = 0x819b8f0, > save = 0xb7e2c410, len = 1}, bif_timers = 0x0, dictionary = 0xb7f6cba8, > debug_dictionary = 0x0, ct = 0x0, seq_trace_clock = 0, > seq_trace_lastcnt = 0, seq_trace_token = 4294967291, initial = {99595, > 117899, 5}, current = 0xb7da2030, parent = 995, started = 1190516698, > high_water = 0xa4a31940, old_hend = 0xb7d281bc, old_htop = 0xb7d27d24, > old_heap = 0xb7d27bd8, gen_gcs = 715, max_gen_gcs = 65535, off_heap = { > mso = 0x0, funs = 0x0, externals = 0x0, overhead = 0}, mbuf = 0x0, > mbuf_sz = 0, arith_heap = 0x0, arith_avail = 0, ptimer = 0x0, > scheduler_data = 0xb6e2c968, is_exiting = 0, scheduler_flags = 1, > status_flags = 12, lock_flags = 1, msg_inq = {first = 0x0, > last = 0xb7e2c4a0, len = 0}, suspendee = 4294967291, > pending_suspenders = 0x0, pending_exit = {reason = 0, bp = 0x0}, hipe_smp = { > have_receive_locks = 0}} > (gdb) p *tb > $10 = {common = {ref = {counter = 2}, rwlock = {rwmtx = {pt_rwlock = { > __data = {__lock = 0, __nr_readers = 0, __readers_wakeup = 0, > __writer_wakeup = 983, __nr_readers_queued = 0, > __nr_writers_queued = 0, __flags = 0, __writer = 6745}, > __size = '\0' , "%G??????%@003", '\0' , "Y\ > 032\000", __align = 0}}}, type = 32, owner = 1059, the_name = 382219, > id = 80127, meth = 0x81765c0, nitems = 385564, memory_size = { > counter = 29558512}, megasec = 0, sec = 0, microsec = 0, > fixations = 0x0, status = 97, slot = 5007, keypos = 2, kept_items = 0}, > hash = {common = {ref = {counter = 2}, rwlock = {rwmtx = {pt_rwlock = { > __data = {__lock = 0, __nr_readers = 0, __readers_wakeup = 0, > __writer_wakeup = 983, __nr_readers_queued = 0, > __nr_writers_queued = 0, __flags = 0, __writer = 6745}, > __size = '\0' , "%G??????%@003", '\0' , " > Y\032\000", __align = 0}}}, type = 32, owner = 1059, the_name = 382219, > id = 80127, meth = 0x81765c0, nitems = 385564, memory_size = { > counter = 29558512}, megasec = 0, sec = 0, microsec = 0, > fixations = 0x0, status = 97, slot = 5007, keypos = 2, kept_items = 0}, > fixdel = 0x0, seg = 0x8de67038, szm = 65535, nactive = 85594, > nslots = 85760, p = 126, nsegs = 384}, tree = {common = {ref = { > counter = 2}, rwlock = {rwmtx = {pt_rwlock = {__data = {__lock = 0, > __nr_readers = 0, __readers_wakeup = 0, __writer_wakeup = 983, > __nr_readers_queued = 0, __nr_writers_queued = 0, __flags = 0, > __writer = 6745}, > __size = '\0' , "%G??????%@003", '\0' , " > Y\032\000", __align = 0}}}, type = 32, owner = 1059, the_name = 382219, > id = 80127, meth = 0x81765c0, nitems = 385564, memory_size = { > counter = 29558512}, megasec = 0, sec = 0, microsec = 0, > fixations = 0x0, status = 97, slot = 5007, keypos = 2, kept_items = 0}, > root = 0x0, stack = 0x8de67038, stack_pos = 65535, slot_pos = 85594, > deletion = 85760}} > (gdb) p first > $11 = 0 > (gdb) up > #5 0x080c649b in ets_db_delete_1 (A__p=0x80c6424, A_1=2856490380) > at beam/erl_db.c:1190 > 1190 in beam/erl_db.c > (gdb) q > > ------------------------------------------------------------------ > > [root@REDACTED ~]$ cat /proc/cpuinfo > processor : 0 > vendor_id : AuthenticAMD > cpu family : 15 > model : 65 > model name : Dual-Core AMD Opteron(tm) Processor 2218 > stepping : 2 > cpu MHz : 2601.145 > cache size : 1024 KB > physical id : 0 > siblings : 2 > core id : 0 > cpu cores : 2 > fdiv_bug : no > hlt_bug : no > f00f_bug : no > coma_bug : no > fpu : yes > fpu_exception : yes > cpuid level : 1 > wp : yes > flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext lm 3dnowext 3dnow pni > bogomips : 5203.55 > > processor : 1 > vendor_id : AuthenticAMD > cpu family : 15 > model : 65 > model name : Dual-Core AMD Opteron(tm) Processor 2218 > stepping : 2 > cpu MHz : 2601.145 > cache size : 1024 KB > physical id : 0 > siblings : 2 > core id : 1 > cpu cores : 2 > fdiv_bug : no > hlt_bug : no > f00f_bug : no > coma_bug : no > fpu : yes > fpu_exception : yes > cpuid level : 1 > wp : yes > flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext lm 3dnowext 3dnow pni > bogomips : 5200.11 > > processor : 2 > vendor_id : AuthenticAMD > cpu family : 15 > model : 65 > model name : Dual-Core AMD Opteron(tm) Processor 2218 > stepping : 2 > cpu MHz : 2601.145 > cache size : 1024 KB > physical id : 1 > siblings : 2 > core id : 0 > cpu cores : 2 > fdiv_bug : no > hlt_bug : no > f00f_bug : no > coma_bug : no > fpu : yes > fpu_exception : yes > cpuid level : 1 > wp : yes > flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext lm 3dnowext 3dnow pni > bogomips : 5200.46 > > processor : 3 > vendor_id : AuthenticAMD > cpu family : 15 > model : 65 > model name : Dual-Core AMD Opteron(tm) Processor 2218 > stepping : 2 > cpu MHz : 2601.145 > cache size : 1024 KB > physical id : 1 > siblings : 2 > core id : 1 > cpu cores : 2 > fdiv_bug : no > hlt_bug : no > f00f_bug : no > coma_bug : no > fpu : yes > fpu_exception : yes > cpuid level : 1 > wp : yes > flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext lm 3dnowext 3dnow pni > bogomips : 5200.21 > > > > > > > ------------------------------------------------------------------------ > > _______________________________________________ > erlang-bugs mailing list > erlang-bugs@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-bugs From Balint.Reczey@REDACTED Tue Sep 25 13:27:27 2007 From: Balint.Reczey@REDACTED (Balint Reczey (IJ/ETH)) Date: Tue, 25 Sep 2007 13:27:27 +0200 Subject: [erlang-bugs] [BUG] ssh_file:read_pem64/3 crashes on password protected private keys Message-ID: <1190719647.4265.6.camel@localhost> Hi, I tried to connect to a machine using ssh_cm and discovered that it crashed badly: 5> crypto:start(). ok 6> ssh:start(). ok 7> ssh_cm:connect("localhost"). =ERROR REPORT==== 17-Sep-2007::14:54:56 === ** Generic server <0.52.0> terminating ** Last message in was {connect,<0.50.0>,"localhost",22} ** When Server state == {state,client,undefined,16,[],[],0,[],[],undefined} ** Reason for termination == ** {function_clause,[{ssh_bits,b64d,"-"}, {ssh_bits,b64_dec,1}, {ssh_bits,b64_dec,1}, {ssh_bits,b64_decode,1}, {ssh_file,read_pem64,3}, {ssh_file,read_private_key_v2,2}, {ssh_userauth,public_key,5}, {ssh_userauth,auth,3}]} ** exited: {function_clause,[{ssh_bits,b64d,"-"}, {ssh_bits,b64_dec,1}, {ssh_bits,b64_dec,1}, {ssh_bits,b64_decode,1}, {ssh_file,read_pem64,3}, {ssh_file,read_private_key_v2,2}, {ssh_userauth,public_key,5}, {ssh_userauth,auth,3}]} ** The private keys generated with ssh-keygen has the following format when the password is set: -----BEGIN RSA PRIVATE KEY----- Proc-Type: 4,ENCRYPTED DEK-Info: DES-EDE3-CBC,BAB972D7825B1E6D BEoV8pr0r0sR1GfPabGyKJKx3u6+IFIicba1Hy37foyJ3EicFuDWiTymLyiXMuCU Qm0UZv5uaSfrI7u+RjCNp7H2PCubdzy18SsqTLa6j1GBbqlx9HZtg942G3soly2i k2534TEBkoEJl5a/UpPFLEwALa3nb0lnCUNjqjH7jVR98Tsok1TjYHY7Tm3j8kah ... ssh_file:read_pem/2 and ssh_file:read_pem64/3 assumes that the base64 encoded part starts right after the "-----BEGIN RSA PRIVATE KEY-----" line, like in a not password protected keyfile: otp_src_R11B-5/lib/ssh/src/ssh_file.erl: read_pem(Cs, Type) -> case read_line(Cs) of {"-----BEGIN "++Rest,Cs1} -> case string:tokens(Rest, " ") of [Type, "PRIVATE", "KEY-----"] -> read_pem64(Cs1, [], Type); _ -> {error, bad_format} end; {"",Cs1} when Cs1 =/= "" -> read_pem(Cs1,Type); {_,""} -> {error, bad_format} end. read_pem64(Cs, Acc, Type) -> case read_line(Cs) of {"-----END "++Rest,_Cs1} -> case string:tokens(Rest, " ") of [Type, "PRIVATE", "KEY-----"] -> {ok,ssh_bits:b64_decode(append(reverse(Acc)))}; Toks -> error_logger:format("ssh: TOKENS=~p\n", [Toks]), {error, bad_format} end; {B64, Cs1} when Cs1 =/= "" -> read_pem64(Cs1, [B64|Acc], Type); _What -> {error, bad_format} end. I think it would be great to support password protected private keys, or just not crashing on them. Regards, Balint From Balint.Reczey@REDACTED Tue Sep 25 13:42:18 2007 From: Balint.Reczey@REDACTED (Balint Reczey (IJ/ETH)) Date: Tue, 25 Sep 2007 13:42:18 +0200 Subject: [erlang-bugs] [BUG] xmerl does not support contains(string, string) XPath function Message-ID: <1190720538.4265.18.camel@localhost> Hi, The xmerl_xpath module summary says that it implements the whole XPath language, but it seems that the contains() string function ( http://www.w3.org/TR/xpath#function-contains ) is missing: 13> xmerl_xpath:string("//foo[contains(@bar, 'oe')]",element(1,xmerl_scan:string(""))). ** exited: {unknown_expr, {xmlObj, nodeset, [{xmlNode, attribute, {xmlAttribute,bar,[],[],[],[],1,[],"Joe",false}, [{xmlNode, element, {xmlElement, foo, foo, [], {xmlNamespace,[],[]}, [], 1, [{xmlAttribute,bar,[],[],[],[],...}], [], [], "/export/localhome/lblircz", undeclared}, [{xmlNode, root_node, {xmlDocument, {xmlElement, foo, foo, [], {xmlNamespace,[],[]}, [], 1, [...],...}}, [], 2}], 1}, {xmlNode, root_node, {xmlDocument, {xmlElement, foo, foo, [], {xmlNamespace,[],[]}, [], 1, [{xmlAttribute,bar,[],...}], [], [], "/home/erlanguser", undeclared}}, [], 2}], 1}]}} ** 14> Regards, Balint From ingela@REDACTED Tue Sep 25 13:51:50 2007 From: ingela@REDACTED (Ingela Anderton Andin) Date: Tue, 25 Sep 2007 13:51:50 +0200 Subject: [erlang-bugs] [BUG] ssh_file:read_pem64/3 crashes on password protected private keys In-Reply-To: <1190719647.4265.6.camel@localhost> References: <1190719647.4265.6.camel@localhost> Message-ID: <46F8F656.3040108@erix.ericsson.se> Hi! Yes we fully agree with you. It has been on the todo list for some time but for priority reasons it has not yet been fixed. Alas we will probably not have time to fix it for R12 but it will be fixed as soon as we can fit it in our work schedule. Regards Ingela - OTP team Balint Reczey (IJ/ETH) wrote: > Hi, > > I tried to connect to a machine using ssh_cm and discovered that it > crashed badly: > > 5> crypto:start(). > ok > 6> ssh:start(). > ok > 7> ssh_cm:connect("localhost"). > > =ERROR REPORT==== 17-Sep-2007::14:54:56 === > ** Generic server <0.52.0> terminating > ** Last message in was {connect,<0.50.0>,"localhost",22} > ** When Server state == > {state,client,undefined,16,[],[],0,[],[],undefined} > ** Reason for termination == > ** {function_clause,[{ssh_bits,b64d,"-"}, > {ssh_bits,b64_dec,1}, > {ssh_bits,b64_dec,1}, > {ssh_bits,b64_decode,1}, > {ssh_file,read_pem64,3}, > {ssh_file,read_private_key_v2,2}, > {ssh_userauth,public_key,5}, > {ssh_userauth,auth,3}]} > ** exited: {function_clause,[{ssh_bits,b64d,"-"}, > {ssh_bits,b64_dec,1}, > {ssh_bits,b64_dec,1}, > {ssh_bits,b64_decode,1}, > {ssh_file,read_pem64,3}, > {ssh_file,read_private_key_v2,2}, > {ssh_userauth,public_key,5}, > {ssh_userauth,auth,3}]} ** > > The private keys generated with ssh-keygen has the following format when > the password is set: > > -----BEGIN RSA PRIVATE KEY----- > Proc-Type: 4,ENCRYPTED > DEK-Info: DES-EDE3-CBC,BAB972D7825B1E6D > > BEoV8pr0r0sR1GfPabGyKJKx3u6+IFIicba1Hy37foyJ3EicFuDWiTymLyiXMuCU > Qm0UZv5uaSfrI7u+RjCNp7H2PCubdzy18SsqTLa6j1GBbqlx9HZtg942G3soly2i > k2534TEBkoEJl5a/UpPFLEwALa3nb0lnCUNjqjH7jVR98Tsok1TjYHY7Tm3j8kah > > ... > > ssh_file:read_pem/2 and ssh_file:read_pem64/3 assumes that the base64 > encoded part starts right after the "-----BEGIN RSA PRIVATE KEY-----" > line, like in a not password protected keyfile: > > otp_src_R11B-5/lib/ssh/src/ssh_file.erl: > > read_pem(Cs, Type) -> > case read_line(Cs) of > {"-----BEGIN "++Rest,Cs1} -> > case string:tokens(Rest, " ") of > [Type, "PRIVATE", "KEY-----"] -> > read_pem64(Cs1, [], Type); > _ -> > {error, bad_format} > end; > {"",Cs1} when Cs1 =/= "" -> > read_pem(Cs1,Type); > {_,""} -> > {error, bad_format} > end. > > read_pem64(Cs, Acc, Type) -> > case read_line(Cs) of > {"-----END "++Rest,_Cs1} -> > case string:tokens(Rest, " ") of > [Type, "PRIVATE", "KEY-----"] -> > > {ok,ssh_bits:b64_decode(append(reverse(Acc)))}; > Toks -> > error_logger:format("ssh: TOKENS=~p\n", > [Toks]), > {error, bad_format} > end; > {B64, Cs1} when Cs1 =/= "" -> > read_pem64(Cs1, [B64|Acc], Type); > _What -> > {error, bad_format} > end. > > > I think it would be great to support password protected private keys, or > just not crashing on them. > > Regards, > Balint > > > > > _______________________________________________ > erlang-bugs mailing list > erlang-bugs@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-bugs > > From stupalo@REDACTED Tue Sep 25 15:29:25 2007 From: stupalo@REDACTED (=?ISO-8859-1?Q?G=F6ran_Stupalo?=) Date: Tue, 25 Sep 2007 15:29:25 +0200 Subject: [erlang-bugs] documentation issue In-Reply-To: References: Message-ID: <46F90D35.7020205@erix.ericsson.se> Thank you for the new example Matthew. We will hopefully have it corrected in R12B. /Goran, Erlang/OTP > The gen_fsm example, code_lock, on > erlang/doc/design_principles/fsm.html#3 web docs will not compile do > to a bad semicolon before the end, also it does not behave the full > behaviour, or all the functions defined. Attached is a working > example that I think is better and compiles with out warnings.. > > Mog > > ------------------------------------------------------------------------ > > _______________________________________________ > erlang-bugs mailing list > erlang-bugs@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-bugs From bertil.karlsson@REDACTED Wed Sep 26 08:42:18 2007 From: bertil.karlsson@REDACTED (Bertil Karlsson) Date: Wed, 26 Sep 2007 08:42:18 +0200 Subject: [erlang-bugs] [BUG] xmerl does not support contains(string, string) XPath function (fwd) In-Reply-To: References: Message-ID: <46F9FF4A.1010609@ericsson.com> Thank you for reporting this bug. I will put it on the todo list, but I will not be able to fix this for the R12 release. /Bertil > Date: Tue, 25 Sep 2007 13:42:18 +0200 > From: "Balint Reczey (IJ/ETH)" > To: erlang-bugs@REDACTED > Subject: [erlang-bugs] [BUG] xmerl does not support contains(string, > string) XPath function > > Hi, > > The xmerl_xpath module summary says that it implements the whole XPath language, but it seems > that the contains() string function ( http://www.w3.org/TR/xpath#function-contains ) is missing: > > 13> xmerl_xpath:string("//foo[contains(@bar, 'oe')]",element(1,xmerl_scan:string(""))). > ** exited: {unknown_expr, > {xmlObj, > nodeset, > [{xmlNode, > attribute, > {xmlAttribute,bar,[],[],[],[],1,[],"Joe",false}, > [{xmlNode, > element, > {xmlElement, > foo, > foo, > [], > {xmlNamespace,[],[]}, > [], > 1, > [{xmlAttribute,bar,[],[],[],[],...}], > [], > [], > "/export/localhome/lblircz", > undeclared}, > [{xmlNode, > root_node, > {xmlDocument, > {xmlElement, > foo, > foo, > [], > {xmlNamespace,[],[]}, > [], > 1, > [...],...}}, > [], > 2}], > 1}, > {xmlNode, > root_node, > {xmlDocument, > {xmlElement, > foo, > foo, > [], > {xmlNamespace,[],[]}, > [], > 1, > [{xmlAttribute,bar,[],...}], > [], > [], > "/home/erlanguser", > undeclared}}, > [], > 2}], > 1}]}} ** > 14> > > > > Regards, > Balint > > > _______________________________________________ > erlang-bugs mailing list > erlang-bugs@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-bugs > > > From bjorn@REDACTED Wed Sep 26 10:19:15 2007 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 26 Sep 2007 10:19:15 +0200 Subject: [erlang-bugs] Malformatted man pages In-Reply-To: <20070826093953.6d124004@localhost> References: <20070826093953.6d124004@localhost> Message-ID: Christian Faulhammer writes: > * PGP Signed by an unknown key: 08/26/2007 at 09:39:53 AM > Hi, > > sections in man pages need to be formatted upper case. "See Also" > isn't in the ones shipped with erlang, please change it. We'll try to fix that in the R12B release. /Bj?rn -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From bjorn@REDACTED Wed Sep 26 10:25:37 2007 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 26 Sep 2007 10:25:37 +0200 Subject: [erlang-bugs] Hipe/native and reloading modules In-Reply-To: <20070916194735.QZDE15797.dukecmmtao01.coxmail.com@PhilLapTop> References: <20070916194735.QZDE15797.dukecmmtao01.coxmail.com@PhilLapTop> Message-ID: We are aware that native code does not follow the usual rules for code reloading. For technical reasons, in releases up to R11B it was not possible to correct this deficiency. In R12B it will be possible, but the correction will be probably be done in a later R12B release, not in the initial R12B-0 release. /Bj?rn "Philip Smolen" writes: > I noticed something strange when I use the "native" option to compile my > code. Code reloading doesn't work the same way as when I don't specify > "native". Here's some sample code. > > > > -module(reload). > > -export([show/0, loop/0, version/0]). > > > > show() -> spawn(fun loop/0). > > > > loop() -> > > io:format("This process: ~p, Most current version: ~p ~n", > > [version(), reload:version()]), > > receive > > reload -> reload:loop(); > > exit -> void > > after 5000 -> > > loop() > > end. > > > > %% Change this each time: > > version() -> 22. > > > > When I don't use the native mode, it works as documented. When I change the > version number and say "c(reload)" the first version number stays the same > and the second version number is incremented. > > > > If I say "c(reload, native)" then it acts strange. In that case both > version numbers change to the latest one. More precisely: > > * The recursive call to loop() always calls the original version of > the code, as it should. (Change the io:format statement if you want to > verify that.) > * The recursive call to reload:loop() always calls the most recent > version of the code, as it should. > * The call to reload:version() always calls the most recent version of > the code, as it should. > * The call to version() works differently in different cases. If you > compiled without the native switch, it calls the original version of the > code, as it should. If you compiled with the native switch, it incorrectly > calls the latest version. > > > > I noticed something else that was strange, although I'm not sure if it's a > bug or a feature. When I don't use the "native" switch, I can see that > there are only two versions of the code. Erlang kills my process if it's > using code that's too old, exactly as documented. However, if I compile > with the "native" switch then Erlang never kills my old code. > > > > I'm running otp_src_R11B-5.tar.gz on Fedora. > > > > PS The native option makes things work much faster! > > _______________________________________________ > erlang-bugs mailing list > erlang-bugs@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-bugs -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From bjorn@REDACTED Wed Sep 26 11:07:19 2007 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 26 Sep 2007 11:07:19 +0200 Subject: [erlang-bugs] filelib:wildcard In-Reply-To: <20070910095736.GA8940@lambdastream.com> References: <20070910095736.GA8940@lambdastream.com> Message-ID: Thanks for the bug report. It indeed seem to be a bug. I've added it to my to-do and hope to correct it for the R12B release. /Bjorn Samuel Rivas writes: > Hi, > > I'm getting strange results with filelib:wildcard/2 (tested in R11B-1 and > R11B-5): > > 3> filelib:wildcard("ebin/*.app", "/home/samuel/local/src/yaws"). > [] > 4> filelib:wildcard("*/*.app", "/home/samuel/local/src/yaws"). > ["ebin/yaws.app"] > > > If I move to Cwd it works as I expected (even though it is a symlink): > > 8> cd("/home/samuel/local/src/yaws"). > /var/local/scratch/samuel/src/yaws-1.58 > ok > 9> filelib:wildcard("ebin/*.app", "/home/samuel/local/src/yaws"). > ["ebin/yaws.app"] > > If this is a bug, a simple workaround is using filelib:wildcard/1 and > filename:join/2 to build an absolute wildcard. > > Regards > -- > Samuel > _______________________________________________ > erlang-bugs mailing list > erlang-bugs@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-bugs > -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From anders.nygren@REDACTED Thu Sep 27 20:10:30 2007 From: anders.nygren@REDACTED (Anders Nygren) Date: Thu, 27 Sep 2007 13:10:30 -0500 Subject: [erlang-bugs] Module name completion in the shell Message-ID: I have noticed that the module name completion does not work quite correctly in the shell when the module name starts with an uppercase letter. In my case I have a module MP.erl generated from an ASN.1 spec. If I enter M and then tab in the shell the shell makes the completion to MP: and then it is possible to enter and tab complete the function name. But of course it fails with ** 2: variable 'MP' is unbound ** when I try to execute the function call. Entering 'M (single quote + M) does not give any completion. This is on version Erlang (BEAM) emulator version 5.5.4 [source] [smp:2] [async-threads:0] [hipe] [kernel-poll:false] /Anders From mogorman@REDACTED Fri Sep 28 19:52:35 2007 From: mogorman@REDACTED (Matthew O'Gorman) Date: Fri, 28 Sep 2007 12:52:35 -0500 Subject: [erlang-bugs] odd rr behaivor Message-ID: I wouldn't necessarily call this a bug, but it seems rr does not allow for passing an atom to it in the same way, for example 1> ls(). mog.hrl ok 2> rr(mog). {error, nofile} 3>rr("mog"). [] 4>rr("mog.hrl"). [test] this seems quiet different than the way l and c work from the shell, and might scare off new comers, not to mention examples show it work another way. also it seems odd that rr isnt included in c module but in the shell module, i realize that this is probably a design decisions so that records are loaded locally to the shell. I was able to fix it partially on my own box by adding a clause at line 819 or so in the shell.erl file local_func(rr, [{atom, _, A1}], Bs0, _Shell, RT, Lf, Ef) -> A = {string, 1, atom_to_list(A1)}, {[File],Bs} = expr_list([A], Bs0, Lf, Ef), {value,read_and_add_records(File, '_', [], Bs, RT),Bs}; however i imagine this is wrong, and also leads to having to call rr('mog.hrl'). so its not very helpful, as it still is not the same as the other tools.