Skip to content

Some Makefile and doc tweaks#15

Merged
2 commits merged into
redis:masterfrom
melo:master
Sep 13, 2010
Merged

Some Makefile and doc tweaks#15
2 commits merged into
redis:masterfrom
melo:master

Conversation

@melo

@melo melo commented Sep 13, 2010

Copy link
Copy Markdown
Contributor

No description provided.

Signed-off-by: Pedro Melo <melo@simplicidade.org>
Signed-off-by: Pedro Melo <melo@simplicidade.org>
@gofish gofish mentioned this pull request Mar 14, 2012
@s-tchaikovsky s-tchaikovsky mentioned this pull request Jul 26, 2013
@kakabear kakabear mentioned this pull request Sep 29, 2013
ncopa pushed a commit to ncopa/redis that referenced this pull request Jan 7, 2016
Drop versions upstream doesn't list on their main "downloads" page
bratpiorka referenced this pull request in TieredMemDB/TieredMemDB Oct 11, 2021
Back port memKeyDB to redis v3.2.12
ShooterIT added a commit that referenced this pull request May 28, 2025
#14072)

Compiled Redis with COVERAGE_TEST, while using the fork API encountered
the following issue:
- Forked process calls `RedisModule_ExitFromChild` - child process
starts to report its COW while performing IO operations
- Parent process terminates child process with
`RedisModule_KillForkChild`
- Child process signal handler gets called while an IO operation is
called
- exit() is called because COVERAGE_TEST was on during compilation.
- exit() tries to perform more IO operations in its exit handlers.
- process gets deadlocked

Backtrace snippet:
```
#0  futex_wait (private=0, expected=2, futex_word=0x7e1220000c50) at ../sysdeps/nptl/futex-internal.h:146
#1  __GI___lll_lock_wait_private (futex=0x7e1220000c50) at ./nptl/lowlevellock.c:34
#2  0x00007e1234696429 in __GI__IO_flush_all () at ./libio/genops.c:698
#3  0x00007e123469680d in _IO_cleanup () at ./libio/genops.c:843
#4  0x00007e1234647b74 in __run_exit_handlers (status=status@entry=255, listp=<optimized out>, run_list_atexit=run_list_atexit@entry=true, run_dtors=run_dtors@entry=true) at ./stdlib/exit.c:129
#5  0x00007e1234647bbe in __GI_exit (status=status@entry=255) at ./stdlib/exit.c:138
#6  0x00005ef753264e13 in exitFromChild (retcode=255) at /home/jonathan/CLionProjects/redis/src/server.c:263
#7  sigKillChildHandler (sig=<optimized out>) at /home/jonathan/CLionProjects/redis/src/server.c:6794
#8  <signal handler called>
#9  0x00007e1234685b94 in _IO_fgets (buf=buf@entry=0x7e122dafdd90 "KSM:", ' ' <repeats 19 times>, "0 kB\n", n=n@entry=1024, fp=fp@entry=0x7e1220000b70) at ./libio/iofgets.c:47
#10 0x00005ef75326c5e0 in fgets (__stream=<optimized out>, __n=<optimized out>, __s=<optimized out>, __s=<optimized out>, __n=<optimized out>, __stream=<optimized out>) at /usr/include/x86_64-linux-gnu/bits/stdio2.h:200
#11 zmalloc_get_smap_bytes_by_field (field=0x5ef7534c42fd "Private_Dirty:", pid=<optimized out>) at /home/jonathan/CLionProjects/redis/src/zmalloc.c:928
#12 0x00005ef75338ab1f in zmalloc_get_private_dirty (pid=-1) at /home/jonathan/CLionProjects/redis/src/zmalloc.c:978
#13 sendChildInfoGeneric (info_type=CHILD_INFO_TYPE_MODULE_COW_SIZE, keys=0, progress=-1, pname=0x5ef7534c95b2 "Module fork") at /home/jonathan/CLionProjects/redis/src/childinfo.c:71
#14 0x00005ef75337962c in sendChildCowInfo (pname=0x5ef7534c95b2 "Module fork", info_type=CHILD_INFO_TYPE_MODULE_COW_SIZE) at /home/jonathan/CLionProjects/redis/src/server.c:6895
#15 RM_ExitFromChild (retcode=0) at /home/jonathan/CLionProjects/redis/src/module.c:11468
```

Change is to make the exit() _exit() calls conditional based on a
parameter to exitFromChild function.
The signal handler should exit without io operations since it doesn't
know its history.(If we were in the middle of IO operations before it
was called)

---------

Co-authored-by: Yuan Wang <wangyuancode@163.com>
YaacovHazan pushed a commit that referenced this pull request Jul 6, 2025
#14072)

Compiled Redis with COVERAGE_TEST, while using the fork API encountered
the following issue:
- Forked process calls `RedisModule_ExitFromChild` - child process
starts to report its COW while performing IO operations
- Parent process terminates child process with
`RedisModule_KillForkChild`
- Child process signal handler gets called while an IO operation is
called
- exit() is called because COVERAGE_TEST was on during compilation.
- exit() tries to perform more IO operations in its exit handlers.
- process gets deadlocked

Backtrace snippet:
```
#0  futex_wait (private=0, expected=2, futex_word=0x7e1220000c50) at ../sysdeps/nptl/futex-internal.h:146
#1  __GI___lll_lock_wait_private (futex=0x7e1220000c50) at ./nptl/lowlevellock.c:34
#2  0x00007e1234696429 in __GI__IO_flush_all () at ./libio/genops.c:698
#3  0x00007e123469680d in _IO_cleanup () at ./libio/genops.c:843
#4  0x00007e1234647b74 in __run_exit_handlers (status=status@entry=255, listp=<optimized out>, run_list_atexit=run_list_atexit@entry=true, run_dtors=run_dtors@entry=true) at ./stdlib/exit.c:129
#5  0x00007e1234647bbe in __GI_exit (status=status@entry=255) at ./stdlib/exit.c:138
#6  0x00005ef753264e13 in exitFromChild (retcode=255) at /home/jonathan/CLionProjects/redis/src/server.c:263
#7  sigKillChildHandler (sig=<optimized out>) at /home/jonathan/CLionProjects/redis/src/server.c:6794
#8  <signal handler called>
#9  0x00007e1234685b94 in _IO_fgets (buf=buf@entry=0x7e122dafdd90 "KSM:", ' ' <repeats 19 times>, "0 kB\n", n=n@entry=1024, fp=fp@entry=0x7e1220000b70) at ./libio/iofgets.c:47
#10 0x00005ef75326c5e0 in fgets (__stream=<optimized out>, __n=<optimized out>, __s=<optimized out>, __s=<optimized out>, __n=<optimized out>, __stream=<optimized out>) at /usr/include/x86_64-linux-gnu/bits/stdio2.h:200
#11 zmalloc_get_smap_bytes_by_field (field=0x5ef7534c42fd "Private_Dirty:", pid=<optimized out>) at /home/jonathan/CLionProjects/redis/src/zmalloc.c:928
#12 0x00005ef75338ab1f in zmalloc_get_private_dirty (pid=-1) at /home/jonathan/CLionProjects/redis/src/zmalloc.c:978
#13 sendChildInfoGeneric (info_type=CHILD_INFO_TYPE_MODULE_COW_SIZE, keys=0, progress=-1, pname=0x5ef7534c95b2 "Module fork") at /home/jonathan/CLionProjects/redis/src/childinfo.c:71
#14 0x00005ef75337962c in sendChildCowInfo (pname=0x5ef7534c95b2 "Module fork", info_type=CHILD_INFO_TYPE_MODULE_COW_SIZE) at /home/jonathan/CLionProjects/redis/src/server.c:6895
#15 RM_ExitFromChild (retcode=0) at /home/jonathan/CLionProjects/redis/src/module.c:11468
```

Change is to make the exit() _exit() calls conditional based on a
parameter to exitFromChild function.
The signal handler should exit without io operations since it doesn't
know its history.(If we were in the middle of IO operations before it
was called)

---------

Co-authored-by: Yuan Wang <wangyuancode@163.com>
minchopaskal pushed a commit to minchopaskal/redis that referenced this pull request Oct 16, 2025
Jawad606 added a commit to test-organiation-task-1/redis that referenced this pull request Nov 29, 2025
tezc added a commit that referenced this pull request Jun 29, 2026
TSan complains because `server.allow_access_expired` is accessed from a
BIO thread: populateDeltaHistograms() reaches hashTypeLength() via
getObjectLength() with subtractExpiredFields==0.

Fix it by reading that variable only when necessary, i.e. only when
subtractExpiredFields is set.


```
*** [err]: Sanitizer error: ==================
WARNING: ThreadSanitizer: data race (pid=77380)
  Write of size 4 at 0x55e70ee77980 by main thread (mutexes: write M0):
    #0 moduleNotifyKeyUnlink /home/runner/work/redis/redis/src/module.c:13193 (redis-server+0x33246d) (BuildId: 56f4df0f306eff979d7ac5c7c665610cf8c07edb)
    #1 dbSetValue /home/runner/work/redis/redis/src/db.c:623 (redis-server+0x158aa4) (BuildId: 56f4df0f306eff979d7ac5c7c665610cf8c07edb)
    #2 setKeyByLink /home/runner/work/redis/redis/src/db.c:777 (redis-server+0x159406) (BuildId: 56f4df0f306eff979d7ac5c7c665610cf8c07edb)
    #3 setGenericCommand /home/runner/work/redis/redis/src/t_string.c:181 (redis-server+0x1a1ce2) (BuildId: 56f4df0f306eff979d7ac5c7c665610cf8c07edb)
    #4 setCommand /home/runner/work/redis/redis/src/t_string.c:443 (redis-server+0x1a22d8) (BuildId: 56f4df0f306eff979d7ac5c7c665610cf8c07edb)
    #5 call /home/runner/work/redis/redis/src/server.c:4035 (redis-server+0xe719f) (BuildId: 56f4df0f306eff979d7ac5c7c665610cf8c07edb)
    #6 processCommand /home/runner/work/redis/redis/src/server.c:4808 (redis-server+0xea119) (BuildId: 56f4df0f306eff979d7ac5c7c665610cf8c07edb)
    #7 processCommandAndResetClient /home/runner/work/redis/redis/src/networking.c:3497 (redis-server+0x13e076) (BuildId: 56f4df0f306eff979d7ac5c7c665610cf8c07edb)
    #8 processInputBuffer /home/runner/work/redis/redis/src/networking.c:3789 (redis-server+0x13e076)
    #9 processPendingCommandAndInputBuffer /home/runner/work/redis/redis/src/networking.c:3541 (redis-server+0x13fadf) (BuildId: 56f4df0f306eff979d7ac5c7c665610cf8c07edb)
    #10 processClientsFromIOThread /home/runner/work/redis/redis/src/iothread.c:619 (redis-server+0xc1cfa) (BuildId: 56f4df0f306eff979d7ac5c7c665610cf8c07edb)
    #11 handleClientsFromIOThread /home/runner/work/redis/redis/src/iothread.c:680 (redis-server+0xc1e59) (BuildId: 56f4df0f306eff979d7ac5c7c665610cf8c07edb)
    #12 aeProcessEvents /home/runner/work/redis/redis/src/ae.c:435 (redis-server+0xa861d) (BuildId: 56f4df0f306eff979d7ac5c7c665610cf8c07edb)
    #13 aeProcessEvents /home/runner/work/redis/redis/src/ae.c:360 (redis-server+0xa861d)
    #14 aeMain /home/runner/work/redis/redis/src/ae.c:495 (redis-server+0xa861d)
    #15 main /home/runner/work/redis/redis/src/server.c:8327 (redis-server+0x8b4c4) (BuildId: 56f4df0f306eff979d7ac5c7c665610cf8c07edb)

  Previous read of size 4 at 0x55e70ee77980 by thread T3:
    #0 hashTypeLength /home/runner/work/redis/redis/src/t_hash.c:2299 (redis-server+0x1eb6b5) (BuildId: 56f4df0f306eff979d7ac5c7c665610cf8c07edb)
    #1 getObjectLength /home/runner/work/redis/redis/src/object.c:1009 (redis-server+0x151d69) (BuildId: 56f4df0f306eff979d7ac5c7c665610cf8c07edb)
    #2 populateDeltaHistograms /home/runner/work/redis/redis/src/lazyfree.c:33 (redis-server+0x2fd505) (BuildId: 56f4df0f306eff979d7ac5c7c665610cf8c07edb)
    #3 kvsLazyfreeFree /home/runner/work/redis/redis/src/lazyfree.c:63 (redis-server+0x2fd505)
    #4 bioProcessBackgroundJobs /home/runner/work/redis/redis/src/bio.c:340 (redis-server+0x2b07cb) (BuildId: 56f4df0f306eff979d7ac5c7c665610cf8c07edb)
    ```
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants