Segmentation Fault error while running as a superuser

35 views
Skip to first unread message

Rawin Pinkoh

unread,
Jun 15, 2021, 6:32:59 AM6/15/21
to F´ Community Group

I'm trying to create a simple passive component called "Mk1" to retrieve and report hardware status. I did it by reading value from system files (sys/class/thermal/thermal_zone0 for temperature and /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq for clock speed). I'm not sure if this is the right way to do this or if there is an existing driver/component on F' that can do this. I have the app, my topology and the component on my repo here https://github.com/rawinza555/F_Prime_HW_Status

I use Ubuntu 18.04 to cross compile the code to raspberry pi.

When I tried to run this on R Pi, the terminal shows this.

:~ $ sudo ./Mk1 -a <my  GDS IP> -p 50000
Hit Ctrl-C to quit
EVENT: (121) (2:1623748323,148696) DIAGNOSTIC: (CMDDISP) OpCodeRegistered : Opcode 0x021D registered to port 4 slot 0
EVENT: (121) (2:1623748323,148785) DIAGNOSTIC: (CMDDISP) OpCodeRegistered : Opcode 0x021E registered to port 4 slot 1
EVENT: (121) (2:1623748323,148835) DIAGNOSTIC: (CMDDISP) OpCodeRegistered : Opcode 0x021F registered to port 4 slot 2
EVENT: (121) (2:1623748323,148883) DIAGNOSTIC: (CMDDISP) OpCodeRegistered : Opcode 0x0220 registered to port 4 slot 3
EVENT: (121) (2:1623748323,148930) DIAGNOSTIC: (CMDDISP) OpCodeRegistered : Opcode 0x0221 registered to port 4 slot 4
EVENT: (121) (2:1623748323,148976) DIAGNOSTIC: (CMDDISP) OpCodeRegistered : Opcode 0x0222 registered to port 4 slot 5
EVENT: (121) (2:1623748323,149023) DIAGNOSTIC: (CMDDISP) OpCodeRegistered : Opcode 0x0223 registered to port 4 slot 6
EVENT: (121) (2:1623748323,149069) DIAGNOSTIC: (CMDDISP) OpCodeRegistered : Opcode 0x0079 registered to port 1 slot 7
EVENT: (121) (2:1623748323,149111) DIAGNOSTIC: (CMDDISP) OpCodeRegistered : Opcode 0x007A registered to port 1 slot 8
EVENT: (121) (2:1623748323,149153) DIAGNOSTIC: (CMDDISP) OpCodeRegistered : Opcode 0x007B registered to port 1 slot 9
EVENT: (121) (2:1623748323,149197) DIAGNOSTIC: (CMDDISP) OpCodeRegistered : Opcode 0x007C registered to port 1 slot 10
EVENT: (121) (2:1623748323,149242) DIAGNOSTIC: (CMDDISP) OpCodeRegistered : Opcode 0x01A5 registered to port 0 slot 11
EVENT: (121) (2:1623748323,149285) DIAGNOSTIC: (CMDDISP) OpCodeRegistered : Opcode 0x01A7 registered to port 0 slot 12
EVENT: (121) (2:1623748323,149327) DIAGNOSTIC: (CMDDISP) OpCodeRegistered : Opcode 0x01A8 registered to port 0 slot 13
EVENT: (121) (2:1623748323,149370) DIAGNOSTIC: (CMDDISP) OpCodeRegistered : Opcode 0x008D registered to port 3 slot 14
EVENT: (121) (2:1623748323,149412) DIAGNOSTIC: (CMDDISP) OpCodeRegistered : Opcode 0x01F5 registered to port 5 slot 15
EVENT: (121) (2:1623748323,149459) DIAGNOSTIC: (CMDDISP) OpCodeRegistered : Opcode 0x01F6 registered to port 5 slot 16
EVENT: (121) (2:1623748323,149506) DIAGNOSTIC: (CMDDISP) OpCodeRegistered : Opcode 0x01F7 registered to port 5 slot 17
EVENT: (121) (2:1623748323,149552) DIAGNOSTIC: (CMDDISP) OpCodeRegistered : Opcode 0x0259 registered to port 14 slot 18
EVENT: (121) (2:1623748323,149599) DIAGNOSTIC: (CMDDISP) OpCodeRegistered : Opcode 0x025A registered to port 14 slot 19
EVENT: (121) (2:1623748323,149645) DIAGNOSTIC: (CMDDISP) OpCodeRegistered : Opcode 0x025B registered to port 14 slot 20
EVENT: (121) (2:1623748323,149692) DIAGNOSTIC: (CMDDISP) OpCodeRegistered : Opcode 0x025C registered to port 14 slot 21
EVENT: (121) (2:1623748323,149738) DIAGNOSTIC: (CMDDISP) OpCodeRegistered : Opcode 0x025D registered to port 14 slot 22
EVENT: (121) (2:1623748323,149785) DIAGNOSTIC: (CMDDISP) OpCodeRegistered : Opcode 0x025E registered to port 14 slot 23
EVENT: (121) (2:1623748323,149832) DIAGNOSTIC: (CMDDISP) OpCodeRegistered : Opcode 0x0169 registered to port 2 slot 24
EVENT: (121) (2:1623748323,149878) DIAGNOSTIC: (CMDDISP) OpCodeRegistered : Opcode 0x016A registered to port 2 slot 25
EVENT: (121) (2:1623748323,149924) DIAGNOSTIC: (CMDDISP) OpCodeRegistered : Opcode 0x016B registered to port 2 slot 26
EVENT: (147) (2:1623748323,150009) WARNING_HI: (PRM) PrmFileReadError : Parameter file read failed in stage 0 with record 0 and error 1
EVENT: (21) (2:1623748323,150507) DIAGNOSTIC: (RG1) RateGroupStarted : Rate group started.
EVENT: (161) (2:1623748323,150648) DIAGNOSTIC: (RG2) RateGroupStarted : Rate group started.
EVENT: (241) (2:1623748323,150772) DIAGNOSTIC: (RG3) RateGroupStarted : Rate group started.
[ERROR] Failed to send framed data: 1
Assert file "/home/rpk/fprime/Mk1/build-fprime-automatic-raspberrypi/F-Prime/Svc/PrmDb/PrmDbComponentAc.cpp": Line: 197
FATAL 342 handled.
[ERROR] Failed to send framed data: 1
Assert file "/home/rpk/fprime/Mk1/build-fprime-automatic-raspberrypi/F-Prime/Svc/Cycle/CyclePortAc.cpp": Line: 109
FATAL 341 handled.
[ERROR] Failed to send framed data: 1
Exiting with segfault and core dump file.
Segmentation fault

Tracing back, it seems to be from one of the assert function. From my initial research, it seems like the code doesn't have permission to access the system file. I'm quite confused as I run the code as superuser. I'm still a beginner in this and I want to improve more. Any feedback on what I did wrong in this one?

lestarch

unread,
Jun 15, 2021, 12:36:48 PM6/15/21
to F´ Community Group
The segmentation fault is triggered by the assert to force a core dump.  The assert is the greater issue.   It looks like the `pingOut` port might not be connected for the PrmDb component.  I'd check that.

-Michael

Rawin Pinkoh

unread,
Jun 17, 2021, 11:14:08 AM6/17/21
to F´ Community Group
Hi Michael.
I have posted the follow up questions to this problem over in Github discussion tab. If you would take a look over there that would be great.

Thanks
Rawin
Reply all
Reply to author
Forward
0 new messages