File tree 3 files changed +95
-0
lines changed
3 files changed +95
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Test UBSan
2
+
3
+ on :
4
+ pull_request :
5
+ types : [opened, synchronize, reopened, ready_for_review]
6
+ paths-ignore :
7
+ - .mailmap
8
+ - ' **.md'
9
+ - AUTHORS
10
+ - doc/**
11
+ - .github/**
12
+ - ' !.github/workflows/ubsan-asan.yml'
13
+ push :
14
+ branches :
15
+ - main
16
+ - canary
17
+ - v[0-9]+.x-staging
18
+ - v[0-9]+.x
19
+ paths-ignore :
20
+ - .mailmap
21
+ - ' **.md'
22
+ - AUTHORS
23
+ - doc/**
24
+ - .github/**
25
+ - ' !.github/workflows/ubsan-asan.yml'
26
+
27
+ concurrency :
28
+ group : ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
29
+ cancel-in-progress : true
30
+
31
+ env :
32
+ ASAN_OPTIONS : intercept_tls_get_addr=0
33
+ PYTHON_VERSION : ' 3.11'
34
+ FLAKY_TESTS : keep_retrying
35
+
36
+ permissions :
37
+ contents : read
38
+
39
+ jobs :
40
+ test-ubsan :
41
+ if : github.event.pull_request.draft == false
42
+ runs-on : ubuntu-20.04
43
+ env :
44
+ CC : clang
45
+ CXX : clang++
46
+ LINK : clang++
47
+ CONFIG_FLAGS : --enable-ubsan
48
+ steps :
49
+ - uses : actions/checkout@v3
50
+ with :
51
+ persist-credentials : false
52
+ - name : Set up Python ${{ env.PYTHON_VERSION }}
53
+ uses : actions/setup-python@v4
54
+ with :
55
+ python-version : ${{ env.PYTHON_VERSION }}
56
+ - name : Environment Information
57
+ run : npx envinfo
58
+ - name : Build
59
+ run : make build-ci -j2 V=1
60
+ - name : Test
61
+ run : make run-ci -j2 V=1 TEST_CI_ARGS="-p actions -t 300 --measure-flakiness 9"
Original file line number Diff line number Diff line change 2
2
'variables' : {
3
3
'configuring_node%' : 0 ,
4
4
'asan%' : 0 ,
5
+ 'ubsan%' : 0 ,
5
6
'werror' : '' , # Turn off -Werror in V8 build.
6
7
'visibility%' : 'hidden' , # V8's visibility setting
7
8
'target_arch%' : 'ia32' , # set v8's target architecture
369
370
}],
370
371
],
371
372
}],
373
+ ['ubsan == 1 and OS != "mac" and OS != "zos"' , {
374
+ 'cflags+' : [
375
+ '-fno-omit-frame-pointer' ,
376
+ '-fsanitize=undefined' ,
377
+ ],
378
+ 'defines' : [ 'UNDEFINED_SANITIZER' ],
379
+ 'cflags!' : [ '-fomit-frame-pointer' ],
380
+ 'ldflags' : [ '-fsanitize=undefined' ],
381
+ }],
382
+ ['ubsan == 1 and OS == "mac"' , {
383
+ 'xcode_settings' : {
384
+ 'OTHER_CFLAGS+' : [
385
+ '-fno-omit-frame-pointer' ,
386
+ '-fsanitize=undefined' ,
387
+ '-DUNDEFINED_SANITIZER'
388
+ ],
389
+ 'OTHER_CFLAGS!' : [
390
+ '-fomit-frame-pointer' ,
391
+ ],
392
+ },
393
+ 'target_conditions' : [
394
+ ['_type!="static_library"' , {
395
+ 'xcode_settings' : {'OTHER_LDFLAGS' : ['-fsanitize=undefined' ]},
396
+ }],
397
+ ],
398
+ }],
372
399
['v8_enable_pointer_compression == 1' , {
373
400
'defines' : [
374
401
'V8_COMPRESS_POINTERS' ,
Original file line number Diff line number Diff line change 710
710
default = None ,
711
711
help = 'compile for Address Sanitizer to find memory bugs' )
712
712
713
+ parser .add_argument ('--enable-ubsan' ,
714
+ action = 'store_true' ,
715
+ dest = 'enable_ubsan' ,
716
+ default = None ,
717
+ help = 'compile for Undefined Behavior Sanitizer' )
718
+
713
719
parser .add_argument ('--enable-static' ,
714
720
action = 'store_true' ,
715
721
dest = 'enable_static' ,
@@ -1407,6 +1413,7 @@ def configure_node(o):
1407
1413
o ['variables' ]['library_files' ] = options .linked_module
1408
1414
1409
1415
o ['variables' ]['asan' ] = int (options .enable_asan or 0 )
1416
+ o ['variables' ]['ubsan' ] = int (options .enable_ubsan or 0 )
1410
1417
1411
1418
if options .coverage :
1412
1419
o ['variables' ]['coverage' ] = 'true'
You can’t perform that action at this time.
0 commit comments