Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
spbro
OpenXG-RAN
Commits
49c4fceb
Commit
49c4fceb
authored
Aug 31, 2021
by
Laurent THOMAS
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix memory error: too early paramters read, then free (before end of usage
parent
7ca1f045
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
34 deletions
+21
-34
common/utils/system.c
common/utils/system.c
+19
-31
executables/nr-softmodem.c
executables/nr-softmodem.c
+1
-1
openair2/GNB_APP/gnb_config.c
openair2/GNB_APP/gnb_config.c
+1
-2
No files found.
common/utils/system.c
View file @
49c4fceb
...
...
@@ -96,39 +96,24 @@ static void read_pipe(int p, char *b, int size) {
}
}
static
int
baseRunTimeCommand
(
char
*
cmd
,
size_t
cmdSize
)
{
FILE
*
fp
;
size_t
retSize
=
0
;
fp
=
popen
(
cmd
,
"r"
);
if
(
fp
)
{
memset
(
cmd
,
0
,
cmdSize
);
retSize
=
fread
(
cmd
,
1
,
cmdSize
,
fp
);
fclose
(
fp
);
}
else
{
LOG_D
(
HW
,
"%s:%d:%s: Cannot open %s
\n
"
,
__FILE__
,
__LINE__
,
__FUNCTION__
,
cmd
);
}
if
(
retSize
==
0
)
{
return
0
;
}
return
atoi
(
cmd
);
static
int
baseRunTimeCommand
(
char
*
cmd
)
{
return
system
(
cmd
);
}
int
checkIfFedoraDistribution
(
void
)
{
char
cmd
[
200
];
memset
(
cmd
,
0
,
200
);
sprintf
(
cmd
,
"cat /etc/os-release | grep ID_LIKE | grep -ic fedora
|| true
"
);
return
baseRunTimeCommand
(
cmd
,
200
);
sprintf
(
cmd
,
"cat /etc/os-release | grep ID_LIKE | grep -ic fedora"
);
return
baseRunTimeCommand
(
cmd
);
}
int
checkIfGenericKernelOnFedora
(
void
)
{
char
cmd
[
200
];
memset
(
cmd
,
0
,
200
);
sprintf
(
cmd
,
"uname -a | grep -c rt
|| true
"
);
return
(
1
-
baseRunTimeCommand
(
cmd
,
200
));
sprintf
(
cmd
,
"uname -a | grep -c rt"
);
return
(
1
-
baseRunTimeCommand
(
cmd
));
}
int
checkIfInsideContainer
(
void
)
{
...
...
@@ -136,8 +121,8 @@ int checkIfInsideContainer(void) {
int
res
=
0
;
memset
(
cmd
,
0
,
200
);
sprintf
(
cmd
,
"cat /proc/self/cgroup | egrep -c 'libpod|podman|kubepods'
|| true
"
);
res
=
baseRunTimeCommand
(
cmd
,
200
);
sprintf
(
cmd
,
"cat /proc/self/cgroup | egrep -c 'libpod|podman|kubepods'"
);
res
=
baseRunTimeCommand
(
cmd
);
if
(
res
>
0
)
return
1
;
else
...
...
@@ -255,19 +240,21 @@ void threadCreate(pthread_t* t, void * (*func)(void*), void * param, char* name,
AssertFatal
(
ret
==
0
,
"ret: %d, errno: %d
\n
"
,
ret
,
errno
);
ret
=
pthread_attr_setinheritsched
(
&
attr
,
PTHREAD_EXPLICIT_SCHED
);
AssertFatal
(
ret
==
0
,
"ret: %d, errno: %d
\n
"
,
ret
,
errno
);
/*
if (checkIfFedoraDistribution())
if (checkIfGenericKernelOnFedora())
if (checkIfInsideContainer())
settingPriority
=
0
;
*/
settingPriority
=
0
;
if
(
settingPriority
)
{
ret
=
pthread_attr_setschedpolicy
(
&
attr
,
SCHED_OAI
);
AssertFatal
(
ret
==
0
,
"ret: %d, errno: %d
\n
"
,
ret
,
errno
);
if
(
priority
<
sched_get_priority_min
(
SCHED_OAI
)
||
priority
>
sched_get_priority_max
(
SCHED_
FIFO
))
{
if
(
priority
<
sched_get_priority_min
(
SCHED_OAI
)
||
priority
>
sched_get_priority_max
(
SCHED_
OAI
))
{
LOG_E
(
TMR
,
"Prio not possible: %d, min is %d, max: %d, forced in the range
\n
"
,
priority
,
sched_get_priority_min
(
SCHED_OAI
),
sched_get_priority_max
(
SCHED_OAI
));
priority
,
sched_get_priority_min
(
SCHED_OAI
),
sched_get_priority_max
(
SCHED_OAI
));
if
(
priority
<
sched_get_priority_min
(
SCHED_OAI
))
priority
=
sched_get_priority_min
(
SCHED_OAI
);
if
(
priority
>
sched_get_priority_max
(
SCHED_OAI
))
...
...
@@ -279,12 +266,13 @@ void threadCreate(pthread_t* t, void * (*func)(void*), void * param, char* name,
ret
=
pthread_attr_setschedparam
(
&
attr
,
&
sparam
);
AssertFatal
(
ret
==
0
,
"ret: %d, errno: %d
\n
"
,
ret
,
errno
);
}
ret
=
pthread_create
(
t
,
&
attr
,
func
,
param
);
AssertFatal
(
ret
==
0
,
"ret: %d, errno: %d
\n
"
,
ret
,
errno
);
pthread_setname_np
(
*
t
,
name
);
if
(
affinity
!=
-
1
)
{
abort
();
cpu_set_t
cpuset
;
CPU_ZERO
(
&
cpuset
);
CPU_SET
(
affinity
,
&
cpuset
);
...
...
executables/nr-softmodem.c
View file @
49c4fceb
...
...
@@ -823,7 +823,7 @@ int main( int argc, char **argv ) {
}
printf
(
"About to call end_configmodule() from %s() %s:%d
\n
"
,
__FUNCTION__
,
__FILE__
,
__LINE__
);
end_configmodule
();
//
end_configmodule();
printf
(
"Called end_configmodule() from %s() %s:%d
\n
"
,
__FUNCTION__
,
__FILE__
,
__LINE__
);
// wait for end of program
printf
(
"TYPE <CTRL-C> TO TERMINATE
\n
"
);
...
...
openair2/GNB_APP/gnb_config.c
View file @
49c4fceb
...
...
@@ -812,9 +812,8 @@ void RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) {
paramdef_t
GNBParams
[]
=
GNBPARAMS_DESC
;
paramlist_def_t
GNBParamList
=
{
GNB_CONFIG_STRING_GNB_LIST
,
NULL
,
0
};
NR_ServingCellConfigCommon_t
*
scc
=
calloc
(
1
,
sizeof
(
NR_ServingCellConfigCommon_t
));
NR_ServingCellConfigCommon_t
*
scc
=
calloc
(
1
,
sizeof
(
*
scc
));
uint64_t
ssb_bitmap
=
0xff
;
memset
((
void
*
)
scc
,
0
,
sizeof
(
NR_ServingCellConfigCommon_t
));
prepare_scc
(
scc
);
paramdef_t
SCCsParams
[]
=
SCCPARAMS_DESC
(
scc
);
paramlist_def_t
SCCsParamList
=
{
GNB_CONFIG_STRING_SERVINGCELLCONFIGCOMMON
,
NULL
,
0
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment