Re: [patch] nmount ro, rw and negated option handling
On Fri, Jan 14, 2011 at 02:24:54PM +0200, Jaakko Heinonen wrote: > > Hi, Hi, > Currently nmount(2) allows a mount point to have "ro", "rw", and "noro" > string options concurrently active. This can cause erratic behavior > demonstrated by this example: > > 1. Have mountd(8) running. > 2. # mdconfig -a -t vnode -f ufsimg > 3. # mount -o ro,rw /dev/md0 /mnt > > After these steps the mount point has string options "ro", "rw" and > "noro" active but the MNT_RDONLY flag is not set. Eventually this will > lead to "ffs_sync: rofs mod" (or similar) panic because the ffs code > marks the file system read-only due to the "ro" string option. > (MNT_RDONLY flag is used in most places for read-only check.) > > I wrote a patch to do following changes: > > - vfs_equalopts() now recognizes "ro" and "rw" as equal options > - vfs_mergeopts() uses vfs_sanitizeopts() to merge options. This ensures > that if the same option shows up several times (negated or not), only > the last one is taken in account. There is still a problem when for > example option "foo" and "nofoo" are merged: the "nofoo" option will > become an active option. This is not a regression however and > currently I don't know an easy way to solve this because the list of > valid options is not available in vfs_mergeopts(). > - vfs_donmount() always converts "norw"/"rdonly" to "ro" and "noro" to > "rw". Thus the mount point will always have either "rw" or "ro" > option. I haven't seen any in-tree file system to test for "noro" but > at least ZFS tests for "rw". That's why I chose "rw" instead or > "noro". > > The patch is available here: > > http://people.freebsd.org/~jh/patches/nmount-ro-rw.diff > > Reviews and testing would be appreciated. > Thanks for the patch, I confirm it fixes the issue I reported in kern/150206. Aurelien -- Aurelien Jarno GPG: 1024D/F1BCDB73 aurel...@aurel32.net http://www.aurel32.net ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"
Re: What does the FreeBSD/i386 ABI say about stack alignment?
On Thu Jan 13 11, Alexander Best wrote: > On Thu Jan 13 11, Ryan Stone wrote: > > I've been trying to get an application compiled with gcc 4.5.1 running > > on FreeBSD 8.1, but it's been crashing during startup with a SIGBUS. > > It turns out that the problem is that gcc is issuing SSE > > instructions(in my case, a movdqa) that assume that the stack will be > > aligned to a 16-byte boundary. It seems that Linux/i386 guarantees > > this, and I worry that gcc has extended this assumption to all i386 > > architectures. I'm assuming that FreeBSD doesn't make any such > > promises based on the fact that I'm getting crashes. > > > > There does seem to be a flag (-mstackrealign) that you can set to > > force gcc to align the stack to what it wants, but that pessimizes the > > generated code a bit. Some googling would seem to indicate that > > -mpreferred-stack-boundary won't always handle this problem correctly. > > > > Any ideas? My inclination, at least for our local source tree here at > > $WORK, would be to accommodate gcc and guarantee the stack alignment > > that it wants rather than pessimize our application. It seems we have > > an old local patch/hack in our FreeBSD 6.1 tree(apparently based on > > this: > > http://www.freebsd.org/cgi/getmsg.cgi?fetch=438552+0+/usr/local/www/db/text/2000/freebsd-current/2507.freebsd-current). > > I believe that this patch is the reason why we haven't seen the > > problem when running on 6.1, but the patch doesn't seem to work > > anymore on 8.1. > > i'm experiencing a similar issue on amd64 with mplayer (svn snapshot) and > gcc46: > > otaku% ./mplayer ~/filme/wiedhow.mkv > MPlayer SVN-r32787-4.6.0 (C) 2000-2011 MPlayer Team > 161 audio & 350 video codecs > > Playing /home/arundel/filme/wiedhow.mkv. > zsh: illegal hardware instruction (core dumped) ./mplayer ~/filme/wiedhow.mkv > otaku% echo $? > 132 just wanted to report that the issue i was having with mplayer vanished. so it seems this was in fact a bug in mplayer itself. cheers. alex > > i'm not sure however, if both matters are related. gdb and 'bt' report: > > #0 0x000805327f03 in sscanf (str=0xa , > fmt=0x7fbffe60 ) at > /usr/subversion-src/lib/libc/stdio/sscanf.c:46 > 46{ > [New Thread 80a407400 (LWP 105253/initial thread)] > (gdb) bt > #0 0x000805327f03 in sscanf (str=0xa , > fmt=0x7fbffe60 ) at > /usr/subversion-src/lib/libc/stdio/sscanf.c:46 > #1 0x0062fa25 in vsscanf () > #2 0x000805327f84 in sscanf (str=Variable "str" is not available. > ) at /usr/subversion-src/lib/libc/stdio/sscanf.c:51 > #3 0x0062fa25 in vsscanf () > > cheers. > alex > > -- > a13x -- a13x ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"
Re: What does the FreeBSD/i386 ABI say about stack alignment?
On Sun Jan 23 11, Anonymous wrote: > Alexander Best writes: > > >> otaku% ./mplayer ~/filme/wiedhow.mkv > >> MPlayer SVN-r32787-4.6.0 (C) 2000-2011 MPlayer Team > >> 161 audio & 350 video codecs > >> > >> Playing /home/arundel/filme/wiedhow.mkv. > >> zsh: illegal hardware instruction (core dumped) ./mplayer > >> ~/filme/wiedhow.mkv > >> otaku% echo $? > >> 132 > > > > just wanted to report that the issue i was having with mplayer vanished. so > > it > > seems this was in fact a bug in mplayer itself. > > Did you update lang/gcc46 recently? I've seen many similar bugs on *the* > devel branch of GCC, i.e. gcc46 and before 4.5.0 release on gcc45. i did actually. so you think this was a gcc46 bug that was resolved? recent mplayer versions don't seem to build with the base gcc. cheers. alex -- a13x ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"
Re: What does the FreeBSD/i386 ABI say about stack alignment?
Alexander Best writes: >> otaku% ./mplayer ~/filme/wiedhow.mkv >> MPlayer SVN-r32787-4.6.0 (C) 2000-2011 MPlayer Team >> 161 audio & 350 video codecs >> >> Playing /home/arundel/filme/wiedhow.mkv. >> zsh: illegal hardware instruction (core dumped) ./mplayer >> ~/filme/wiedhow.mkv >> otaku% echo $? >> 132 > > just wanted to report that the issue i was having with mplayer vanished. so it > seems this was in fact a bug in mplayer itself. Did you update lang/gcc46 recently? I've seen many similar bugs on *the* devel branch of GCC, i.e. gcc46 and before 4.5.0 release on gcc45. ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"
Querying bsnmpd through /var/run/snmpd.sock
Hi! bsnmpd running with mibII module opens local socket /var/run/snmpd.sock mentioned in snmp_mibII(3) manual page: The mibII module opens a socket that is used to execute all network related ioctl(2) functions. This socket is globally available under the name mib_netsock. How do I use the socket? I hope to be able to call mib_find_if_sys() function from another process using the socket. Is there a documentation for this? Eugene Grosbein ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"
How to read non-physical memory?
Hello. When FreeBSD boots with 'boot -v' it show SMAP: SMAP type=01 base= len=0009d800 SMAP type=02 base=0009d800 len=2800 SMAP type=02 base=000e len=0002 SMAP type=01 base=0010 len=bfdb <...> SMAP type=02 base=fed1c000 len=4000 <...> Memory range 0xfed1c000 - 0xfed2000 belongs to ICH8 mapped to memory configuration registers. If I correctly understand mem man page, /dev/mem allow to read only real physical memory. How can I read data from this range? -- Alexandr Matveev ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"
Re: How to read non-physical memory?
Hi Alexandr, On Sun, Jan 23, 2011 at 7:56 AM, Alexandr Matveev wrote: > Hello. > > When FreeBSD boots with 'boot -v' it show SMAP: > SMAP type=01 base= len=0009d800 > SMAP type=02 base=0009d800 len=2800 > SMAP type=02 base=000e len=0002 > SMAP type=01 base=0010 len=bfdb > <...> > SMAP type=02 base=fed1c000 len=4000 > <...> > > Memory range 0xfed1c000 - 0xfed2000 belongs to ICH8 mapped to memory > configuration registers. > If I correctly understand mem man page, /dev/mem allow to read only real > physical memory. How can I read data from this range? I am not sure what the man page says but you can certainly use /dev/mem to access mmio space. I have used 'dd' with 'if=/dev/mem' to dump out mmio registers on amd64. YMMV with other architectures. best Neel > > -- > Alexandr Matveev > > ___ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org" > ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"
Re: How to read non-physical memory?
On 23.01.2011 22:26, Neel Natu wrote: Hi Alexandr, On Sun, Jan 23, 2011 at 7:56 AM, Alexandr Matveev wrote: Hello. When FreeBSD boots with 'boot -v' it show SMAP: SMAP type=01 base= len=0009d800 SMAP type=02 base=0009d800 len=2800 SMAP type=02 base=000e len=0002 SMAP type=01 base=0010 len=bfdb <...> SMAP type=02 base=fed1c000 len=4000 <...> Memory range 0xfed1c000 - 0xfed2000 belongs to ICH8 mapped to memory configuration registers. If I correctly understand mem man page, /dev/mem allow to read only real physical memory. How can I read data from this range? I am not sure what the man page says but you can certainly use /dev/mem to access mmio space. I have used 'dd' with 'if=/dev/mem' to dump out mmio registers on amd64. YMMV with other architectures. Thank you very much. dd if=/dev/mem of=mem.dump bs=4 count=4095 skip=1068789760 works perfectly! -- Alexandr Matveev ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"
Tracking down a problem with php on FreeBSD
Good day! We are using custom php application on FreeBSD 8.1R amd64. It is started with php-fpm 5.3.3 from ports as backend and nginx 0.8.54 as frontend. Several times per day this app is making self unavailable. Simple php-fpm restart solves the problem, but i need to track it down to the cause of this situation and ask for your assistance and instructions on how to debug it. Some facts about this: - I don't know how to manually reproduce this, but it happens several times every day - It happens on FreeBSD 7.x too - It happens with apache+mod_php instead php-fpm - It happens with lighthttpd instead nginx - It happens with both SHED_4BSD and SHED_ULE - It doesn't happen on php =< 5.2.12 - It happens with and w/o eaccelerator - `top -mio` shows very high (8-9 for VCSW) VCSW/IVCSW values for php-fpm processes and LA is more than 120 - user seeing http 502 error code in browser - php-fpm log has many of this lines in time of crash: Jan 23 17:56:58.176425 [WARNING] [pool world] server reached max_children setting (100), consider raising it Jan 23 17:56:59.528873 [WARNING] [pool world] child 686, script '/usr/local/www/world/public_html/script.php' execution timed out (10.074251 sec), terminating Jan 23 17:57:03.221677 [WARNING] [pool world] child 686 exited on signal 15 (SIGTERM) after 59.424804 seconds from start Jan 23 17:57:03.222580 [NOTICE] [pool world] child 4407 started Jan 23 17:57:03.222709 [NOTICE] Finishing ... Jan 23 17:57:03.260991 [WARNING] [pool site] child 3962, script '/usr/local/www/site/public_html/script.php' execution timed out (12.644470 sec), terminating - nginx log has many of this lines in time of crash: 2011/01/23 17:57:00 [error] 38018#0: *26006023 writev() failed (54: Connection reset by peer) while sending request to upstream, client: xx.xx.xx.xx, server: some.server.org, request: "POST /?ctrl=Chat& a=chatList&__path=chat_list&h=8093b9e1cf448762d5677e21bded97ae& h1=38ca8b747a46098c3b1a4f39e6658170 HTTP/1.1", upstream: "fastcgi://127.0.0.1:9002", host: "some.server.org", referrer: "http://some.server.org/"; 2011/01/23 17:57:00 [error] 38016#0: *26029878 kevent() reported about an closed connection (54: Connection reset by peer) while reading response header from upstream, client: xx.xx.xx.xx, server: some.server.org, request: "POST /?ctrl=Location&a=refresh& __path=refresh&h=276f591df26a65d9a1736f6e1006f4ab& h1=3c0916c16b1fc2e7015b71e90bbc3d23 HTTP/1.1", upstream: "fastcgi://127.0.0.1:9002", host: "some.server.org", referrer: "http://some.server.org/"; 2011/01/23 17:57:02 [crit] 38020#0: *26034390 open() "/tmp/nginx /client_temp/1/74/000741" failed (13: Permission denied) while sending request to upstream, client: xx.xx.xx.xx, server: some.server.org, request: "POST /?ctrl=Chat&a=send&__path=chat_send& h=4a27d8d382ba9b1059412323a451ef84& h1=b0a53c86e3c744a01356a5030559ed1a HTTP/1.1", upstream: "fastcgi://127.0.0.1:9002", host: "some.server.org", referrer: "http://some.server.org/"; 2011/01/23 17:57:02 [alert] 38020#0: *26034390 http request count is zero while sending to client, client: xx.xx.xx.xx, server: some.server.org, request: "POST /?ctrl=Chat&a=send&__path=chat_send& h=4a27d8d382ba9b1059412323a451ef84& h1=b0a53c86e3c744a01356a5030559ed1a HTTP/1.1", upstream: "fastcgi://127.0.0.1:9002", host: "some.server.org", referrer: "http://some.server.org/"; 2011/01/23 17:57:03 [error] 38014#0: *25997903 upstream prematurely closed connection while reading response header from upstream, client: 109.229.69.186, server: some.server.org, request: "POST /?ctrl=Chat&a=chatList&__path=chat_list& h=c8723de73c4f8ebb98f9bf746d75e965& h1=3ab289760a009b07b73c6d96cc94a509 HTTP/1.1", upstream: "fastcgi://127.0.0.1:9002", host: "some.server.org", referrer: "http://some.server.org/"; `top -mio` output in time of crash: http://pastebin.com/yrCwxnbr kernel config: http://pastebin.com/nGA0518A php port options: # cat /var/db/ports/php5/options WITH_CLI=true WITH_CGI=true WITH_FPM=true WITH_APACHE=true WITHOUT_AP2FILTER=true WITHOUT_DEBUG=true WITH_SUHOSIN=true WITH_MULTIBYTE=true WITHOUT_IPV6=true WITH_MAILHEAD=true WITHOUT_LINKTHR=true php-fpm pool configuration: [world] listen = 127.0.0.1:9002 listen.allowed_clients = 127.0.0.1 listen.owner = www listen.group = www listen.mode = 0666 user = www group = www pm = dynamic pm.max_children = 100 pm.start_servers = 20 pm.min_spare_servers = 5 pm.max_spare_servers = 35 pm.max_requests = 5000 pm.status_path = /JWorldStatus request_terminate_timeout = 10s Any help is highly appreciated. Thank you all in advance. -- Regards, Ruslan ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"
Tracking down a problem with php on FreeBSD
Good day! We are using custom php application on FreeBSD 8.1R amd64. It is started with php-fpm 5.3.3 from ports as backend and nginx 0.8.54 as frontend. Several times per day this app is making self unavailable. Simple php-fpm restart solves the problem, but i need to track it down to the cause of this situation and ask for your assistance and instructions on how to debug it. Some facts about this: - I don't know how to manually reproduce this, but it happens several times every day - It happens on FreeBSD 7.x too - It happens with apache+mod_php instead php-fpm - It happens with lighthttpd instead nginx - It happens with both SHED_4BSD and SHED_ULE - It doesn't happen on php =< 5.2.12 - It happens with and w/o eaccelerator - `top -mio` shows very high (8-9 for VCSW) VCSW/IVCSW values for php-fpm processes and LA is more than 120 - user seeing http 502 error code in browser - php-fpm log has many of this lines in time of crash: Jan 23 17:56:58.176425 [WARNING] [pool world] server reached max_children setting (100), consider raising it Jan 23 17:56:59.528873 [WARNING] [pool world] child 686, script '/usr/local/www/world/public_html/script.php' execution timed out (10.074251 sec), terminating Jan 23 17:57:03.221677 [WARNING] [pool world] child 686 exited on signal 15 (SIGTERM) after 59.424804 seconds from start Jan 23 17:57:03.222580 [NOTICE] [pool world] child 4407 started Jan 23 17:57:03.222709 [NOTICE] Finishing ... Jan 23 17:57:03.260991 [WARNING] [pool site] child 3962, script '/usr/local/www/site/public_html/script.php' execution timed out (12.644470 sec), terminating - nginx log has many of this lines in time of crash: 2011/01/23 17:57:00 [error] 38018#0: *26006023 writev() failed (54: Connection reset by peer) while sending request to upstream, client: xx.xx.xx.xx, server: some.server.org, request: "POST /?ctrl=Chat& a=chatList&__path=chat_list&h=8093b9e1cf448762d5677e21bded97ae& h1=38ca8b747a46098c3b1a4f39e6658170 HTTP/1.1", upstream: "fastcgi://127.0.0.1:9002", host: "some.server.org", referrer: "http://some.server.org/"; 2011/01/23 17:57:00 [error] 38016#0: *26029878 kevent() reported about an closed connection (54: Connection reset by peer) while reading response header from upstream, client: xx.xx.xx.xx, server: some.server.org, request: "POST /?ctrl=Location&a=refresh& __path=refresh&h=276f591df26a65d9a1736f6e1006f4ab& h1=3c0916c16b1fc2e7015b71e90bbc3d23 HTTP/1.1", upstream: "fastcgi://127.0.0.1:9002", host: "some.server.org", referrer: "http://world.mist-game.ru/"; 2011/01/23 17:57:02 [crit] 38020#0: *26034390 open() "/tmp/nginx /client_temp/1/74/000741" failed (13: Permission denied) while sending request to upstream, client: xx.xx.xx.xx, server: some.server.org, request: "POST /?ctrl=Chat&a=send&__path=chat_send& h=4a27d8d382ba9b1059412323a451ef84& h1=b0a53c86e3c744a01356a5030559ed1a HTTP/1.1", upstream: "fastcgi://127.0.0.1:9002", host: "some.server.org", referrer: "http://world.mist-game.ru/"; 2011/01/23 17:57:02 [alert] 38020#0: *26034390 http request count is zero while sending to client, client: xx.xx.xx.xx, server: some.server.org, request: "POST /?ctrl=Chat&a=send&__path=chat_send& h=4a27d8d382ba9b1059412323a451ef84& h1=b0a53c86e3c744a01356a5030559ed1a HTTP/1.1", upstream: "fastcgi://127.0.0.1:9002", host: "some.server.org", referrer: "http://some.server.org/"; 2011/01/23 17:57:03 [error] 38014#0: *25997903 upstream prematurely closed connection while reading response header from upstream, client: 109.229.69.186, server: some.server.org, request: "POST /?ctrl=Chat&a=chatList&__path=chat_list& h=c8723de73c4f8ebb98f9bf746d75e965& h1=3ab289760a009b07b73c6d96cc94a509 HTTP/1.1", upstream: "fastcgi://127.0.0.1:9002", host: "some.server.org", referrer: "http://some.server.org/"; `top -mio` output in time of crash: http://pastebin.com/yrCwxnbr kernel config: http://pastebin.com/nGA0518A php port options: # cat /var/db/ports/php5/options WITH_CLI=true WITH_CGI=true WITH_FPM=true WITH_APACHE=true WITHOUT_AP2FILTER=true WITHOUT_DEBUG=true WITH_SUHOSIN=true WITH_MULTIBYTE=true WITHOUT_IPV6=true WITH_MAILHEAD=true WITHOUT_LINKTHR=true php-fpm pool configuration: [world] listen = 127.0.0.1:9002 listen.allowed_clients = 127.0.0.1 listen.owner = www listen.group = www listen.mode = 0666 user = www group = www pm = dynamic pm.max_children = 100 pm.start_servers = 20 pm.min_spare_servers = 5 pm.max_spare_servers = 35 pm.max_requests = 5000 pm.status_path = /JWorldStatus request_terminate_timeout = 10s Any help is highly appreciated. Thank you all in advance. PS. Please keep me in cc:. I'm not subscribed to freebsd-hackers@. -- Regards, Ruslan ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"
Re: Exporting kernel symbols
Hi Ali, On Sat, Jan 22, 2011 at 7:20 PM, Ali Mashtizadeh wrote: > Hi Folks, > > I tried to build a geom kernel module that uses the alq(9) facility to > log some data. The module builds fine but it seems that the kernel > isn't exporting the alq(9) symbols. Could someone point me how I can > export particular symbols? > Do you have the kernel compiled with the 'alq' option defined? FreeBSD 8.1 GENERIC does not define this by default. best Neel > -- > Ali Mashtizadeh > علی مشتی زاده > ___ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org" > ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"