Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

data race in event.c:1018 _event_add_read_write #16249

Open
2 tasks done
donaldsharp opened this issue Jun 19, 2024 · 0 comments
Open
2 tasks done

data race in event.c:1018 _event_add_read_write #16249

donaldsharp opened this issue Jun 19, 2024 · 0 comments
Labels
triage Needs further investigation

Comments

@donaldsharp
Copy link
Member

Description

WARNING: ThreadSanitizer: data race (pid=171864)
  Write of size 2 at 0x7bd0000c0014 by thread T3 (mutexes: write M158, write M75):
    #0 _event_add_read_write lib/event.c:1018 (libfrr.so.0+0x58e521)
    #1 bgp_writes_on bgpd/bgp_io.c:59 (bgpd+0x608935)
    #2 bgp_keepalive_send bgpd/bgp_packet.c:641 (bgpd+0x6ac8f3)
    #3 peer_process bgpd/bgp_keepalives.c:111 (bgpd+0x60f4cd)
    #4 hash_iterate lib/hash.c:252 (libfrr.so.0+0x360941)
    #5 bgp_keepalives_start bgpd/bgp_keepalives.c:214 (bgpd+0x6100e4)
    #6 frr_pthread_inner lib/frr_pthread.c:178 (libfrr.so.0+0x352fb9)

  Previous read of size 2 at 0x7bd0000c0014 by main thread:
    [failed to restore the stack]

  Location is heap block of size 131072 at 0x7bd0000c0000 allocated by main thread:
    #0 calloc ../../../../src/libsanitizer/tsan/tsan_interceptors_posix.cpp:667 (libtsan.so.2+0x3fdd2)
    #1 qcalloc lib/memory.c:105 (libfrr.so.0+0x3f5980)
    #2 event_master_create lib/event.c:615 (libfrr.so.0+0x58a718)
    #3 frr_pthread_new lib/frr_pthread.c:81 (libfrr.so.0+0x351b93)
    #4 bgp_pthreads_init bgpd/bgpd.c:8494 (bgpd+0x9dd51d)
    #5 bgp_init bgpd/bgpd.c:8546 (bgpd+0x9de05e)
    #6 main bgpd/bgp_main.c:532 (bgpd+0x49b461)

  Mutex M158 (0x7b0c0001ffe0) created at:
    #0 pthread_mutex_init ../../../../src/libsanitizer/tsan/tsan_interceptors_posix.cpp:1295 (libtsan.so.2+0x53ca6)
    #1 bgp_keepalives_start bgpd/bgp_keepalives.c:175 (bgpd+0x60fc93)
    #2 frr_pthread_inner lib/frr_pthread.c:178 (libfrr.so.0+0x352fb9)

  Mutex M75 (0x7b4800002c90) created at:
    #0 pthread_mutex_init ../../../../src/libsanitizer/tsan/tsan_interceptors_posix.cpp:1295 (libtsan.so.2+0x53ca6)
    #1 event_master_create lib/event.c:557 (libfrr.so.0+0x58985d)
    #2 frr_pthread_new lib/frr_pthread.c:81 (libfrr.so.0+0x351b93)
    #3 bgp_pthreads_init bgpd/bgpd.c:8494 (bgpd+0x9dd51d)
    #4 bgp_init bgpd/bgpd.c:8546 (bgpd+0x9de05e)
    #5 main bgpd/bgp_main.c:532 (bgpd+0x49b461)

  Thread T3 'bgpd_ka' (tid=171869, running) created by main thread at:
    #0 pthread_create ../../../../src/libsanitizer/tsan/tsan_interceptors_posix.cpp:1001 (libtsan.so.2+0x63a59)
    #1 frr_pthread_run lib/frr_pthread.c:197 (libfrr.so.0+0x35319d)
    #2 bgp_pthreads_run bgpd/bgpd.c:8501 (bgpd+0x9dd5e6)
    #3 main bgpd/bgp_main.c:550 (bgpd+0x49ba2d)

SUMMARY: ThreadSanitizer: data race lib/event.c:1018 in _event_add_read_write

Enable by adding --enable-thread-sanitizer and running the all_protocol_startup/bgp_default_originate/bgp_auth/bgp_features to name a few

Version

master

How to reproduce

as above

Expected behavior

no data race

Actual behavior

data race

Additional context

No response

Checklist

  • I have searched the open issues for this bug.
  • I have not included sensitive information in this report.
@donaldsharp donaldsharp added the triage Needs further investigation label Jun 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage Needs further investigation
Projects
None yet
Development

No branches or pull requests

1 participant