Comments (15)
from orbuculum.
Thanks for your reply. Does that work? Btw the example code above is not entirely correct, I have a nrf_delay_ms(1000); inside the loop.
from orbuculum.
from orbuculum.
Yes, it does. I tried several traces that I collected, all segfault. Some give an ITM Overflow warning before, some don't. Can this be related to my machine? I am running this on a Raspberry Pi 3 B+. Normal ITM SendChar etc. works totally fine though.
from orbuculum.
from orbuculum.
Just tried it over lunch on Ubuntu on Pi. Still works perfectly :-/ Do you get any warnings on build?
Next step is to run it under gdb with your existing command line like; gdb --args so we can see where exactly it's falling over.
from orbuculum.
Good idea, this is what gdb gave me:
(gdb) run
Starting program: /home/pi/orb/ofiles/orbuculum -f trace.txt
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/arm-linux-gnueabihf/libthread_db.so.1".
[New Thread 0x76e12460 (LWP 4082)]
[New Thread 0x76611460 (LWP 4083)]
Thread 1 "orbuculum" received signal SIGSEGV, Segmentation fault.
strlen () at ../sysdeps/arm/armv6t2/strlen.S:126
126 ../sysdeps/arm/armv6t2/strlen.S: No such file or directory.
(gdb) bt
#0 strlen () at ../sysdeps/arm/armv6t2/strlen.S:126
#1 0x76e9f344 in __vfprintf_internal (s=s@entry=0x7effe290, format=format@entry=0x406920 "%d,%ld,%d,%s,0x%x\n", ap=..., ap@entry=...,
mode_flags=mode_flags@entry=0) at vfprintf-internal.c:1688
#2 0x76eab0a4 in __vsnprintf_internal (string=0x7effe3dc "4,56,0,0", maxlen=<optimized out>, format=0x406920 "%d,%ld,%d,%s,0x%x\n",
format@entry=0x7effe3bc "\004", args=..., args@entry=..., mode_flags=mode_flags@entry=0) at vsnprintf.c:114
#3 0x76e92d26 in __GI___snprintf (s=<optimized out>, maxlen=<optimized out>, format=0x406920 "%d,%ld,%d,%s,0x%x\n") at snprintf.c:31
#4 0x004040aa in _handleDataRWWP ()
#5 0x0040446a in _itmPumpProcess ()
#6 0x00401f82 in _processBlock ()
#7 0x00402f5c in fileFeeder ()
#8 0x00401804 in main ()
(gdb)
I actually got a lot of string format warnings when building, I thought that would be fine but now that I see this error it may actually have something to do with it?
Example:
Src/fifos.c: In function ‘_handleException’:
Src/fifos.c:309:66: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 5 has type ‘uint64_t’ {aka ‘long long unsigned int’} [-Wformat=]
309 | opLen = snprintf( outputString, MAX_STRING_LENGTH, "%d,%ld,%s,%s" EOL, HWEVENT_EXCEPTION, eventdifftS, exEvent[m->eventType & 0x03], exNames[m->exceptionNumber & 0x0F] );
| ~~^ ~~~~~~~~~~~
| | |
| long int uint64_t {aka long long unsigned int}
| %lld
If you don't have an immediate clue I will try with ubuntu instead of raspbian tomorrow. Did you use 20.04?
from orbuculum.
from orbuculum.
The dwt_segfault_fix contains a patch for the deprecation warning. It's also where any eventual patch for this segfault would end up going.
DAVE
from orbuculum.
Src/fifos.c: In function ‘_handleException’:
Src/fifos.c:309:66: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 5 has type ‘uint64_t’ {aka ‘long long unsigned int’} [-Wformat=]
309 | opLen = snprintf( outputString, MAX_STRING_LENGTH, "%d,%ld,%s,%s" EOL, HWEVENT_EXCEPTION, eventdifftS, exEvent[m->eventType & 0x03], exNames[m->exceptionNumber & 0x0F] );
| ~~^ ~~~~~~~~~~~
| | |
| long int uint64_t {aka long long unsigned int}
| %lld
Now, this could easily cause a problem. AFAIK rasbian is 32 bit native so then all of the other parameters on that command line would be out by 32 bits. Can you try changing that parameter to %lld and let's see if that fixes it? If it does then I guess we need to use the exact length format specifiers for printf, which we can easily do...but let's see if that's the problem first.
from orbuculum.
Benjoyo,
It's flying a bit of a kite, but please try the current dwt_segfault_fix branch. It includes explicit 64 bit uint codings. I don't know if it will work but it's worth a fiddle with.
DAVE
from orbuculum.
It's flying a bit of a kite, but please try the current dwt_segfault_fix branch. It includes explicit 64 bit uint codings. I don't know if it will work but it's worth a fiddle with.
Yes! That does work! The warnings for fifos.c are gone and it writes to hwevent file just fine, no segfault.
If it helps, this is the build output with the remaining warnings:
Compiling Src/generics.c
Compiling Src/itmDecoder.c
Compiling Src/tpiuDecoder.c
Compiling Src/msgDecoder.c
Compiling Src/msgSeq.c
Completed build of orb
Compiling Src/orbuculum.c
Compiling Src/filewriter.c
Compiling Src/external/ftdispi.c
Compiling Src/fifos.c
Compiling Src/nwclient.c
Completed build of orbuculum
Compiling Src/orbcat.c
Completed build of orbcat
Compiling Src/orbtop.c
In file included from Src/orbtop.c:59:
Src/orbtop.c: In function ‘_outputTop’:
Inc/generics.h:67:19: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 5 has type ‘uint64_t’ {aka ‘long long unsigned int’} [-Wformat=]
67 | #define C_YELLOW "\033[1;33m"
| ^~~~~~~~~~~~
Src/orbtop.c:637:38: note: in expansion of macro ‘C_YELLOW’
637 | fprintf( stdout, C_YELLOW "%3d.%02d%% " C_LBLUE " %8ld ", percentage / 100, percentage % 100, report[n].count );
| ^~~~~~~~
Src/orbtop.c:637:74: note: format string is defined here
637 | fprintf( stdout, C_YELLOW "%3d.%02d%% " C_LBLUE " %8ld ", percentage / 100, percentage % 100, report[n].count );
| ~~~^
| |
| long int
| %8lld
In file included from Src/orbtop.c:59:
Inc/generics.h:67:19: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 5 has type ‘uint64_t’ {aka ‘long long unsigned int’} [-Wformat=]
67 | #define C_YELLOW "\033[1;33m"
| ^~~~~~~~~~~~
Src/orbtop.c:693:22: note: in expansion of macro ‘C_YELLOW’
693 | fprintf( stdout, C_YELLOW "%3d.%02d%% " C_LBLUE " %8ld " C_RESET "of "C_YELLOW" %ld "C_RESET" Samples" EOL, totPercent / 100, totPercent % 100, dispSamples, samples );
| ^~~~~~~~
Src/orbtop.c:693:58: note: format string is defined here
693 | fprintf( stdout, C_YELLOW "%3d.%02d%% " C_LBLUE " %8ld " C_RESET "of "C_YELLOW" %ld "C_RESET" Samples" EOL, totPercent / 100, totPercent % 100, dispSamples, samples );
| ~~~^
| |
| long int
| %8lld
In file included from Src/orbtop.c:59:
Inc/generics.h:67:19: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 6 has type ‘uint64_t’ {aka ‘long long unsigned int’} [-Wformat=]
67 | #define C_YELLOW "\033[1;33m"
| ^~~~~~~~~~~~
Src/orbtop.c:693:22: note: in expansion of macro ‘C_YELLOW’
693 | fprintf( stdout, C_YELLOW "%3d.%02d%% " C_LBLUE " %8ld " C_RESET "of "C_YELLOW" %ld "C_RESET" Samples" EOL, totPercent / 100, totPercent % 100, dispSamples, samples );
| ^~~~~~~~
Src/orbtop.c:693:87: note: format string is defined here
693 | fprintf( stdout, C_YELLOW "%3d.%02d%% " C_LBLUE " %8ld " C_RESET "of "C_YELLOW" %ld "C_RESET" Samples" EOL, totPercent / 100, totPercent % 100, dispSamples, samples );
| ~~^
| |
| long int
| %lld
Compiling Src/symbols.c
Compiling Src/external/cJSON.c
Completed build of orbtop
Compiling Src/orbdump.c
Completed build of orbdump
Compiling Src/orbstat.c
Src/orbstat.c: In function ‘_dumpProfile’:
Src/orbstat.c:367:65: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 9 has type ‘uint64_t’ {aka ‘long long unsigned int’} [-Wformat=]
367 | fprintf( _r.c, "fl=(%d) %s\nfn=(%d) %s\n0x%08x %d %ld\n", t->index, t->n->filename, t->index, t->n->function, t->n->addr, t->n->line, myCost );
| ~~^ ~~~~~~
| | |
| long int uint64_t {aka long long unsigned int}
| %lld
Src/orbstat.c:396:65: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 9 has type ‘uint64_t’ {aka ‘long long unsigned int’} [-Wformat=]
396 | fprintf( _r.c, "fl=(%d) %s\nfn=(%d) %s\n0x%08x %d %ld\n", t->index, t->n->filename, t->index, t->n->function, t->n->addr, t->n->line, myCost );
| ~~^ ~~~~~~
| | |
| long int uint64_t {aka long long unsigned int}
| %lld
Src/orbstat.c:415:37: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 5 has type ‘uint64_t’ {aka ‘long long unsigned int’} [-Wformat=]
415 | fprintf( _r.c, "0x%08x %d %ld\n", _r.sub[i].src, f->n->line, totalCost );
| ~~^ ~~~~~~~~~
| | |
| long int uint64_t {aka long long unsigned int}
| %lld
Src/orbstat.c: In function ‘_outputProfile’:
Src/orbstat.c:475:32: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 3 has type ‘uint64_t’ {aka ‘long long unsigned int’} [-Wformat=]
475 | fprintf( _r.c, "summary: %ld\n", _r.calls[_r.cdCount - 1].tstamp - _r.calls[0].tstamp );
| ~~^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| | |
| long int uint64_t {aka long long unsigned int}
| %lld
Completed build of orbstat
But for my current use case that fix was enough, thanks so much!
from orbuculum.
from orbuculum.
Yes, all warnings are gone 👍
from orbuculum.
OK, this is now folded into main, as at 9f6a8e9
from orbuculum.
Related Issues (20)
- Install more files on Linux HOT 1
- Extraneous arguments in meson.build file HOT 3
- Inconsistent results from orbfifo when reading from file and writing to permanent file HOT 3
- Arch linux builds need a meson prefix HOT 3
- Cannot set server and port in orbfifo HOT 2
- Do not require trailing slash in orbfifo basedir HOT 2
- Cannot abort orbfifo with Ctrl + C when not yet connected HOT 6
- First contribution HOT 1
- gdbtrace.init does not seem to work with newer version of arm-none-eabi-gdb HOT 7
- Windows CLI output has corrupted characters HOT 2
- orbtop CPU usage increases over time
- Orbmortem save to file not working HOT 2
- 'ARM_INS_ERET' not in /usr/include/capstone/arm.h HOT 2
- orbtop should provide immediate error about missing objdump HOT 2
- orbtop: Exception number format, 0..N vs -16..N HOT 5
- orbtop exception tick count wrong for nested instructions HOT 1
- Weird help message for the orbtrace -T option HOT 1
- Loosely formatted orbcat output specification doesn't result in output HOT 1
- Package binaries along with releases HOT 1
- Orbuculum fails to connect to J-LINK GDB Server on Windows. HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from orbuculum.