-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
grass-addons: initial integration #12889
base: master
Are you sure you want to change the base?
Changes from 3 commits
da60166
eff54fa
5e355c3
c154d9f
de0b51c
1124a5a
344c11b
14319de
f6f28cb
8000285
6b46f27
92fa420
e5dcb74
e989b8c
58ba9e4
4e1eaba
d51eaf3
3799c67
075c243
6882399
3b184a1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Copyright 2024 Google LLC | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
################################################################################ | ||
|
||
FROM gcr.io/oss-fuzz-base/base-builder | ||
RUN git clone --depth 1 https://github.com/OSGeo/grass-addons.git /src/grass-addons | ||
WORKDIR /src/grass-addons | ||
COPY build.sh $SRC/ |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/bash -eu | ||
# Copyright 2024 Google LLC | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
################################################################################ | ||
|
||
mkdir build | ||
cd build | ||
cmake .. | ||
make -j$(nproc) | ||
|
||
$CXX $CXXFLAGS -I /src/grass-addons/include /src/grass-addons/fuzz_target.c -o $OUT/fuzz_target \ | ||
$LIB_FUZZING_ENGINE /src/grass-addons/src/*.o |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
// Copyright 2024 Google LLC | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Given this is already merged in the project-under-test (which is also the way OSS-Fuzz prefers), shall we remove it here and update the build script? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hii @DonggeLiu If removing is better you can do it Thanks There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hii @DonggeLiu Any merging Update on this There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you remove the fuzz target file? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hii @DonggeLiu I had Updated Code accordingly and remove fuzz file from is it looks good now There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes as i check is the only reason with header change to 2024 to 2025? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Did you see this in https://github.com/google/oss-fuzz/actions/runs/12921531205/job/36035725551?pr=12889?
ALL CI checks should pass before we can merge, thanks. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. But it was present here only https://github.com/OSGeo/grass-addons/blob/grass8/Fuzz/fuzz_target.c There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hii @DonggeLiu Here i am geeting this error and i wont be able to the find the problem behind this Could you help in this There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hii @DonggeLiu still geeting error |
||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
#include <stdint.h> | ||
#include <stddef.h> | ||
#include "pavl.h" | ||
#include "sort.h" | ||
#include "local_proto.h" | ||
#include "test_simulation.cpp" | ||
#include "test_treatments.cpp" | ||
|
||
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) | ||
{ | ||
if (size < sizeof(int)) | ||
return 0; | ||
|
||
int input = *(int *)data; | ||
|
||
// fuzz test for pavl_create function from pavl.h | ||
struct pavl_table *table = pavl_create(NULL, NULL, NULL); | ||
if (table) { | ||
pavl_destroy(table, NULL); | ||
} | ||
|
||
// fuzz test for Mergesort_increasing_smallest_azimuth function from sort.h | ||
struct node head; | ||
struct node tail; | ||
Mergesort_increasing_smallest_azimuth(&head, &tail); | ||
|
||
// Fuzz test for functions from local_proto.h | ||
float result = f_and(input, input, E); | ||
result += f_or(input, input, E); | ||
result += f_not(input, E); | ||
|
||
// Fuzz test for test_simulation.cpp | ||
ret += test_calling_all_functions(); | ||
|
||
// Fuzz test for test_treatments.cpp | ||
ret += test_steering(); | ||
|
||
return 0; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
name: grass-addons | ||
path: OSGeo/grass-addons | ||
homepage: "https://grass.osgeo.org/grass-stable/manuals/addons/" | ||
language: c++ | ||
primary_contact: "[email protected]" | ||
fuzzing_engines: | ||
- libfuzzer | ||
sanitizers: | ||
- address | ||
- undefined | ||
main_repo: 'https://github.com/OSGeo/grass-addons' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't work, there is no CMakeLists.txt in the project 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hii @tyler92 i had updated build.sh script but still build check is failing Could you please help in this to create build.sh script so it will pass testcases
Thanks