Fix stats print on ARM due to indeterminate state of "va_list" parameter after vasprintf (take 2)#935
Conversation
|
If you are at it: Wouldn't it be nice to not use an allocating printf? We should be able to know the (max) column size and therefore should be able to use a fixed size buffer. Also, an option to buffer the output by pre-allocating a bunch of columns would be nice for real-time code. Or even pre-allocating all rows if we are running for a known time. With the current code, the stats hook is not usable in low time step real-time scenarios. |
|
@n-eiling Thanks for the rewiew. I rewrote it again to use fmtlib argument lists. This lets us ditch Furthtermore, we should save a bunch of allocations as all of that is handled by fmtlib/spdlog. |
|
I think the same about the allocations (as I answered in #933) |
|
This still allocates in the real-time critical path, or not? I think fmt is better for sure. If we ever need to output data in real-time we probably should create a separate hook similar to what I implemented in DPsim (https://github.com/sogno-platform/dpsim/blob/master/dpsim/src/RealTimeDataLogger.cpp) @IgnoreWarnings yes please test as much as possible :) |
|
Ping me when you reache a final state, the I will test the branch on arm hardware. |
e9c0464 to
604f80e
Compare
I fixed the broken pre-commit check. The CI should be green in a few minutes. From my side, this is ready for test. I have already validated the fix on a ARM64 system (Macbook M4 Pro with a Linux VM). |
|
Just a note: I think testing adding a raspberry pi VM to the CI could be a good idea. |
We have a GitLab CI runner on a Raspberry Pi 5 in the ACS lab: Its currently only building the code / Docker image. We dont do any tests on it so far. |
The pipeline is still not happy :(. |
bfdafa0 to
bd505a3
Compare
Okay, I fixed the code formatting again. Lets see what it brings. |
|
@IgnoreWarnings, the pipeline passed now :) Did you already had a chance to test it on real hardware? |
n-eiling
left a comment
There was a problem hiding this comment.
Please wait for @IgnoreWarnings tests :)
I checked out your branch and it doesnt build due to some rtc error. It seems like it is not related to your changes but some other update on the master. My Pi just crashed, I will send the compiler output tomorrow. |
|
@stv0g |
|
I don't think this is related to this PR. The webrtc node type is notorious for not compiling on various platforms. I assume this is a version incompatibility? Maybe we should download and compile a specific version in cmake similar to libwebsockets... |
It isn't caused by this PR but prevents me from testing. Also the master should work (again) on pi. |
|
@IgnoreWarnings Which version of libdatachannel are you using? Our Line 459 in 77c4b44 This version includes the missing struct field which raises the error you posted above. However, I noticed that we are not enforcing a version in the Line 76 in 77c4b44 Similarily, also the the |
|
@IgnoreWarnings Could you test it with |
I fixed the compiler error by upgrading from 0.18.4 to 0.22.6 and pinning the version in cmake find package. |
|
@stv0g |
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
|
Oops my bad |
bd505a3 to
dbd4f5a
Compare
|
@stv0g pipeline failed integration timing, can you restart it? |
|
@IgnoreWarnings I restarted it. It's ok now. |
@stv0g I still get the same error. |
|
I heared you want to roll out soon and just wanted to remind you (since this PR was already opened 3 weeks ago) that I have a confirmed working hotfix in #933. |
pjungkamp
left a comment
There was a problem hiding this comment.
I don't know whether the fmt::runtime_format_string<> type could be used as the type of the Table::rowFormat class member variable. It might be worth a try if this saves time in the Table::row.
Signed-off-by: Niklas Eiling <niklas@eil.ing>
…dards Co-authored-by: Philipp Jungkamp <philipp.jungkamp@rwth-aachen.de> Signed-off-by: Niklas Eiling <niklas@eil.ing>
|
Thanks for you support 👍🏻 |
|
Do you mind approving, so we can merge once the CI passes? |
|
Let's wait for @IgnoreWarnings to check if everything works. |
Will test in couple of hours. |
|
The numbers look right now on arm. The table header isnt aligned perfectly, but i think it wasnt aligned before. |
This is another take on #933 / #678.
I think, I found a nice approach by pre-building the format string for a whole table row ince during the initialization. That allows us to use a single
vsprintfcall to format the whole row.What do you think?
I also tweaked the table rendering a bit to fix some miscalculated column width.
Closes #678