taosdata / taosdata/TDengine

Got error when compiled tdengine from alpine

Open
#23,325 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
C
Stars
25.1k
Forks
5k
Avg merge
4d 59m
Merged PRs (30d)
7

Description

Bug Description

Compile libuv error:
In file included from /root/TDengine/contrib/libuv/src/uv-common.h:42,
from /root/TDengine/contrib/libuv/src/uv-common.c:23:
/root/TDengine/contrib/libuv/src/uv-common.c: In function 'uv_walk':
/root/TDengine/contrib/libuv/src/queue.h:68:19: error: storing the address of local variable 'queue' in '((void * ()[2])MEM[(void *[2] * *)loop_13(D) + 16B])[1]' [-Werror=dangling-pointer=]
68 | QUEUE_PREV(q) = (n);
| ^
/root/TDengine/contrib/libuv/src/queue.h:78:7: note: in expansion of macro 'QUEUE_SPLIT'
78 | QUEUE_SPLIT(h, q, n);
| ^~~~~~~~~~~
/root/TDengine/contrib/libuv/src/uv-common.c:507:3: note: in expansion of macro 'QUEUE_MOVE'
507 | QUEUE_MOVE(&loop->handle_queue, &queue);
| ^~~~~~~~~~
/root/TDengine/contrib/libuv/src/uv-common.c:503:9: note: 'queue' declared here
503 | QUEUE queue;
| ^~~~~
/root/TDengine/contrib/libuv/src/queue.h:40:27: note: '((void * ()[2])loop)[2]' declared here
40 | ((const QUEUE *) (q) == (const QUEUE *) QUEUE_NEXT(q))
| ^
/root/TDengine/contrib/libuv/src/queue.h:74:9: note: in expansion of macro 'QUEUE_EMPTY'
74 | if (QUEUE_EMPTY(h))
| ^~~~~~~~~~~
/root/TDengine/contrib/libuv/src/uv-common.c:507:3: note: in expansion of macro 'QUEUE_MOVE'
507 | QUEUE_MOVE(&loop->handle_queue, &queue);
| ^~~~~~~~~~
cc1: all warnings being treated as errors

Environment (please complete the following information):

  • OS: alpine 3.18.4
  • TDengine Version 3.2.0.0

After check , the issue came from libuv version 1.44.2, so need upgrade libuv to 1.46.0

edit file libuv_CMakeLists.txt.in
ExternalProject_Add(libuv
GIT_REPOSITORY https://github.com/libuv/libuv.git
GIT_TAG v1.46.0
SOURCE_DIR "${TD_CONTRIB_DIR}/libuv"
BINARY_DIR "${TD_CONTRIB_DIR}/libuv"
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
TEST_COMMAND ""
)

reference from https://github.com/libuv/libuv/issues/4173

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing libuv_CMakeLists.txt.in and the libuv ExternalProject configuration, then reproduce the reported build on Alpine 3.18.4 with TDengine 3.2.0.0. Done means the bundled libuv dependency builds successfully without the dangling-pointer error treated as a warning.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, cmake
Domain
build-system
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.