Raymond Toy pushed to branch issue-342-add-ci-static-analyzer at cmucl / cmucl
Commits:
908c2ef1 by Raymond Toy at 2024-07-24T09:58:44-07:00
Do linux build with gcc instead of clang.
Currently the analyzer job requires gcc (because we use `-fanalyzer`
instead `-Xanalyzer` for clang). Perhaps that should be changed some
day.
- - - - -
1 changed file:
- .gitlab-ci.yml
Changes:
=====================================
.gitlab-ci.yml
=====================================
@@ -46,8 +46,10 @@ linux:build:
#- bin/create-target.sh xtarget x86_linux_clang
#- bin/create-target.sh xcross x86_linux_clang
#- bin/cross-build-world.sh -crl -B boot-2020-04-1 xtarget xcross src/tools/cross-scripts/cross-x86-x86.lisp snapshot/bin/lisp
- # Regular build using the cross-compiled result or snapshot
- - bin/build.sh $bootstrap -R -C "x86_linux_clang" -o snapshot/bin/lisp
+ # Regular build using the cross-compiled result or snapshot. The
+ # analyzer job requires gcc, so make sure we build with gcc here
+ # instead of clang.
+ - bin/build.sh $bootstrap -R -C "x86_linux" -o snapshot/bin/lisp
# - bin/build.sh $bootstrap -R -C "x86_linux" -o snapshot/bin/lisp
# Use -V to specify the version in case some tag makes git
# describe return something that make-dist.sh doesn't like.
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/908c2ef11429ef7f9ace870…
--
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/908c2ef11429ef7f9ace870…
You're receiving this email because of your account on gitlab.common-lisp.net.
Raymond Toy pushed to branch issue-306-lisp.c at cmucl / cmucl
Commits:
74311063 by Raymond Toy at 2024-07-24T09:35:29-07:00
Handle leak of searched_core
The initial fix of just returning NULL when `core` is NULL or when
`core` is not accessible like so:
```
if (core && access(core, R_OK) != 0) {
return NULL;
}
```
fixed the analyzer warning that we were leaking `core`.
I think the analyzer is wrong here. If `core` was set by
`search_core` but it is inaccessible, we'd return NULL without freeing
the space returned by search_core.
Instead we do this so that we the searched core is NULL or if it's not
accessible, we free the space before returning. This also fixes the
analyzer warning.
- - - - -
1 changed file:
- src/lisp/lisp.c
Changes:
=====================================
src/lisp/lisp.c
=====================================
@@ -442,16 +442,24 @@ fpu_mode_t fpu_mode = SSE2;
static const char*
locate_core(const char* cmucllib, const char* core, const char* default_core)
{
+ char* searched_core = NULL;
+
if (core == NULL) {
if (getenv("CMUCLCORE") == NULL) {
- core = search_core(cmucllib, default_core);
+ searched_core = search_core(cmucllib, default_core);
+ core = searched_core;
} else {
core = getenv("CMUCLCORE");
}
}
- if (core && access(core, R_OK) != 0) {
- return NULL;
+ if (core) {
+ if (access(core, R_OK) != 0) {
+ if (searched_core) {
+ free(searched_core);
+ }
+ return NULL;
+ }
}
return core;
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/743110632996741b9d8f051…
--
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/743110632996741b9d8f051…
You're receiving this email because of your account on gitlab.common-lisp.net.
Raymond Toy pushed to branch issue-306-lisp.c at cmucl / cmucl
Commits:
11b0847b by Raymond Toy at 2024-07-24T09:15:12-07:00
Add check_ptr(cmucllib,...)
Make sure that cmucllib is not NULL after we gone through all the
cases to determine a value for cmucllib.
- - - - -
ab21364d by Raymond Toy at 2024-07-24T09:20:31-07:00
Handle leak of searched_core
The initial fix of just returning NULL when `core` is NULL or when
`core` is not accessible like so:
```
if (core && access(core, R_OK) != 0) {
return NULL;
}
```
fixed the analyzer warning that we were leaking `core`.
I think the analyzer is wrong here. If `core` was set by
`search_core` but it is inaccessible, we'd return NULL without freeing
the space returned by search_core.
Instead we do this so that we the searched core is NULL or if it's not
accessible, we free the space before returning. This also fixes the
analyzer warning.
- - - - -
1 changed file:
- src/lisp/lisp.c
Changes:
=====================================
src/lisp/lisp.c
=====================================
@@ -451,7 +451,7 @@ locate_core(const char* cmucllib, const char* core, const char* default_core)
}
if (core && access(core, R_OK) != 0) {
- core = NULL;
+ return NULL;
}
return core;
@@ -789,6 +789,8 @@ main(int argc, const char *argv[], const char *envp[])
}
}
+ check_ptr(cmucllib, "cmucllib must not be NULL");
+
/* Only look for a core file if we're not using a built-in image. */
if (builtin_image_flag == 0) {
/*
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/a21feb6f05bde430f56c88…
--
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/a21feb6f05bde430f56c88…
You're receiving this email because of your account on gitlab.common-lisp.net.
Raymond Toy pushed to branch issue-306-lisp.c at cmucl / cmucl
Commits:
a21feb6f by Raymond Toy at 2024-07-24T08:49:54-07:00
Use sprintf instead of strcpy/strcat (in default_cmucllib)
- - - - -
1 changed file:
- src/lisp/lisp.c
Changes:
=====================================
src/lisp/lisp.c
=====================================
@@ -164,9 +164,8 @@ default_cmucllib(const char *argv0arg)
if (argv0_dir[0] == '/') {
cwd = malloc(strlen(argv0_dir) + 2);
check_ptr(cwd, "No space to duplicate argv0");
-
- strcpy(cwd, argv0_dir);
- strcat(cwd, "/");
+
+ sprintf(cwd, "%s/", argv0_dir);
if (debug_lisp_search) {
fprintf(stderr, "absolute path, argv[0] = %s\n", cwd);
}
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/a21feb6f05bde430f56c880…
--
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/a21feb6f05bde430f56c880…
You're receiving this email because of your account on gitlab.common-lisp.net.
Raymond Toy pushed to branch issue-342-add-ci-static-analyzer at cmucl / cmucl
Commits:
ba336a85 by Raymond Toy at 2024-07-24T08:32:54-07:00
Need to save all of linux-4 in linux:build for analyzer
The analyzer job needs linux-4 files from linux:build stage to run the
analyzer. Update the artifacts list to include linux-4 instead of
just linux-4/*.log
- - - - -
1 changed file:
- .gitlab-ci.yml
Changes:
=====================================
.gitlab-ci.yml
=====================================
@@ -37,7 +37,7 @@ linux:build:
- dist/
- linux-2/*.log
- linux-3/*.log
- - linux-4/*.log
+ - linux-4/
needs:
- job: linux:install
artifacts: true
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/ba336a8531775394aee9559…
--
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/ba336a8531775394aee9559…
You're receiving this email because of your account on gitlab.common-lisp.net.
Raymond Toy pushed to branch issue-342-add-ci-static-analyzer at cmucl / cmucl
Commits:
5ca1d65f by Raymond Toy at 2024-07-24T07:07:29-07:00
Just make analyzer job completely optional
Let's not try running this job when pipelines are scheduled. The
pipeline was failing with the message
> linux:static-analyzer' job needs 'linux:build' job, but 'linux:build' is not in any previous stage
Not yet sure how to fix that.
- - - - -
1 changed file:
- .gitlab-ci.yml
Changes:
=====================================
.gitlab-ci.yml
=====================================
@@ -236,15 +236,11 @@ osx:benchmark:
- CMUCL=../../dist/bin/lisp ./run-cmucl.sh
- ../../snapshot/bin/lisp -load report
-# Optional job that runs the static analyzer. Either manually start
-# it or let it run automatically when scheduled pipelines run.
-# It needs the files from the linux-4 directory built in the
-# linux:build job.
+# Optional job that runs the static analyzer. It needs the files from
+# the linux-4 directory built in the linux:build job.
linux:static-analyzer:
stage: analyze
- rules:
- - if: $CI_PIPELINE_SOURCE == "schedule"
- - when: manual
+ when: manual
tags:
- linux
artifacts:
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/5ca1d65ffc28b17cd3c81be…
--
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/5ca1d65ffc28b17cd3c81be…
You're receiving this email because of your account on gitlab.common-lisp.net.
Raymond Toy pushed to branch issue-342-add-ci-static-analyzer at cmucl / cmucl
Commits:
b7e4b907 by Raymond Toy at 2024-07-24T07:00:32-07:00
Add a few comments.
- - - - -
1 changed file:
- .gitlab-ci.yml
Changes:
=====================================
.gitlab-ci.yml
=====================================
@@ -236,6 +236,10 @@ osx:benchmark:
- CMUCL=../../dist/bin/lisp ./run-cmucl.sh
- ../../snapshot/bin/lisp -load report
+# Optional job that runs the static analyzer. Either manually start
+# it or let it run automatically when scheduled pipelines run.
+# It needs the files from the linux-4 directory built in the
+# linux:build job.
linux:static-analyzer:
stage: analyze
rules:
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/b7e4b9078f724e820e60fd3…
--
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/b7e4b9078f724e820e60fd3…
You're receiving this email because of your account on gitlab.common-lisp.net.
Raymond Toy pushed to branch issue-342-add-ci-static-analyzer at cmucl / cmucl
Commits:
1178f928 by Raymond Toy at 2024-07-23T21:29:49-07:00
Add analyze stage for static analysis job
Make sure the static analysis job is in a stage that comes after the
build stage.
- - - - -
1 changed file:
- .gitlab-ci.yml
Changes:
=====================================
.gitlab-ci.yml
=====================================
@@ -10,6 +10,7 @@ stages:
- test
- ansi-test
- benchmark
+ - analyze
cache:
@@ -236,7 +237,7 @@ osx:benchmark:
- ../../snapshot/bin/lisp -load report
linux:static-analyzer:
- stage: build
+ stage: analyze
rules:
- if: $CI_PIPELINE_SOURCE == "schedule"
- when: manual
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/1178f928106474db83591af…
--
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/1178f928106474db83591af…
You're receiving this email because of your account on gitlab.common-lisp.net.
Raymond Toy pushed to branch issue-342-add-ci-static-analyzer at cmucl / cmucl
Commits:
b51d4b08 by Raymond Toy at 2024-07-23T18:54:17-07:00
Fix typo on if rule
"=" should be "=="
- - - - -
1 changed file:
- .gitlab-ci.yml
Changes:
=====================================
.gitlab-ci.yml
=====================================
@@ -238,7 +238,7 @@ osx:benchmark:
linux:static-analyzer:
stage: build
rules:
- - if: $CI_PIPELINE_SOURCE = "schedule"
+ - if: $CI_PIPELINE_SOURCE == "schedule"
- when: manual
tags:
- linux
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/b51d4b08e63253af2e82430…
--
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/b51d4b08e63253af2e82430…
You're receiving this email because of your account on gitlab.common-lisp.net.
Raymond Toy pushed to branch issue-342-add-ci-static-analyzer at cmucl / cmucl
Commits:
54e2e2ed by Raymond Toy at 2024-07-23T18:51:07-07:00
Need to save linux-4/lisp artifact for static analyzer
The static analyzer job needs linux-4/lisp from the linux:build job to
be able to recompile lisp to do the analysis. Hence linux:build must
add linux-4/lisp to the list of artifacts.
- - - - -
1 changed file:
- .gitlab-ci.yml
Changes:
=====================================
.gitlab-ci.yml
=====================================
@@ -62,6 +62,8 @@ linux:cross-build:
- linux-2/*.log
- linux-3/*.log
- linux-4/*.log
+ # The lisp directory is needed for the static analyzer job.
+ - linux-4/lisp
needs:
# Normally need the linux:install stage to get the compiler to
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/54e2e2ed02ddee2594e2185…
--
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/54e2e2ed02ddee2594e2185…
You're receiving this email because of your account on gitlab.common-lisp.net.