Commit Graph

3080 Commits

Author SHA1 Message Date
Matthew Flatt
c082d77c97 raco exe: fix stripping of signature from Mach-O executables
To strip a signature, the old implementation effectively guessed
at the padding that was added to the original linkedit segment
to acommodate 16-byte alignment of the signature. The repaired
stripping works out the actual end of the linkedit segment based
on the various load commands that refer to it.
2017-07-03 09:33:17 -06:00
Matthew Flatt
340b878981 udp-send-to: fix deallocation bug related to rktio refactoring
The bug caused an attempt to free NULL as an addrinfo, which is
apparently ok on many OSes, but not all.
2017-07-02 14:27:59 -06:00
Matthew Flatt
af7a520102 rktio: header and extraction improvements for FFI 2017-06-29 14:36:43 -06:00
Matthew Flatt
63146e5451 ffi/unsafe/custodian: handle already-shutdown custodians 2017-06-29 14:36:42 -06:00
Daniel Feltey
e289750b03 Fix box/c typo/bug
Previously non-flat box/c contracts would always use the `write` contract to
check the contents of the box rather than the `read` contract.
2017-06-28 14:48:35 -05:00
Ben Greenman
04c1c15d89 bug: add guard against string-paths in 'find-relative-path'
Add guard, if first argument to `find-relative-path` is not a path,
 then don't call `path-convention-type` on it.

Thanks to Jack Firth for reporting:
https://github.com/racket/rackunit/pull/46
2017-06-28 10:19:50 -04:00
Matthew Flatt
76711dfb50 net/git-checkout: adjust ADLER32 check to work with streaming
Don't for an inflated stream to be held completely in memory.
2017-06-26 13:49:18 -06:00
Lehi Toskin
d7db2aff59 net/git-chckout: check ADLER32 after inflate
Check ADLER32 after inflate, instead of assuming that the inflated bytes
are correct.
2017-06-26 13:48:10 -06:00
Matthew Flatt
06a6d290fd rktio: fix bug merging fd sets when poll() is not available 2017-06-25 11:08:53 -06:00
Matthew Flatt
3e8ad02334 rktio: add some missing #includes in some configurations 2017-06-25 08:39:05 -06:00
Matthew Flatt
7a8145875c rktio: configure adjustment intended to fix OpenIndiana build 2017-06-24 17:07:33 -06:00
Ryan Culpepper
44eb5532ad syntax/parse: add ~or* and ~alt, like ~or{S,H} and ~or{EH}, respectively 2017-06-24 17:07:55 -04:00
Alexander McLin
113049607a Changed the code to pass through the prep-status to the outer HANDLE so
error reporting is uniformly handled and any SQL_BUSY errors are properly identified.
2017-06-24 17:06:42 -04:00
Alexander McLin
ed481865cf Based on PR #1704 feedback, rename copy-buffer to trim-and-copy-buffer and
adjust `string-trim` to only perform right-wise trimming of the buffer.
2017-06-24 17:06:42 -04:00
Alexander McLin
dfd585db33 Any well-formed single statement query which is terminated by a semi-colon and has extra space after the semi-colon raises 'multiple statements given' error.
The cause is any extra space after a terminating semi-colon in a SQL string passed to sqlite3_prepare_v2 procedure in the prepare1* method of `db` Sqlite3 connection% implementation will result in non-false tail and zero prep-status values being returned. The checking code sees the non-false tail value and raises the "multiple statements given" exception.

The easy fix is to trim any trailing whitespace by calling string-trim on the buffer string before its converted to a byte string in the copy-buffer procedure used by sqlite3_prepare_v2 to initialize the sql-buffer.

See Issue #1702
2017-06-24 17:06:42 -04:00
Alexander McLin
31d7dd0317 Certain malformed queries such as "SELECT ,* FROM SomeTable" (which has an incorrect extra comma) raise "multiple statements given" error while Sqlite3 actually generates a syntax error that doesn't get returned as a raised exception.
The same problem is encountered when executing a DDL statement such as "Create Table" more than once after the table had already been created by the first execution.

The cause is when sqlite3_prepare_v2 encounters a bad statement, it aborts the preparation, sets prep-status flag to non-zero and also sets tail? to be non-false.

The previous code ignored the prep-status flag and only checked tail? and raises "multiple statements given" exception when tail? is non-false.

The new code takes prep-status into account and extracts the actual Sqlite3 error message by evaluating get-error-message and raising it as an exception.

See Issue #1702
2017-06-24 17:06:42 -04:00
Matthew Flatt
5dbeb39a01 rktio: fix configure detection of iconv 2017-06-24 07:37:40 -06:00
Matthew Flatt
c5022c5d4f rktio: fix small header problems 2017-06-24 07:35:07 -06:00
Matthew Flatt
990a1d7154 rktio: further improve header declarations
Also, add variants of `rktio_read` and `rktio_write` that can be more
convenient to use through an FFI.
2017-06-23 19:50:19 -06:00
Matthew Flatt
316df0af7a rktio: add standalone build mode
Also, add a script to extract the "rktio.h" header information to an
S-expression form suitable for FFI use, and refine the "rktio.h"
information to improve that output.
2017-06-23 13:08:02 -06:00
Matthew Flatt
3c07250db4 fix printer for (unquote @d)
Avoid printing `(unquote @d)` or `(unsyntax @d)` as `,@d` or `#,@d`,
which would mean `(unquote-splicing @d)` or `(unsyntax-splicing @d)`
to the reader, by adding an extra space before the `@`.
2017-06-22 15:00:00 -06:00
Matthew Flatt
8473c1d4a8 raco pkg install: error message improvement
When a package to be installed has a module that conflicts with an
existing installed module, but the existing module isn't in a package,
then say so explicitly in the error message. Also report the current
collection and links paths.

Error reporting could do even more work to figure out which path is
relevant, but reporting a list of paths is relatively easy. Listing
paths also seems likely to give a user enough hints for this rare
case, especially if the user just needs to be reminded that collection
links exist.
2017-06-22 12:40:09 -06:00
Daniel Feltey
87e4bdbec8 Fix segfault on accessing non-present impersonator properties of property-only vector chaperones
Additionally this adds macros that distinguish between the chaperone redirects of prop-only vector
chaperones, function chaperones, and structure chaperones since each of these may store a vector
in the redirects field.
2017-06-22 12:46:58 -05:00
Matthew Flatt
f8c7feaf88 fix problem with prefabs, auto fields, and construction via a key
Auto fields were incorrectly recorded as immutable in a structure type
that is first generated from the prefab struct key instead of
`make-struct-type`.

Thanks to Deren Dohoda for the report.
2017-06-22 10:46:49 -06:00
Matthew Flatt
a7d161cfac raco pkg update: fix --update-deps and cross-scope deps
When `--update-deps` (which is implied by `--all`) was used on
user-scope packages that depend on installation-scope packages, the
installation-scope dependencies were treated as missing, which forced
an update of the user-scope packages. Check both scopes for
dependencies.

Closes #1730
2017-06-22 07:33:08 -06:00
Matthew Flatt
cfa1d7c54c add more information to copy-file error message
The `file/cache` relies on matching the text of a message, and the
text had changed to have less information on Unix, including whether
the problem was with the source or destination file. Add a notion of
error step to rktio and use it to improve the `copy-file` message.
2017-06-21 16:51:02 -06:00
Matthew Flatt
7152cc1ba6 rktio: add <sys/types.h> to reliably get u_char 2017-06-21 16:22:46 -06:00
Matthew Flatt
58dea081c6 fix memory-management bugs in rktio on Windows 2017-06-21 16:19:14 -06:00
Matthew Flatt
a15b16cfd9 repair expand-user-path 2017-06-21 16:19:14 -06:00
Matthew Flatt
6a543f4783 rktio: add iconv 2017-06-21 16:19:14 -06:00
Matthew Flatt
db7c242983 rktio: add syslog 2017-06-21 15:01:45 -06:00
Matthew Flatt
4de2ff4cbd fix make-file-or-directory-link 2017-06-21 05:23:53 -06:00
Matthew Flatt
69a208eb21 rktio: add Windows path conversion functions 2017-06-21 05:23:53 -06:00
Matthew Flatt
898b9ffe10 rktio: add ShellExecute 2017-06-21 05:23:53 -06:00
Matthew Flatt
d70cb9aec0 use "errno" in error messages only for Posix errors
Use "win_err" for Windows errors, and so on. Otherwise, the error
number can be misleading, especially if it's a rktio-level error.
2017-06-21 05:23:53 -06:00
Matthew Flatt
c3da23209b rktio: replace Windows invalid-decoding hack
Report a proper error when path decoding fails, instead of
synthesizing a path hat shouldn't exist. The rktio conversion
made it much easier to report the error at the Racket level
like other filesystem errors.
2017-06-21 05:23:53 -06:00
Matthew Flatt
83cb1a0d00 repair and tests for Windows path handling
In the process of extracting minimal Windows path encoding for rktio,
I noticed a decoding issue with a path that ends with an unpaired
high-surrogate value. Add a suitable tests and fix the old decoder
(although it will probably go away).
2017-06-21 05:23:53 -06:00
Matthew Flatt
d4742a0618 fix bytes-convert-end
The `bytes-convert-end` function didn't set up a proper decoding.
Make sure that it at least does nothing for encodings where
there's nothing to do.
2017-06-21 05:23:53 -06:00
Matthew Flatt
d90976f865 rktio: repair to listen failure handling 2017-06-20 12:33:09 -06:00
Matthew Flatt
a7ab538403 fix timer handling in subprocess
This bug was introduced with the rktio conversion.
2017-06-20 11:57:43 -06:00
Matthew Flatt
a5b28c453a rktio: fix init of accepted socket 2017-06-20 09:06:06 -06:00
Matthew Flatt
20f1f146c7 raco exe: fix incorrect shortcut in submodule checking
Closes #1712
2017-06-20 08:28:54 -06:00
Matthew Flatt
51bf69e356 switch for/list back to a loop plus reverse
Closes #1721, which points out that the `for/list` expansion
introduced in commit 5e94a906cd interacts badly with a body
that captures a continuation plus Racket's current implemenation
of continuations.

When Racket one day gets a better implementation of continuations,
this change could be considered again, but the general question is
whether programs can detect or be affected by the size of the
continuation (when the programs don't directly control the
continuation creation --- otherwise continuation marks obviously
expose the size).
2017-06-20 08:28:53 -06:00
Matthew Flatt
23d2a4c58f restore scheme_fd exports
Provide a compatibility layer to bridge the old (not completely
documented) `scheme_fd` interface and rktio. The old interface is
used by the Gtk implementation of `racket/gui`, for example.
2017-06-19 18:30:21 -06:00
Matthew Flatt
9279b96d9e fix connection-failure error message 2017-06-19 11:06:26 -06:00
Matthew Flatt
9bf68adbb0 fix configure wrt places/futures vs. pthreads enabled state 2017-06-19 10:55:44 -06:00
Matthew Flatt
68f55f5b85 rktio: fix success check for connect 2017-06-19 09:47:10 -06:00
Matthew Flatt
54f16758a5 bump version number to reflect rktio refactoring 2017-06-19 06:45:54 -06:00
Matthew Flatt
19ee6d2a0c librktio: fix 32-bit Windows projects 2017-06-19 06:45:19 -06:00
Matthew Flatt
2e4518d08e rktio: makefile repair for --enable-racket= builds 2017-06-19 06:45:19 -06:00