Closed
Conversation
git-svn-id: http://caml.inria.fr/svn/ocaml/version/4.00@12330 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
git-svn-id: http://caml.inria.fr/svn/ocaml/version/4.00@12333 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
…new filters are applied git-svn-id: http://caml.inria.fr/svn/ocaml/version/4.00@12337 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
git-svn-id: http://caml.inria.fr/svn/ocaml/version/4.00@12339 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
… trunk, commit 12356.) git-svn-id: http://caml.inria.fr/svn/ocaml/version/4.00@12357 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
… with underscore. (Cherry-picked from trunk, commit 12358.) git-svn-id: http://caml.inria.fr/svn/ocaml/version/4.00@12359 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
git-svn-id: http://caml.inria.fr/svn/ocaml/version/4.00@12361 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
…cked from trunk, commit 12371.) git-svn-id: http://caml.inria.fr/svn/ocaml/version/4.00@12372 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
git-svn-id: http://caml.inria.fr/svn/ocaml/version/4.00@12379 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
. Added optional "random" parameter to Hashtbl.create to randomize
collision patterns and improve security (PR#5572, CVE-2012-0839)
. Added "randomize" function and "R" parameter to OCAMLRUNPARAM
to turn randomization on by default (PR#5572, CVE-2012-0839)
- Filename: on-demand (lazy) initialization of the PRNG used by "temp_file".
git-svn-id: http://caml.inria.fr/svn/ocaml/version/4.00@12383 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
…each tool git-svn-id: http://caml.inria.fr/svn/ocaml/version/4.00@12387 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
git-svn-id: http://caml.inria.fr/svn/ocaml/version/4.00@12388 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
…ues of arbitral depth. Per advice of Xavier Leroy used defunctionalized continuation trick git-svn-id: http://caml.inria.fr/svn/ocaml/version/4.00@12392 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
…deeper data structures. Cherry picked SVN rev r12247, r12250, r12271 and r12393 from trunk git-svn-id: http://caml.inria.fr/svn/ocaml/version/4.00@12394 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
git-svn-id: http://caml.inria.fr/svn/ocaml/version/4.00@12396 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
This was referenced Mar 14, 2019
Closed
Closed
shindere
added a commit
that referenced
this pull request
Aug 11, 2020
This job did actually do two different things: 1. Check that the compiler can be built without the world.opt target 2. Run sanitizers This commit thus splits the extra-checks job into two separate ones that are defined as Jenkins pipeline jobs named sanitizers and step-by-step-build.
shindere
added a commit
that referenced
this pull request
Aug 13, 2020
shindere
added a commit
that referenced
this pull request
Aug 13, 2020
shindere
added a commit
that referenced
this pull request
Aug 14, 2020
16 tasks
richardlford
added a commit
to richardlford/ocaml
that referenced
this pull request
Mar 21, 2023
1. Modified Location.absolute_path to do mapping for BUILD_PATH_PREFIX_MAP regardless of whether the path is relative or absolute. Previously it only did it for relative paths. 2. Because of ocaml#1, deleted Location.absolute_path_always. 3. In bytelink.ml, move make_absolute locally within link_bytecode and do not do BUILD_PATH_PREFIX_MAP rewriting. In this case the path is what goes in the shebang, and I do not see how we would want rewriting in that case, unless there was a later processor to rewrite the shebangs. 4. Update man page and manual for the revised BUILD_PATH_PREFIX_MAP spec (approval pending).
richardlford
added a commit
to richardlford/ocaml
that referenced
this pull request
Mar 21, 2023
Note this is a work in progress. The changes will be split into multiple PRs. In order to produce reproducible builds (independent of the location of the build), starting from Dune 3.0, Dune has mapped references to the workspace directory to “/workspace_root”. This change enables ocamldebug to recover the locations of the source code. The ocamldebug user must set the BUILD_PATH_PREFIX_MAP environment variable to effect the mapping. If we only want to map "/workspace_root" to a single directory, say mydir, we would do: export BUILD_PATH_PREFIX_MAP="mydir=/workspace_root" If we want to map to multiple directories, we must separate them with ';'. So to map to mydir1 and mydir2, the setting would be: export BUILD_PATH_PREFIX_MAP="mydir1;mydir2=/workspace_root" Then if ocamldebug has a path like "/workspace_root/stuff", this is converted to the list ["mydir1/stuff" "mydir2/stuff"] Add "mapping" debugger variable to control BUILD_PATH_PREFIX_MAP. In order to allow the BUILD_PATH_PREFIX_MAP environment variable to be set from within ocamldebug, a new debugger variable, "mapping" has been added. It works with the usual set and show commands. When set, the value is put into BUILD_PATH_PREFIX_MAP in ocamldebug's environment, just as if it had been set before entering ocamldebug. And showing it give the current value, including the value on entry, if set. This also makes it possible to set it from .ocamldebug files. The manual and man pages have been updated to describe the change. 1. I added four tests for the ocamldebug support for BUILD_PATH_PREFIX_MAP. One test shows that if debug paths are sanitized by the compiler, then the debugger is unable to find the sources. The other three tests show three ways to provide the BUILD_PATH_PREFIX_MAP to ocamldebug: a. Setting environment variable externally. b. Setting the "mapping" ocamldebug variable in an input script. c. Setting the "mapping" ocamldebug variable in a ".ocamldebug" file. 2. To write the tests I needed a way to have script or ".ocamldebug" files that had ocamldebug variables expanded. I did not see a way to do that, so I added a new "expand" action to ocamltest. It is mostly like the "copy" action, but the source file is read a line at a time and the lines are expanded. It does not support source directories, but the destination can be a directory. 3. I used a dumper to look at the directories in the debug information and noticed that there were still some unsanitized directories. I tracked the source of these in the compiler and modified so all debug directories are sanitized. More ocamltest enhancements, add/fix tests 1. I enhanced ocamltest to have a facility for making builtin functions. These are like ocamltest variables but have a function attached to them, and when the variable is expanded, the arguments are first expanded and then the function is called and its result is returned. 2. Added a new "dumpenv_expanded" action which not only shows the value of each variable, but also what the they expand to. When variables are originally assigned, their RHS is not expanded, but only later when the variable itself is looked up. 3. Two builtin functions were defined: - bppm_decode does BUILD_PATH_PREFIX_MAP decoding - bppm_encode does BUILD_PATH_PREFIX_MAP encoding 4. Tests of the new builtin functions were added. 5. The debugger prefix mapping tests were modified to use bppm_encode. They, in fact, where the motivation for the ocamltest changes. Use load/install printer trick to add ocamldebug unit test When a printer is loaded and installed into the debugger, it has access to the internals of the debugger. I factored out the function that does the BUILD_PATH_PREFIX_MAP processing in ocamldebug and was able to unit test it with code in the fake printer. Modify for revised BUILT_PATH_PREFIX_MAP spec I decided the problem I was addressing for the debugger was more general and that the BUILT_PATH_PREFIX_MAP spec should be generalized to handle it. See richardlford/build-path-prefix-map-spec#1. 1. Modified BUILT_PATH_PREFIX_MAP handling accordingly 2. Used the new facilities in ocamldebug 3. Updated one test for the new spec. 4. Modify encoding and decoding functions in ocamltest. Avoid adding dir to Load_path if already their, some test changes Sanitize paths in debug events Previously we were sanitizing the debug directories but were assuming the paths in debug events were relative. But if the user passes an absolute path to the compiler, it was putting absolute paths in the debug events. Alway rewrite in Location.absolute_path 1. Modified Location.absolute_path to do mapping for BUILD_PATH_PREFIX_MAP regardless of whether the path is relative or absolute. Previously it only did it for relative paths. 2. Because of ocaml#1, deleted Location.absolute_path_always. 3. In bytelink.ml, move make_absolute locally within link_bytecode and do not do BUILD_PATH_PREFIX_MAP rewriting. In this case the path is what goes in the shebang, and I do not see how we would want rewriting in that case, unless there was a later processor to rewrite the shebangs. 4. Update man page and manual for the revised BUILD_PATH_PREFIX_MAP spec (approval pending). Prepare to be able to do Dune tests 1. Added a action helper for testing if a program is available in PATH. 2. Use the helper to make an action, has_dune, that detects whether dune is available. Fixes ocaml#12083
DMaroo
added a commit
to DMaroo/ocaml
that referenced
this pull request
Dec 16, 2023
EmileTrotignon
pushed a commit
to EmileTrotignon/ocaml
that referenced
this pull request
Jan 12, 2024
* starting from rescript-nextjs-template starter, remove some irrelevant parts, fix out of date portions, upgrading most of the files to rescript syntax, and configure vercel deploy
EmileTrotignon
pushed a commit
to EmileTrotignon/ocaml
that referenced
this pull request
Jan 12, 2024
add netlify cms proxy support for local development
EmileTrotignon
pushed a commit
to EmileTrotignon/ocaml
that referenced
this pull request
Jan 12, 2024
Automatically generated. Merged on Netlify CMS.
EmileTrotignon
pushed a commit
to EmileTrotignon/ocaml
that referenced
this pull request
Jan 12, 2024
Add GraphQL API boilerplate
pkhry
added a commit
to pkhry/ocaml
that referenced
this pull request
Apr 17, 2024
nojb
pushed a commit
that referenced
this pull request
Jul 24, 2024
The toplevel printer detects cycles by keeping a hashtable of values
that it has already traversed.
However, some OCaml runtime types (at least bigarrays) may be
partially uninitialized, and hashing them at arbitrary program points
may read uninitialized memory. In particular, the OCaml testsuite
fails when running with a memory-sanitizer enabled, as bigarray
printing results in reads to uninitialized memory:
```
==133712==WARNING: MemorySanitizer: use-of-uninitialized-value
#0 0x4e6d11 in caml_ba_hash /var/home/edwin/git/ocaml/runtime/bigarray.c:486:45
#1 0x52474a in caml_hash /var/home/edwin/git/ocaml/runtime/hash.c:251:35
#2 0x599ebf in caml_interprete /var/home/edwin/git/ocaml/runtime/interp.c:1065:14
#3 0x5a909a in caml_main /var/home/edwin/git/ocaml/runtime/startup_byt.c:575:9
#4 0x540ccb in main /var/home/edwin/git/ocaml/runtime/main.c:37:3
#5 0x7f0910abb087 in __libc_start_call_main (/lib64/libc.so.6+0x2a087) (BuildId: 8f53abaad945a669f2bdcd25f471d80e077568ef)
#6 0x7f0910abb14a in __libc_start_main@GLIBC_2.2.5 (/lib64/libc.so.6+0x2a14a) (BuildId: 8f53abaad945a669f2bdcd25f471d80e077568ef)
#7 0x441804 in _start (/var/home/edwin/git/ocaml/runtime/ocamlrun+0x441804) (BuildId: 7a60eef57e1c2baf770bc38d10d6c227e60ead37)
Uninitialized value was created by a heap allocation
#0 0x47d306 in malloc (/var/home/edwin/git/ocaml/runtime/ocamlrun+0x47d306) (BuildId: 7a60eef57e1c2baf770bc38d10d6c227e60ead37)
#1 0x4e7960 in caml_ba_alloc /var/home/edwin/git/ocaml/runtime/bigarray.c:246:12
#2 0x4e801f in caml_ba_create /var/home/edwin/git/ocaml/runtime/bigarray.c:673:10
#3 0x59b8fc in caml_interprete /var/home/edwin/git/ocaml/runtime/interp.c:1058:14
#4 0x5a909a in caml_main /var/home/edwin/git/ocaml/runtime/startup_byt.c:575:9
#5 0x540ccb in main /var/home/edwin/git/ocaml/runtime/main.c:37:3
#6 0x7f0910abb087 in __libc_start_call_main (/lib64/libc.so.6+0x2a087) (BuildId: 8f53abaad945a669f2bdcd25f471d80e077568ef)
#7 0x7f0910abb14a in __libc_start_main@GLIBC_2.2.5 (/lib64/libc.so.6+0x2a14a) (BuildId: 8f53abaad945a669f2bdcd25f471d80e077568ef)
#8 0x441804 in _start (/var/home/edwin/git/ocaml/runtime/ocamlrun+0x441804) (BuildId: 7a60eef57e1c2baf770bc38d10d6c227e60ead37)
SUMMARY: MemorySanitizer: use-of-uninitialized-value /var/home/edwin/git/ocaml/runtime/bigarray.c:486:45 in caml_ba_hash
```
The only use of hashing in genprintval is to avoid cycles, that is, it
is only useful for OCaml values that contain other OCaml values
(including possibly themselves). Bigarrays cannot introduce cycles,
and they are always printed as "<abstr>" anyway.
The present commit proposes to be more conservative in which values
are hashed by the cycle detector to avoid this issue: we skip hashing
any value with tag above No_scan_tag -- which may not contain any
OCaml values.
Suggested-by: Gabriel Scherer <[email protected]>
Signed-off-by: Edwin Török <[email protected]>
Co-authored-by: Edwin Török <[email protected]>
gasche
pushed a commit
that referenced
this pull request
Aug 1, 2024
Found by -fsanitize=memory -fsanitize-memory-track-origins: ``` > ==102752==WARNING: MemorySanitizer: use-of-uninitialized-value > #0 0x7f2ba7fb4ea4 in caml_runtime_events_read_poll /var/home/edwin/git/ocaml/otherlibs/runtime_events/runtime_events_consumer.c:496:18 > #1 0x7f2ba7fbc016 in caml_ml_runtime_events_read_poll /var/home/edwin/git/ocaml/otherlibs/runtime_events/runtime_events_consumer.c:1207:9 > #2 0x59ba5c in caml_interprete /var/home/edwin/git/ocaml/runtime/interp.c:1058:14 > #3 0x5a9220 in caml_main /var/home/edwin/git/ocaml/runtime/startup_byt.c:575:9 > #4 0x540d6b in main /var/home/edwin/git/ocaml/runtime/main.c:37:3 > #5 0x7f2ba8120087 in __libc_start_call_main (/lib64/libc.so.6+0x2a087) (BuildId: 8f53abaad945a669f2bdcd25f471d80e077568ef) > #6 0x7f2ba812014a in __libc_start_main@GLIBC_2.2.5 (/lib64/libc.so.6+0x2a14a) (BuildId: 8f53abaad945a669f2bdcd25f471d80e077568ef) > #7 0x441804 in _start (/var/home/edwin/git/ocaml/runtime/ocamlrun+0x441804) (BuildId: 617637580ee48eff08a2bce790e1667ad09f3b69) > > Uninitialized value was stored to memory at > #0 0x7f2ba7fb4e9d in caml_runtime_events_read_poll /var/home/edwin/git/ocaml/otherlibs/runtime_events/runtime_events_consumer.c:497:69 > #1 0x7f2ba7fbc016 in caml_ml_runtime_events_read_poll /var/home/edwin/git/ocaml/otherlibs/runtime_events/runtime_events_consumer.c:1207:9 > #2 0x59ba5c in caml_interprete /var/home/edwin/git/ocaml/runtime/interp.c:1058:14 > #3 0x5a9220 in caml_main /var/home/edwin/git/ocaml/runtime/startup_byt.c:575:9 > #4 0x540d6b in main /var/home/edwin/git/ocaml/runtime/main.c:37:3 > #5 0x7f2ba8120087 in __libc_start_call_main (/lib64/libc.so.6+0x2a087) (BuildId: 8f53abaad945a669f2bdcd25f471d80e077568ef) > #6 0x7f2ba812014a in __libc_start_main@GLIBC_2.2.5 (/lib64/libc.so.6+0x2a14a) (BuildId: 8f53abaad945a669f2bdcd25f471d80e077568ef) > #7 0x441804 in _start (/var/home/edwin/git/ocaml/runtime/ocamlrun+0x441804) (BuildId: 617637580ee48eff08a2bce790e1667ad09f3b69) > > Uninitialized value was created by an allocation of 'buf' in the stack frame > #0 0x7f2ba7fb3dbc in caml_runtime_events_read_poll /var/home/edwin/git/ocaml/otherlibs/runtime_events/runtime_events_consumer.c:402:7 > ``` This is in fact an EV_LIFECYCLE with EV_RING_STOP, which has 0 additional data, and thus msg_length 2: ``` runtime/runtime_events.c: EV_RUNTIME, (ev_message_type){.runtime=EV_LIFECYCLE}, EV_RING_STOP, 0, ``` Attempting to read from `buf[2]` would read uninitialized data. Signed-off-by: Edwin Török <[email protected]>
ejgallego
pushed a commit
to ejgallego/ocaml
that referenced
this pull request
Nov 3, 2025
[ci] Add preliminary CI for OCaml-wasm with artifact
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.