Commit Graph

53 Commits

Author SHA1 Message Date
Giacomo Tesio df8bc2ce43 qa: increase rlockt1 timeout 2017-08-14 18:46:23 +02:00
Giacomo Tesio 1b4b6d1574 qa: reenable newlib's tests 2017-08-13 12:33:18 +02:00
Giacomo Tesio d573d0a39c qa: disable newlib's test 202-signals 2017-08-13 00:06:04 +02:00
Giacomo Tesio 99124f1578 qa: disable newlib's test 201-signals
For some reason it hangs on travis-ci.
2017-08-12 23:55:39 +02:00
Giacomo Tesio e57ff30b63 qa: release cpu on newlib/201-signals and newlib/202-signals 2017-08-12 23:33:38 +02:00
Giacomo Tesio 93dfad6b0b kernel: print proc info on addbroken 2017-08-12 23:32:35 +02:00
Giacomo Tesio 1c4a04cd30 qa: various fix to tests 2017-08-11 03:18:32 +02:00
Giacomo Tesio 2a38ee6ab6 qa: fix typo in test 2017-06-06 19:53:45 +02:00
Giacomo Tesio 4f97f4a80b qa: disable broken tests 2017-06-05 22:11:36 +02:00
Giacomo Tesio 9f4472c3bb kernel: simplified fork_chain test 2017-06-05 19:25:08 +02:00
Giacomo Tesio 2269a4bbd0 kernel: minimal test that panic the mmu code 2017-06-03 23:23:42 +02:00
Giacomo Tesio a64a7b0d0e qa: check that notes cannot eat wait messages 2017-05-30 01:00:03 +02:00
Giacomo Tesio a8d42cecc9 newlib: use SIGINT to avoid abort 2017-05-29 23:45:00 +02:00
Giacomo Tesio 9dc9001469 newlib: test ignored signals (broken) 2017-05-29 01:53:37 +02:00
Giacomo Tesio 559e5429ed newlib: tests for sigchld 2017-05-29 01:42:08 +02:00
Giacomo Tesio fe168aa55d newlib: introduce tests for SIGCHLD 2017-05-26 02:12:42 +02:00
Giacomo Tesio 5ca0ef085c newlib: fix test for SIGSTOP/SIGCONT 2017-05-26 00:39:47 +02:00
Giacomo Tesio 439326fa1f newlib: enabled more tests for signals (still broken) 2017-05-25 22:43:38 +02:00
Giacomo Tesio f9c63742bb qa: simplify test that crash with -O2 2017-05-22 23:18:47 +02:00
Giacomo Tesio 1eb450510a qa: add test that crash with -O2 2017-05-21 23:16:41 +02:00
Giacomo Tesio fa15f817c4 qa: avoid cast that preclude strict aliasing 2017-05-19 01:09:51 +02:00
Giacomo Tesio 960e8a0d4e qa/kern: more tests for awake 2017-05-17 00:52:16 +02:00
Giacomo Tesio f9b2e9aba4 kernel: generalize awake
Awake can now interrupt several blocking syscalls (even
during note handling).

Among others, it can interrupt await, pread and pwrite.

It cannot interrupt several others for different reasons:

- awake cannot be interrupted by awake;
- syscalls like remove and create can be used for kernel comunication
  and it would be hard to know if the effect occurred in the
  receiving fs if they were interrupted;
- other syscalls do not need awake since they just provide access
  to kernel infos (eg seek or fd2path)

NOTE: awakes registered before a note cannot occur during the note
handling and will be deferred till the next call to noted.
2017-05-15 00:05:59 +02:00
Giacomo Tesio d62ca1162f Merge branch 'libposix-new-signals' of https://bitbucket.org/tesio/jehanne into libposix-new-signals 2017-05-08 22:54:34 +02:00
Giacomo Tesio 48ea61ab9c newlib: more tests for signals 2017-05-08 00:36:04 +02:00
Giacomo Tesio 1263399c0b qa: check devproc start/stop ctl msg 2017-05-07 19:32:55 +02:00
Giacomo Tesio ecd6dddf86 qa/kern: ensure awake in signal handlers is not affected by sleep 2017-05-04 19:55:55 +02:00
Giacomo Tesio 0b193807b6 qa: ensure awake works correctly in signal handlers
Jehanne's notes (like Plan9 ones) are not reentrant.
Thus an alarm can not be used to interrupt a syscall in a note handler.

Awake instead works properly also in a note handler.
2017-05-04 01:07:32 +02:00
Giacomo Tesio bd8ced55f1 qa: fix CID 168327 and CID 168326 2017-05-04 00:22:50 +02:00
Giacomo Tesio ec8d3427b7 qa: fix newlib test (CID 168329 and CID 168328) 2017-05-04 00:17:19 +02:00
Giacomo Tesio 3b35743a64 qa: nested_note checks that notes are enqueued in kernel 2017-05-03 02:23:26 +02:00
Giacomo Tesio 47573e2122 newlib: add 201-signals (broken as no default action occurs in newlib) 2017-05-02 01:15:10 +02:00
Giacomo Tesio be7c067507 newlib: fix qa_exit_translator in qa tests 2017-05-02 00:18:52 +02:00
Giacomo Tesio 690a89d3ce newlib: add test for waitpid (to implement) 2017-05-01 12:03:49 +02:00
Giacomo Tesio bd22e5154c qa: wait for child in newlib/200-signals 2017-04-30 16:55:13 +02:00
Giacomo Tesio d0b9ae9cac newlib: first test for signals 2017-04-29 00:33:54 +02:00
Giacomo Tesio 28539041d0 newlib: one more test (fread) 2017-04-28 23:15:03 +02:00
Giacomo Tesio 2481b01515 qa: introduce runners and more tests for newlib
For each test, if a script exists with the same name of the test
plus the .runner suffix, the runner is run instead of the test.

As a first example qa/lib/newlib/testsuite/atexit is run by
qa/lib/newlib/testsuite/atexit.runner.

These .runner scripts allow more complex checks of the side effects
generated by the test.
2017-04-28 00:47:12 +02:00
Giacomo Tesio 5c8200b9da qa: simple infrastructure to test output expectations 2017-04-24 00:06:33 +02:00
Giacomo Tesio 7ab8fecd80 newlib: qa checks from RedHat tests suite 2017-04-23 23:50:20 +02:00
Giacomo Tesio c2982db8a2 newlib: run first QA checks 2017-04-22 00:46:55 +02:00
Giacomo Tesio e70feee4a3 libc: introduce "jehanne_" namespace
With this commit all functions declared in libc.h have been renamed
with the "jehanne_" prefix. This is done for several reason:

- it removes conflicts during symbol resolution when linking
  standard C libraries like newlib or musl
- it allows programs depending on a standard C library to directly
  link to a library depending on our non standard libc (eg libsec).

To ease transiction two files are provided:

- sys/include/lib9.h that can be included instead of <libc.h> to use
  the old names (via a simple set of macros)
- sys/src/lib/c/lib9.c that can be compiled with a program where the
  macro provided by lib9.h are too dumb (see for example rc or grep).

In the kernel port/lib.h has been modified accordingly and some of
the functions it directly provides has been renamed too (eg malloc
in qmalloc.c and print in devcons.c).
2017-04-19 23:48:21 +02:00
Giacomo Tesio 65cdad4317 libc: rewrite putenv and getenv.
These new implementations

- do several validity check on input parameters
- allow a bit larger variable names (127 bytes, aka sizeof(Proc.genbuf)-1)
- preserve nulls in the content (the original version used to replace
  '\0' with ' '). I can't see why they did, actually.
  See also http://marc.info/?l=9fans&m=148475801229908&w=2

Should also fix CID 155718
2017-01-19 00:58:43 +01:00
Giacomo Tesio 51d12f1f34 kernel: fix #0/brk/ qid (it's a special directory, not a special file) 2017-01-09 00:44:01 +01:00
Giacomo Tesio 01562d4ddb qa: rfork(RFNAMEG) on tests that are going to rfork(RFNOMNT) later 2017-01-06 23:04:04 +01:00
Giacomo Tesio 4676c65a3d kernel: move nsec to libc 2017-01-06 00:56:22 +01:00
Giacomo Tesio 882e33b091 qa: fix warnings 2017-01-06 00:54:42 +01:00
Giacomo Tesio 37541724d0 kernel: add #0/brk and move brk_() to libc 2016-12-31 00:43:02 +01:00
Giacomo Tesio b862596737 kernel&all: create() syscall only sends Tcreate
In Plan9 the create syscall fallback on a open(OTRUNC) if the
path provided already exists. This is actually a common requirement
as most programs (editors, cat...) simply requires that a file is
there and is empty, and doesn't care overwriting existing contents
(note that this is particularily sensible with something like fossil).

In Jehanne the application is responsible of actually handle this
"file exists" error but libc provides ocreate() to mimic the Plan9
behaviour. Note that ocreate introduce a subtle race too: the path
is walked several times if the file exists, thus it could misbehave
on concurrent namespace changes. However I guess this is not going to
happen often enough to care now.

NOTE we will probably address this rare race too, with a more drammatic change
to syscalls: a new walk() syscall that will provide an unopen fd.
2016-12-24 21:25:20 +01:00
Giacomo Tesio 99855d60d6 kernel: move chdir to libc using devself/devproc
Added wdir to devself and devproc:

- read '#0/wdir' to get the working directory of the calling process
  NOTE that a read(fd, nil, -1) will return the negated length
  of the working directory, just in case you want to
  allocate the memory required

- read '/proc/n/wdir' to know the working directory of process n
  (read(fd, nil, -1) still returns the negated length)

- write '#0/wdir' to change the working directory of the calling process
  NOTE: no offset is allowed and the provided string must
  be null terminated

- write '/proc/n/wdir' to change the working directory of process n
  NOTE: no offset is allowed and the provided string must
  be null terminated; moreover if another process change the working
  directory change during the write, the current process will
  receive an error.

In libc updated getwd() and chdir().
Also modified pwd to get advantage of the new file.

To test, run /arch/amd64/qa/kern/wdir.rc or simply try

	% pwd
	/usr/glenda
	% echo -n /tmp > /proc/$pid/wdir
        % pwd
        /tmp
        % cat '#0/wdir' && echo
        /tmp

The expected use cases for wdir in devproc are rio and acme.

Also, note that we could theoretically remove the cd builtin
from rc and simply implement it as a rc function.
We don't do that to preserve rc portability to other OS.
2016-12-15 22:42:01 +01:00