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:95 thread_process_io_helper #16248

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

data race in event.c:95 thread_process_io_helper #16248

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=171846)
  Write of size 8 at 0x7bd000220118 by thread T5 (mutexes: write M359):
    #0 thread_process_io_helper lib/event.c:1624 (libfrr.so.0+0x5943f6)
    #1 thread_process_io_inner_loop lib/event.c:1657 (libfrr.so.0+0x5949ec)
    #2 thread_process_io lib/event.c:1705 (libfrr.so.0+0x595d19)
    #3 event_fetch lib/event.c:1881 (libfrr.so.0+0x597822)
    #4 fpt_run lib/frr_pthread.c:368 (libfrr.so.0+0x3545fd)
    #5 frr_pthread_inner lib/frr_pthread.c:178 (libfrr.so.0+0x352fb9)

  Previous read of size 8 at 0x7bd000220118 by main thread (mutexes: write M31):
    #0 show_event_poll_helper lib/event.c:404 (libfrr.so.0+0x588385)
    #1 show_event_poll lib/event.c:437 (libfrr.so.0+0x588ba5)
    #2 cmd_execute_command_real lib/command.c:1002 (libfrr.so.0+0x2b8480)
    #3 cmd_execute_command lib/command.c:1052 (libfrr.so.0+0x2b8881)
    #4 cmd_execute lib/command.c:1227 (libfrr.so.0+0x2b98de)
    #5 vty_command lib/vty.c:616 (libfrr.so.0+0x5b3580)
    #6 vty_execute lib/vty.c:1379 (libfrr.so.0+0x5bc8d9)
    #7 vtysh_read lib/vty.c:2374 (libfrr.so.0+0x5c554c)
    #8 event_call lib/event.c:2013 (libfrr.so.0+0x5984e1)
    #9 frr_run lib/libfrr.c:1217 (libfrr.so.0+0x3b36a5)
    #10 main zebra/main.c:521 (zebra+0x2764a6)

  Location is heap block of size 131072 at 0x7bd000220000 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:580 (libfrr.so.0+0x589cc9)
    #3 frr_pthread_new lib/frr_pthread.c:81 (libfrr.so.0+0x351b93)
    #4 zserv_client_create zebra/zserv.c:809 (zebra+0x52492c)
    #5 zserv_accept zebra/zserv.c:912 (zebra+0x52507c)
    #6 event_call lib/event.c:2013 (libfrr.so.0+0x5984e1)
    #7 frr_run lib/libfrr.c:1217 (libfrr.so.0+0x3b36a5)
    #8 main zebra/main.c:521 (zebra+0x2764a6)

  Mutex M359 (0x7b4800003590) 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 zserv_client_create zebra/zserv.c:809 (zebra+0x52492c)
    #4 zserv_accept zebra/zserv.c:912 (zebra+0x52507c)
    #5 event_call lib/event.c:2013 (libfrr.so.0+0x5984e1)
    #6 frr_run lib/libfrr.c:1217 (libfrr.so.0+0x3b36a5)
    #7 main zebra/main.c:521 (zebra+0x2764a6)

  Mutex M31 (0x7f1666335520) created at:
    #0 pthread_mutex_lock ../../../../src/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:4324 (libtsan.so.2+0x59bbf)
    #1 _frr_mtx_lock lib/frr_pthread.h:255 (libfrr.so.0+0x57c74a)
    #2 event_master_create lib/event.c:621 (libfrr.so.0+0x58a88d)
    #3 frr_init lib/libfrr.c:784 (libfrr.so.0+0x3b085c)
    #4 main zebra/main.c:436 (zebra+0x2761c8)

  Thread T5 'zebra_apic' (tid=171870, 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 zserv_client_create zebra/zserv.c:819 (zebra+0x5249cf)
    #3 zserv_accept zebra/zserv.c:912 (zebra+0x52507c)
    #4 event_call lib/event.c:2013 (libfrr.so.0+0x5984e1)
    #5 frr_run lib/libfrr.c:1217 (libfrr.so.0+0x3b36a5)
    #6 main zebra/main.c:521 (zebra+0x2764a6)

SUMMARY: ThreadSanitizer: data race lib/event.c:1624 in thread_process_io_helper

You can see this with --enable-thread-sanitizer and running the bgp_default_originate topotest

Version

master

How to reproduce

described 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