Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 24 additions & 23 deletions abi/libasdf-x86_64.abi
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@
<elf-symbol name='libasdf_software' size='32' type='object-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
<elf-symbol name='libasdf_version' size='32' type='object-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
</elf-variable-symbols>
<abi-instr address-size='64' path='../src/block.c' language='LANG_C11'>
<abi-instr address-size='64' path='src/block.c' language='LANG_C11'>
<type-decl name='bool' size-in-bits='8' id='c894953d'/>
<type-decl name='char' size-in-bits='8' id='a84c031d'/>
<array-type-def dimensions='1' type-id='a84c031d' size-in-bits='8' id='89feb1ec'>
Expand Down Expand Up @@ -458,13 +458,14 @@
</enum-decl>
<enum-decl name='asdf_log_level_t' naming-typedef-id='55972ccd' id='0da4e011'>
<underlying-type type-id='9cac1fee'/>
<enumerator name='ASDF_LOG_NONE' value='0'/>
<enumerator name='ASDF_LOG_DEFAULT' value='0'/>
<enumerator name='ASDF_LOG_TRACE' value='1'/>
<enumerator name='ASDF_LOG_DEBUG' value='2'/>
<enumerator name='ASDF_LOG_INFO' value='3'/>
<enumerator name='ASDF_LOG_WARN' value='4'/>
<enumerator name='ASDF_LOG_ERROR' value='5'/>
<enumerator name='ASDF_LOG_FATAL' value='6'/>
<enumerator name='ASDF_LOG_NONE' value='7'/>
</enum-decl>
<enum-decl name='asdf_parser_state_t' naming-typedef-id='3d30ee25' id='7d2d41b1'>
<underlying-type type-id='9cac1fee'/>
Expand Down Expand Up @@ -1198,6 +1199,7 @@
<class-decl name='_IO_wide_data' is-struct='yes' visibility='default' is-declaration-only='yes' id='79bd3751'/>
<class-decl name='fy_document' is-struct='yes' visibility='default' is-declaration-only='yes' id='b2eeb354'/>
<class-decl name='fy_parser' is-struct='yes' visibility='default' is-declaration-only='yes' id='84e21a3a'/>
<class-decl name='fy_event' is-struct='yes' visibility='default' is-declaration-only='yes' id='3d2ad71f'/>
<function-decl name='asdf_block_count' mangled-name='asdf_block_count' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='asdf_block_count'>
<parameter type-id='b14ada4d' name='file'/>
<return type-id='b59d7dce'/>
Expand Down Expand Up @@ -1299,15 +1301,14 @@
<class-decl name='asdf_block_info_vec' is-struct='yes' visibility='default' is-declaration-only='yes' id='ed1c1e13'/>
<typedef-decl name='asdf_block_index' type-id='00a280de' id='4c48fbe3'/>
<typedef-decl name='asdf_block_info_vec' type-id='ed1c1e13' id='b45d19f4'/>
<class-decl name='fy_event' is-struct='yes' visibility='default' is-declaration-only='yes' id='3d2ad71f'/>
<type-decl name='void' id='48b5725f'/>
<pointer-type-def type-id='48b5725f' id='eaa32e2f'/>
<function-type size-in-bits='64' id='c5c76c9c'>
<parameter type-id='eaa32e2f'/>
<return type-id='48b5725f'/>
</function-type>
</abi-instr>
<abi-instr address-size='64' path='../src/core/asdf.c' language='LANG_C11'>
<abi-instr address-size='64' path='src/core/asdf.c' language='LANG_C11'>
<array-type-def dimensions='1' type-id='42c2389b' size-in-bits='256' id='4dddca76'>
<subrange length='4' lower-bound='0' upper-bound='3' type-id='f0981eeb' id='16fe7105'/>
</array-type-def>
Expand Down Expand Up @@ -1623,7 +1624,7 @@
<return type-id='48b5725f'/>
</function-type>
</abi-instr>
<abi-instr address-size='64' path='../src/core/datatype.c' language='LANG_C11'>
<abi-instr address-size='64' path='src/core/datatype.c' language='LANG_C11'>
<enum-decl name='asdf_byteorder_t' naming-typedef-id='f41cdccc' id='f6b45ae0'>
<underlying-type type-id='9cac1fee'/>
<enumerator name='ASDF_BYTEORDER_INVALID' value='-1'/>
Expand Down Expand Up @@ -1756,7 +1757,7 @@
<return type-id='9c313c2d'/>
</function-decl>
</abi-instr>
<abi-instr address-size='64' path='../src/core/extension_metadata.c' language='LANG_C11'>
<abi-instr address-size='64' path='src/core/extension_metadata.c' language='LANG_C11'>
<pointer-type-def type-id='8ae1604b' size-in-bits='64' id='c041f7e6'/>
<pointer-type-def type-id='c041f7e6' size-in-bits='64' id='73d91624'/>
<function-decl name='asdf_extension_metadata_copy' mangled-name='asdf_extension_metadata_copy' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='asdf_extension_metadata_copy'>
Expand Down Expand Up @@ -1815,7 +1816,7 @@
<return type-id='48b5725f'/>
</function-decl>
</abi-instr>
<abi-instr address-size='64' path='../src/core/history_entry.c' language='LANG_C11'>
<abi-instr address-size='64' path='src/core/history_entry.c' language='LANG_C11'>
<function-decl name='asdf_history_entry_copy' mangled-name='asdf_history_entry_copy' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='asdf_history_entry_copy'>
<parameter type-id='b14ada4d' name='file'/>
<parameter type-id='0251f179' name='src'/>
Expand Down Expand Up @@ -1877,7 +1878,7 @@
<return type-id='95e97e5e'/>
</function-decl>
</abi-instr>
<abi-instr address-size='64' path='../src/core/ndarray.c' language='LANG_C11'>
<abi-instr address-size='64' path='src/core/ndarray.c' language='LANG_C11'>
<type-decl name='_Float16' size-in-bits='16' id='8465f89b'/>
<enum-decl name='asdf_ndarray_err_t' naming-typedef-id='16d29625' id='639b8a01'>
<underlying-type type-id='9cac1fee'/>
Expand Down Expand Up @@ -2162,7 +2163,7 @@
<return type-id='16d29625'/>
</function-decl>
</abi-instr>
<abi-instr address-size='64' path='../src/core/software.c' language='LANG_C11'>
<abi-instr address-size='64' path='src/core/software.c' language='LANG_C11'>
<pointer-type-def type-id='bb114554' size-in-bits='64' id='fa30655a'/>
<function-decl name='asdf_software_copy' mangled-name='asdf_software_copy' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='asdf_software_copy'>
<parameter type-id='b14ada4d' name='file'/>
Expand Down Expand Up @@ -2230,7 +2231,7 @@
<return type-id='48b5725f'/>
</function-decl>
</abi-instr>
<abi-instr address-size='64' path='../src/core/time.c' language='LANG_C11'>
<abi-instr address-size='64' path='src/core/time.c' language='LANG_C11'>
<pointer-type-def type-id='cb759bb5' size-in-bits='64' id='e082ee30'/>
<pointer-type-def type-id='e082ee30' size-in-bits='64' id='881cd2ee'/>
<pointer-type-def type-id='ebe2b73d' size-in-bits='64' id='6ce63935'/>
Expand Down Expand Up @@ -2298,7 +2299,7 @@
<return type-id='48b5725f'/>
</function-decl>
</abi-instr>
<abi-instr address-size='64' path='../src/error.c' language='LANG_C11'>
<abi-instr address-size='64' path='src/error.c' language='LANG_C11'>
<enum-decl name='asdf_error_code_t' naming-typedef-id='6b98346e' id='c6d0dba2'>
<underlying-type type-id='9cac1fee'/>
<enumerator name='ASDF_ERR_NONE' value='0'/>
Expand Down Expand Up @@ -2364,7 +2365,7 @@
</function-decl>
<type-decl name='variadic parameter type' id='2c1145c5'/>
</abi-instr>
<abi-instr address-size='64' path='../src/event.c' language='LANG_C11'>
<abi-instr address-size='64' path='src/event.c' language='LANG_C11'>
<pointer-type-def type-id='d7f2b1f6' size-in-bits='64' id='d096eda3'/>
<qualified-type-def type-id='d7f2b1f6' const='yes' id='3aedec86'/>
<pointer-type-def type-id='3aedec86' size-in-bits='64' id='708b92c4'/>
Expand Down Expand Up @@ -2406,7 +2407,7 @@
<return type-id='48b5725f'/>
</function-decl>
</abi-instr>
<abi-instr address-size='64' path='../src/extension_registry.c' language='LANG_C11'>
<abi-instr address-size='64' path='src/extension_registry.c' language='LANG_C11'>
<pointer-type-def type-id='077d9ff3' size-in-bits='64' id='368ddacc'/>
<function-decl name='asdf_extension_get' mangled-name='asdf_extension_get' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='asdf_extension_get'>
<parameter type-id='b14ada4d' name='file'/>
Expand All @@ -2418,7 +2419,7 @@
<return type-id='48b5725f'/>
</function-decl>
</abi-instr>
<abi-instr address-size='64' path='../src/extension_util.c' language='LANG_C11'>
<abi-instr address-size='64' path='src/extension_util.c' language='LANG_C11'>
<function-decl name='asdf_get_required_property' mangled-name='asdf_get_required_property' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='asdf_get_required_property'>
<parameter type-id='241167d5' name='mapping'/>
<parameter type-id='80f4b756' name='name'/>
Expand All @@ -2436,7 +2437,7 @@
<return type-id='88078e53'/>
</function-decl>
</abi-instr>
<abi-instr address-size='64' path='../src/file.c' language='LANG_C11'>
<abi-instr address-size='64' path='src/file.c' language='LANG_C11'>
<typedef-decl name='asdf_depth_t' type-id='9da381c4' id='ef85e943'/>
<typedef-decl name='asdf_value_pred_t' type-id='c988a833' id='55806fb9'/>
<pointer-type-def type-id='241167d5' size-in-bits='64' id='c666b66d'/>
Expand Down Expand Up @@ -2835,7 +2836,7 @@
<return type-id='c894953d'/>
</function-type>
</abi-instr>
<abi-instr address-size='64' path='../src/info.c' language='LANG_C11'>
<abi-instr address-size='64' path='src/info.c' language='LANG_C11'>
<qualified-type-def type-id='cd88a909' const='yes' id='5ab04299'/>
<pointer-type-def type-id='5ab04299' size-in-bits='64' id='7678ffc9'/>
<function-decl name='asdf_info' mangled-name='asdf_info' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='asdf_info'>
Expand All @@ -2846,7 +2847,7 @@
</function-decl>
<typedef-decl name='asdf_info_cfg_t' type-id='09f6faae' id='cd88a909'/>
</abi-instr>
<abi-instr address-size='64' path='../src/log.c' language='LANG_C11'>
<abi-instr address-size='64' path='src/log.c' language='LANG_C11'>
<qualified-type-def type-id='befce77a' const='yes' id='dcedb0aa'/>
<pointer-type-def type-id='dcedb0aa' size-in-bits='64' id='4a2cd980'/>
<function-decl name='asdf_file_log' mangled-name='asdf_file_log' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='asdf_file_log'>
Expand All @@ -2859,7 +2860,7 @@
<return type-id='48b5725f'/>
</function-decl>
</abi-instr>
<abi-instr address-size='64' path='../src/parser.c' language='LANG_C11'>
<abi-instr address-size='64' path='src/parser.c' language='LANG_C11'>
<qualified-type-def type-id='74fe1ce2' const='yes' id='67e84972'/>
<pointer-type-def type-id='67e84972' size-in-bits='64' id='eaab7588'/>
<qualified-type-def type-id='84b177ab' const='yes' id='872e98db'/>
Expand Down Expand Up @@ -2917,7 +2918,7 @@
</function-decl>
<typedef-decl name='asdf_stream_t' type-id='bc95f1e0' id='ed047fde'/>
</abi-instr>
<abi-instr address-size='64' path='../src/tag.c' language='LANG_C11'>
<abi-instr address-size='64' path='src/tag.c' language='LANG_C11'>
<class-decl name='asdf_tag_t' size-in-bits='128' is-struct='yes' naming-typedef-id='5a2e7e5e' visibility='default' id='15a36c5b'>
<data-member access='public' layout-offset-in-bits='0'>
<var-decl name='name' type-id='80f4b756' visibility='default'/>
Expand All @@ -2937,13 +2938,13 @@
<return type-id='48b5725f'/>
</function-decl>
</abi-instr>
<abi-instr address-size='64' path='../src/util.c' language='LANG_C11'>
<abi-instr address-size='64' path='src/util.c' language='LANG_C11'>
<function-decl name='asdf_free' mangled-name='asdf_free' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='asdf_free'>
<parameter type-id='eaa32e2f' name='buf'/>
<return type-id='48b5725f'/>
</function-decl>
</abi-instr>
<abi-instr address-size='64' path='../src/value.c' language='LANG_C11'>
<abi-instr address-size='64' path='src/value.c' language='LANG_C11'>
<class-decl name='asdf_container_iter_t' size-in-bits='192' is-struct='yes' naming-typedef-id='4d433ebe' visibility='default' id='86b8634d'>
<data-member access='public' layout-offset-in-bits='0'>
<var-decl name='key' type-id='80f4b756' visibility='default'/>
Expand Down Expand Up @@ -3728,7 +3729,7 @@
<return type-id='4c28b278'/>
</function-decl>
</abi-instr>
<abi-instr address-size='64' path='../src/version.c' language='LANG_C11'>
<abi-instr address-size='64' path='src/version.c' language='LANG_C11'>
<function-decl name='asdf_version_parse' mangled-name='asdf_version_parse' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='asdf_version_parse'>
<parameter type-id='80f4b756' name='version'/>
<return type-id='10a19a1f'/>
Expand All @@ -3742,7 +3743,7 @@
<return type-id='48b5725f'/>
</function-decl>
</abi-instr>
<abi-instr address-size='64' path='../src/yaml.c' language='LANG_C11'>
<abi-instr address-size='64' path='src/yaml.c' language='LANG_C11'>
<enum-decl name='asdf_yaml_event_type_t' naming-typedef-id='5d7ff93b' id='c003942f'>
<underlying-type type-id='9cac1fee'/>
<enumerator name='ASDF_YAML_NONE_EVENT' value='0'/>
Expand Down
29 changes: 29 additions & 0 deletions changes/+logging-fixes.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
Several fixes to logging:

- Setting `asdf_log_cfg_t.level` to `ASDF_LOG_NONE` now disables logging.
Previously ``ASDF_LOG_NONE`` was ``0``, the same as an unset level, so it
selected the default level instead. The default is now the new
``ASDF_LOG_DEFAULT=0``, implying to use the global default
(`ASDF_LOG_WARN`) and `ASDF_LOG_NONE` is higher than every message
severity.

This also fixes building with ``--with-log-default=NONE`` (or
``-DLOG_DEFAULT=NONE``), which logged everything instead of nothing.
- Explicitly setting `asdf_log_cfg_t.level` to `ASDF_LOG_WARN` was
treated as unset, so the ``ASDF_LOG_LEVEL`` environment variable took
precedence over it.
- Log output is colorized only when the stream is a terminal, rather than
always in builds with color support, which wrote escape codes into log
files and pipes. The new ``ASDF_LOG_COLOR`` environment variable forces
color on (``1``) or off (``0``), but `asdf_log_cfg_t.no_color` takes
precedence if set explicitly.
- Fixed doubled or trailing spaces in log lines when some of the log fields
are disabled.
- The log stream is flushed after every message, so messages are not lost or
delayed when it is buffered.
- Logging no longer clobbers ``errno``.
- ``asdf_file_log`` with an invalid level no longer reads out of bounds; the
message is dropped.
- Lowered the very frequent YAML scalar type inference messages from
``DEBUG`` to ``TRACE``, so ``DEBUG`` logging is no longer dominated by
them.
22 changes: 11 additions & 11 deletions changes/274.bugfix
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,22 @@ Several fixes to compressed block data reading:
Fixed reading compressed arrays. Every access to a compressed block's data
after the first returned the raw compressed bytes instead of the decompressed
data, so that, for example, reading successive tiles with
``asdf_ndarray_read_tile_2d`` returned garbage and could crash reading past the
end of the compressed data.
``asdf_ndarray_read_tile_2d`` returned garbage and could crash reading past
the end of the compressed data.

Fixed lazy decompression of LZ4-compressed arrays larger than 4 MB, which
returned zeros for all data past the first 4 MB, and could read past the end of
a buffer for the last, partial chunk. Tile reads now return
returned zeros for all data past the first 4 MB, and could read past the end
of a buffer for the last, partial chunk. Tile reads now return
``ASDF_NDARRAY_ERR_OUT_OF_BOUNDS`` rather than reading out of bounds when the
array's data is smaller than its shape requires.

Finally, fixed a race condition if multiple threads are reading the same
decompressed data buffer (e.g. as returned by `asdf_block_data` or
`asdf_ndarray_data`), and each encounter page faults. If multiple threads
cause page faults in the same range handled by a UFFD, the kernel queues these
and handles one at a time, even if the faulting address has had its page filled
by a previous fault handler call for one one of the other threads. In this
case the subsequent page faults, which have already been handled, should just
wake the faulting thread and allow it to resume. Instead it fell through to
attempting to copy the data again, resulting in an error (``EEXIST`` from
``ioctl``) causing the fault handler thread to exit.
cause page faults in the same range handled by a UFFD, the kernel queues
these and handles one at a time, even if the faulting address has had its
page filled by a previous fault handler call for one one of the other
threads. In this case the subsequent page faults, which have already been
handled, should just wake the faulting thread and allow it to resume.
Instead it fell through to attempting to copy the data again, resulting in an
error (``EEXIST`` from ``ioctl``) causing the fault handler thread to exit.
6 changes: 3 additions & 3 deletions changes/276.bugfix
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Fixed auto-selection of decompression mode. Lazy decompression was only being
used if explicitly requested and not as the default on supported platforms
(i.e. Linux).
Fixed auto-selection of decompression mode. Lazy decompression was only
being used if explicitly requested and not as the default on supported
platforms (i.e. Linux).
6 changes: 4 additions & 2 deletions docs/usage/opening.rst
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,10 @@ Messages are emitted only if their severity meets the configured
the destination defaults to ``stderr``, the included fields to
`ASDF_LOG_FIELD_ALL`, and the level to the value of the ``ASDF_LOG_LEVEL``
environment variable (one of ``NONE``, ``TRACE``, ``DEBUG``, ``INFO``,
``WARN``, ``ERROR``, ``FATAL``), or ``WARN`` if it is unset. This makes it
possible to raise the log level of an application without recompiling it::
``WARN``, ``ERROR``, ``FATAL``), or ``WARN`` if it is unset. Setting the level
to ``ASDF_LOG_NONE`` disables logging for the file. Leaving the level unset
makes it possible to raise the log level of an application without
recompiling it::

ASDF_LOG_LEVEL=debug ./my-program observation.asdf

Expand Down
Loading
Loading