Commit graph

2637 commits

Author SHA1 Message Date
cinap_lenrek 2a94e1fc19 pool: do poolcheck when free nodes get corrupted instead of assert
doing poolcheck should give us better context to figure out
what memory blocks / owners corrupted the blocks after free.

this is for hunting down a memory corruption seen in connection
with usb serial.
2013-05-31 18:55:01 +02:00
mveety a84c51a1e3 fixed a segfault in auth/as because it didn't check to see if argv[0] and argv[1] actually had things in them 2013-05-29 22:25:57 -04:00
cinap_lenrek 9abafe226e hjfs: deal with ORCLOSE in chancreat()
ORCLOSE was effectively ignored for Tcreate. just setting
CHRCLOSE flag on chan should fix it.
2013-05-30 01:58:09 +02:00
cinap_lenrek 5ba51bcd0d merge 2013-05-30 23:27:28 +02:00
cinap_lenrek 8eb12a65e0 merge 2013-05-30 23:27:07 +02:00
cinap_lenrek d94ffb4808 kernel: do all fp state fork from procfork() (like pc kernel)
this simplifies the arm ports and keeps all the stuff in one place
instead of spreading it thru notify(), trap() and syscall() functions
and prevents useless fp state copying for kernel procs.

also make sure to save fp in notify while still splhi().
2013-05-30 23:26:21 +02:00
cinap_lenrek 9652f5bec5 pc kernel: simulate FXSAVE/FXRSTOR tag-byte from x87 tag-word, copy fp state across fork
the tag-word is not compatible between x87 and sse, have to convert
properly for emulation to work.

we now copy fp state across fork (again!) to preserve FCW and MXCSR
registers. this might not be neccesary as we could probably just
get the current value for the curren process and avoid the fpsave()
call, but become conservative again.
2013-05-30 23:16:22 +02:00
cinap_lenrek 580a467f63 libmach: fix reversed F0-F7 register order 2013-05-30 23:01:59 +02:00
ftrvxmtrx 392f92b82b ircrc: target is more important (especially in winwatch) 2013-05-29 11:37:30 +02:00
ppatience0 9fee166e10 io, seg: we should exits(nil) at the end of main 2013-05-28 20:06:53 -04:00
ppatience0 6a0d21acca mothra: clicking on the url scroll bar, snarfing, or saving a hit when no urls have been loaded (right after running mothra) would crash. this was due to use of w->url and selection when they are actually nil.
to fix this, make genwww return 0 if w->url is nil and output an error message when attempting to access selection if it's nil. the problem with the w->url fix is that after clicking on the url scroll bar, an empty url history row could be highlighted by clicking on it. fix this by making sure lp->lo is not less than zero.
2013-05-27 00:26:19 -04:00
ppatience0 ffef3278ef tojpg: GREY[1248] images should be grayscale 2013-05-27 19:32:28 -04:00
cinap_lenrek 723018c1de merge 2013-05-28 23:42:59 +02:00
cinap_lenrek 8cce104fcb kernel: sysrfork abortion
when we fail to fork resources for the child due to resource
exhaustion, make the half forked child process call pexit()
to free the resources that where allocated and error out.
2013-05-28 23:41:54 +02:00
ppatience0 410ce8feec tojpg: add jpeg encoder 2013-05-26 21:56:56 -04:00
cinap_lenrek 71a3ab3f13 kernel: make imagereclaim() skip notext pages (prevent it from blowing the mount cache)
imagereclaim would happily uncache pages from the mountcache (port/cache.c)
without ever getting a Image* released from it. simple fix, just check for
p->image->notext but make sure todo it under the page lock :)
2013-05-27 03:26:53 +02:00
cinap_lenrek 6025ad06da merge 2013-05-27 01:20:46 +02:00
cinap_lenrek 44e4aad870 kernel: dont copy fpsave on fork, simplify freeing waitq in pexit(), remove unused semlock from Proc sturcure 2013-05-27 01:17:11 +02:00
cinap_lenrek 410d6bea6a devfs/devsd: fix waserror() and unused variable compiler problem
the compiler optimizes setting unused variables out, which is
problematic if they are used in waserror() handler which the
compiler isnt aware of. rearrange the code to avoid this problem.
2013-05-27 01:12:21 +02:00
cinap_lenrek c4153b7755 kernel: closechanq error
catch potential interrupt error from kproc(). this can happen when
we run out of processes, then newproc() will call rsrcwait()
which does tsleep(). if the process gets a note, this might
raise a interrupt error.
2013-05-27 01:09:34 +02:00
cinap_lenrek 24b908be8a kernel: image reclaim pauses
get a bit more verbose about process image exhaustion and make
imagreclaim() try to get at least one image on the freelist.

use rsrcwait() to notify the state, and call freebroken() in
case imagereclaim() couldnt free any images.
2013-05-27 01:04:53 +02:00
cinap_lenrek 3e567afed5 kernel: fix sysexec() error handling compiler problem, sysrendez() busyloop
the variables elem and file0 and commited are explicitely
set to avoid that they get freed in ther waserror() handlers.

but it turns out the compiler optimizes this out as he
thinks the variables arent used any further. (the compiler
is not aware of the waserror() / longjmp() semantics).

rearrange the code to account for this. instead of using
a local variable to check for point of no return (commited),
we use up->seg[SSEG] to figure it out.

for file0 and elem, we just rearrange the code. elem can be
checked in the error handler if it was already assigned to
up->text, and file0 is just free()'d after the poperror().

remove silly busy loop in sysrendez. it is not needed.
dequeueproc() will make sure that the process has come to
rest.
2013-05-27 00:59:43 +02:00
cinap_lenrek 257c7e958e keep fpregs always in sse (FXSAVE) format, adapt libmach and acid files for new format
we now always use the new FXSAVE format in FPsave structure and fpregs
file, converting back and forth in fpx87save() and fpx87restore().

document that fprestore() is a destructive operation now.

change fp register definition in libmach and adapt fpr() acid funciton.

avoid unneccesary copy of fpstate and fpsave in sysfork(). functions
including syscalls do not preserve the fp registers and copying fpstate
from the current process would mean we had to fpsave(&up->fpsave); first.
simply not doing it, new process starts in FPinit state.
2013-05-26 22:41:40 +02:00
cinap_lenrek ef5e19b9be add leading dot for explicit domain in webcookies, bump redirection limit to 12 in webfs 2013-05-26 03:33:39 +02:00
cinap_lenrek 7aea1204b9 graphics(2): remove non existing char *mousedir argument from geninitdraw (from sources / geninitdraw-no-mousedir patch) 2013-05-25 04:39:53 +02:00
cinap_lenrek cf657b418b libdraw: fix agefont crash when display == nil (from sources / agefont-nodisplay patch)
If you run this:
	{for (i in `{seq 1 70000}) echo '½•α·'} | mc | wc
mc will eventually suicide. The error comes from
/sys/src/libdraw/font.c:/^agefont which assumes it has a
display. Normally, this is set up by geninitdraw (usually
via initdraw), but mc.c avoids that to avoid the screen
redraws (flicker, at a minimum, but worse in long-running
cases).

graphics(2) does not prohibit this use, so I made the least
intrusive change to make it work.
2013-05-25 04:36:16 +02:00
cinap_lenrek 96511b274d kernel: fix floating point exceptions (was broken by sse kernel changes)
the fpenv() instruction stores in x87 format, using mathstate()
would interpret fpsave as FPssestate in case it was enabled!
instead, pass the status word and fppc explicitely to mathnote()
in matherror().

get rid of m->fpsavealign buffer, as we can just use FPssesave struct
which has enougth padding so rounding up base pointer will not overflow.
2013-05-25 22:44:19 +02:00
cinap_lenrek 8b40eecea8 kernel: cleanup /sys/src/9/pc/mkfile PORT= and OBJ= lists 2013-05-21 19:45:40 +02:00
cinap_lenrek 92b550d665 kernel: prevent alarm(2) from returning instantly when the tick timer wraps. (from erik quanstros alarmwrap patch) 2013-05-21 19:31:41 +02:00
cinap_lenrek f6833ce428 wifi: properly size internal wifi input processing queue
we only used wifi->iq to process management frames only, now its also used
to forward encrypted data frames, so size it accordingly.
2013-05-21 19:29:57 +02:00
cinap_lenrek 7a9ecbed6a merge 2013-05-21 18:58:13 +02:00
jpathy 5331734335 merge 2013-05-22 21:55:08 +05:30
jpathy 81b7451972 sse kernel support (sources) 2013-05-22 23:47:05 +05:30
jpathy 213bf50893 add 6(a|l) sse support to 8(a|l) 2013-05-21 23:15:13 +05:30
cinap_lenrek 8a3a36fc05 kernel: make allocb() wait instead of panic() when possible
as long as our process doesnt hold any locks or ilocks, we
can try to wait for the memory to become available instead of
panicing.
2013-05-21 02:29:46 +02:00
cinap_lenrek 58201a67c1 uarti8250: print on malloc failure 2013-05-20 17:43:30 +02:00
cinap_lenrek 3ccf5db688 merge 2013-05-20 17:33:46 +02:00
cinap_lenrek c4f57ff492 pcuart: malloc error handling, cleanup 2013-05-20 17:32:48 +02:00
ftrvxmtrx 5aa2a1a845 kbmap/ua: fix uppercase ь 2013-05-20 13:48:09 +02:00
cinap_lenrek 6ac8a3ca65 devether: handle malloc error in etherprobe() 2013-05-20 01:17:38 +02:00
cinap_lenrek 926dd18a7a wifi: handle malloc errors in wifiattach() 2013-05-20 01:03:20 +02:00
cinap_lenrek 18b8ae56e8 use resrcwait() when waiting for memory to become available
use resrcwait() when waiting for memory to become available. randomize
the sleep time and properly restore old process status in case tsleep()
gets interrupted.
2013-05-20 23:55:38 +02:00
cinap_lenrek f97798e710 devsd: don't raise Enomem error if sdmalloc() fails, instead wait for the memory to become available
filesystems do not handle i/o errors well (cwfs will abandon the blocks),
and temporary exhaustion of kernel memory (because of too many i/o's in
parallel) causes read and write on the partition to fail.

i think it is better to wait for the memory to become available in
this case. the single allocation is at max SDmaxio bytes, which makes
it likely to become available. if we havnt even enought fo that, then
rebooting the machine would be the best option. (aux/reboot)
2013-05-19 20:59:55 +02:00
ftrvxmtrx 318cd6fbde kbmap/ru: fix uppercase ь 2013-05-19 17:50:51 +02:00
cinap_lenrek 4c6c7be688 nusb/kb: simplify repeat logic as scancode now contains the info about esc1 extension 2013-05-18 01:46:25 +02:00
ftrvxmtrx 506cae05df nusb/kb: oops, fixup 2013-05-18 01:03:13 +02:00
ftrvxmtrx 811c3e8d78 nusb/kb: use a flag to indicate extended code; fix the most unix-friendly key on se/fi kbd layout 2013-05-18 01:01:34 +02:00
stanley lieber d50ca72774 faces: just say no to dejavu 2013-05-15 15:38:42 -04:00
cinap_lenrek 172b290e05 netaudit: check if ipgw= is an ip address 2013-05-14 18:54:42 +02:00
cinap_lenrek 4c6fa55456 make clear that the "ipgw" attribute has to be an ip address 2013-05-14 18:31:24 +02:00