Skip to content

client-wasm.js test fails with clang >=22 #4668

@tstellar

Description

@tstellar

Bug Description

A recent llvm commit changed the visibility of the __stack_pointer symbol to make it global. This causes the client-wasm.js test to fail since __stack_pointer now appears on the list of exported symbols where it didn't before.

Reproducible By

Build undici with clang >= 22 (22 is not released yet, but can be currently found in the project's main branch).

Expected Behavior

Test passes.

Logs & Screenshots

✖ failing tests:

test at test/client-wasm.js:46:7
✖ has the right amount of exports (5.248722ms)
  AssertionError [ERR_ASSERTION]: Expected values to be strictly deep-equal:
  + actual - expected
  
    [
      'memory',
  +   '__stack_pointer',
      '_initialize',
      '__indirect_function_table',
      'llhttp_init',
      'llhttp_should_keep_alive',
      'llhttp_alloc',
  
      at res.<computed> [as deepStrictEqual] (/builddir/build/BUILD/nodejs-undici-7.16.0-build/undici-7.16.0/node_modules_dev/@matteo.collina/tspl/tspl.js:58:35)
      at TestContext.<anonymous> (/builddir/build/BUILD/nodejs-undici-7.16.0-build/undici-7.16.0/test/client-wasm.js:50:11)
      at Test.runInAsyncScope (node:async_hooks:214:14)
      at Test.run (node:internal/test_runner/test:1047:25)
      at Test.start (node:internal/test_runner/test:944:17)
      at node:internal/test_runner/test:1440:71
      at node:internal/per_context/primordials:464:82
      at new Promise (<anonymous>)
      at new SafePromise (node:internal/per_context/primordials:433:3)
      at node:internal/per_context/primordials:464:9 {
    generatedMessage: true,
    code: 'ERR_ASSERTION',
    actual: [
      'memory',                                   '__stack_pointer',
      '_initialize',                              '__indirect_function_table',
      'llhttp_init',                              'llhttp_should_keep_alive',
      'llhttp_alloc',                             'malloc',
      'llhttp_free',                              'free',
      'llhttp_get_type',                          'llhttp_get_http_major',
      'llhttp_get_http_minor',                    'llhttp_get_method',
      'llhttp_get_status_code',                   'llhttp_get_upgrade',
      'llhttp_reset',                             'llhttp_execute',
      'llhttp_settings_init',                     'llhttp_finish',
      'llhttp_pause',                             'llhttp_resume',
      'llhttp_resume_after_upgrade',              'llhttp_get_errno',
      'llhttp_get_error_reason',                  'llhttp_set_error_reason',
      'llhttp_get_error_pos',                     'llhttp_errno_name',
      'llhttp_method_name',                       'llhttp_status_name',
      'llhttp_set_lenient_headers',               'llhttp_set_lenient_chunked_length',
      'llhttp_set_lenient_keep_alive',            'llhttp_set_lenient_transfer_encoding',
      'llhttp_set_lenient_version',               'llhttp_set_lenient_data_after_close',
      'llhttp_set_lenient_optional_lf_after_cr',  'llhttp_set_lenient_optional_crlf_after_chunk',
      'llhttp_set_lenient_optional_cr_before_lf', 'llhttp_set_lenient_spaces_after_chunk_size',
      'llhttp_message_needs_eof'
    ],
    expected: [
      'memory',                                       '_initialize',
      '__indirect_function_table',                    'llhttp_init',
      'llhttp_should_keep_alive',                     'llhttp_alloc',
      'malloc',                                       'llhttp_free',
      'free',                                         'llhttp_get_type',
      'llhttp_get_http_major',                        'llhttp_get_http_minor',
      'llhttp_get_method',                            'llhttp_get_status_code',
      'llhttp_get_upgrade',                           'llhttp_reset',
      'llhttp_execute',                               'llhttp_settings_init',
      'llhttp_finish',                                'llhttp_pause',
      'llhttp_resume',                                'llhttp_resume_after_upgrade',
      'llhttp_get_errno',                             'llhttp_get_error_reason',
      'llhttp_set_error_reason',                      'llhttp_get_error_pos',
      'llhttp_errno_name',                            'llhttp_method_name',
      'llhttp_status_name',                           'llhttp_set_lenient_headers',
      'llhttp_set_lenient_chunked_length',            'llhttp_set_lenient_keep_alive',
      'llhttp_set_lenient_transfer_encoding',         'llhttp_set_lenient_version',
      'llhttp_set_lenient_data_after_close',          'llhttp_set_lenient_optional_lf_after_cr',
      'llhttp_set_lenient_optional_crlf_after_chunk', 'llhttp_set_lenient_optional_cr_before_lf',
      'llhttp_set_lenient_spaces_after_chunk_size',   'llhttp_message_needs_eof'
    ],
    operator: 'deepStrictEqual',
    diff: 'simple'
  }

test at test/client-wasm.js:46:7
✖ has the right amount of exports (0.768224ms)
  AssertionError [ERR_ASSERTION]: Expected values to be strictly deep-equal:
  + actual - expected
  
    [
      'memory',
  +   '__stack_pointer',
      '_initialize',
      '__indirect_function_table',
      'llhttp_init',
      'llhttp_should_keep_alive',
      'llhttp_alloc',
  
      at res.<computed> [as deepStrictEqual] (/builddir/build/BUILD/nodejs-undici-7.16.0-build/undici-7.16.0/node_modules_dev/@matteo.collina/tspl/tspl.js:58:35)
      at TestContext.<anonymous> (/builddir/build/BUILD/nodejs-undici-7.16.0-build/undici-7.16.0/test/client-wasm.js:50:11)
      at Test.runInAsyncScope (node:async_hooks:214:14)
      at Test.run (node:internal/test_runner/test:1047:25)
      at Test.start (node:internal/test_runner/test:944:17)
      at node:internal/test_runner/test:1440:71
      at node:internal/per_context/primordials:464:82
      at new Promise (<anonymous>)
      at new SafePromise (node:internal/per_context/primordials:433:3)
      at node:internal/per_context/primordials:464:9 {
    generatedMessage: true,
    code: 'ERR_ASSERTION',
    actual: [
      'memory',                                   '__stack_pointer',
      '_initialize',                              '__indirect_function_table',
      'llhttp_init',                              'llhttp_should_keep_alive',
      'llhttp_alloc',                             'malloc',
      'llhttp_free',                              'free',
      'llhttp_get_type',                          'llhttp_get_http_major',
      'llhttp_get_http_minor',                    'llhttp_get_method',
      'llhttp_get_status_code',                   'llhttp_get_upgrade',
      'llhttp_reset',                             'llhttp_execute',
      'llhttp_settings_init',                     'llhttp_finish',
      'llhttp_pause',                             'llhttp_resume',
      'llhttp_resume_after_upgrade',              'llhttp_get_errno',
      'llhttp_get_error_reason',                  'llhttp_set_error_reason',
      'llhttp_get_error_pos',                     'llhttp_errno_name',
      'llhttp_method_name',                       'llhttp_status_name',
      'llhttp_set_lenient_headers',               'llhttp_set_lenient_chunked_length',
      'llhttp_set_lenient_keep_alive',            'llhttp_set_lenient_transfer_encoding',
      'llhttp_set_lenient_version',               'llhttp_set_lenient_data_after_close',
      'llhttp_set_lenient_optional_lf_after_cr',  'llhttp_set_lenient_optional_crlf_after_chunk',
      'llhttp_set_lenient_optional_cr_before_lf', 'llhttp_set_lenient_spaces_after_chunk_size',
      'llhttp_message_needs_eof'
    ],
    expected: [
      'memory',                                       '_initialize',
      '__indirect_function_table',                    'llhttp_init',
      'llhttp_should_keep_alive',                     'llhttp_alloc',
      'malloc',                                       'llhttp_free',
      'free',                                         'llhttp_get_type',
      'llhttp_get_http_major',                        'llhttp_get_http_minor',
      'llhttp_get_method',                            'llhttp_get_status_code',
      'llhttp_get_upgrade',                           'llhttp_reset',
      'llhttp_execute',                               'llhttp_settings_init',
      'llhttp_finish',                                'llhttp_pause',
      'llhttp_resume',                                'llhttp_resume_after_upgrade',
      'llhttp_get_errno',                             'llhttp_get_error_reason',
      'llhttp_set_error_reason',                      'llhttp_get_error_pos',
      'llhttp_errno_name',                            'llhttp_method_name',
      'llhttp_status_name',                           'llhttp_set_lenient_headers',
      'llhttp_set_lenient_chunked_length',            'llhttp_set_lenient_keep_alive',
      'llhttp_set_lenient_transfer_encoding',         'llhttp_set_lenient_version',
      'llhttp_set_lenient_data_after_close',          'llhttp_set_lenient_optional_lf_after_cr',
      'llhttp_set_lenient_optional_crlf_after_chunk', 'llhttp_set_lenient_optional_cr_before_lf',
      'llhttp_set_lenient_spaces_after_chunk_size',   'llhttp_message_needs_eof'
    ],
    operator: 'deepStrictEqual',
    diff: 'simple'
  }

Environment

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    TestsChanges related to the unit testsbugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions