#linuxcnc-devel Logs
Aug 13 2023
#linuxcnc-devel Calendar
03:05 AM Connor1 is now known as Connor
09:03 AM -!- #linuxcnc-devel mode set to +v by ChanServ
02:41 PM andypugh_: pere: Are you able to help me persuade valgrind to ignore errors in ld-2.28.so ?
02:47 PM andypugh_: I can’t really see the wood for the trees here: https://drive.google.com/file/d/14v8Z_907-98NKR-H5vylIhYAjodb_Fbw/view?usp=sharing
02:47 PM pere: andypugh_: hi. one can create ignore lists, I believe, but I would suspect there are better ways.
02:50 PM andypugh_: I can’t even tell is valgrind is even checking my code.
02:53 PM pere: I suspect it gave up before it came that far.
02:54 PM andypugh_: Line 3558 mentions rtapi_app
02:56 PM andypugh_: I was planning on re-writing my problem module as standalone C to run it with valgrind, but I am not sure that would help.
03:28 PM pere: sorry, got side tracked.
03:29 PM pere: andypugh_: do you get the same ld-2.28.so messages from valgrind ls? This is on RPi?
03:30 PM andypugh_: Yes, I am working on a gpio driver for the Pi. It’s dragging on, considering that I had it working 3 weeks ago.
03:30 PM andypugh_: Attempts to make it better have not gone well.
03:34 PM pere: <URL: https://stackoverflow.com/questions/59506152/valgrind-reports-hundreds-of-errors-in-hello-world-program-on-raspberrypi-4b > suggest how to fix valgrind on rpi.
03:36 PM andypugh_: Yes, by compiling it from source?
03:38 PM pere: which version of raspian? lsb_release -a?
03:38 PM andypugh_: I have separated out my code into a standalone file, and I am homing in on line 174 here: https://github.com/LinuxCNC/linuxcnc/blob/andypugh/hal_gpio/src/hal/drivers/hal_gpio.c#L174
03:38 PM -!- #linuxcnc-devel mode set to +v by ChanServ
03:39 PM andypugh_: It’s Buster. I couldn’t get libgpiod to work on Bookworm. So deferred that puzzle for later.
03:39 PM pere: not familiar with the methods involved, so the line do not tell me much.
03:40 PM andypugh_: pere: Line 174 returns an opaque pointer. I am wondering if that pointer is outside the memory space allowed to rtapi_app
03:40 PM pere: apt-get source from unstable or dget http://somewhere/valgrind-version.dsc would get you the source, and 'debuild' would give you .debs. But it require a lot of disk space and time to build.
03:41 PM pere: if you make sure /etc/apt/sources.list have a deb-src entry for unstable, you can use 'apt-get source -b valgrind' to build debs.
03:41 PM andypugh_: Actually, forget that idea. The driver actually works as expected unless there is more than one “chip”. I had forgotten that.
03:42 PM pere: might need 'apt-get build-dep valgrind' to get build dependencies.
03:43 PM pere: I got to run. see you in an hour. :)
03:44 PM linuxcnc-build: build #3489 of 1650.rip-buster-rtpreempt-rpi4 is complete: Failure [4failed compile] Build details are at http://buildbot.linuxcnc.org/buildbot/builders/1650.rip-buster-rtpreempt-rpi4/builds/3489 blamelist: andypugh <andy@bodgesoc.org>
03:46 PM linuxcnc-build2: Build [#1322](http://buildbot2.highlab.com/buildbot/#builders/7/builds/1322) of `10-rip.debian-11-bullseye-rtpreempt-amd64` 4failed.
03:46 PM linuxcnc-build2: Build [#1322](http://buildbot2.highlab.com/buildbot/#builders/14/builds/1322) of `10-rip.debian-10-buster-rtpreempt-amd64` 4failed.
03:48 PM linuxcnc-build2: Build [#1327](http://buildbot2.highlab.com/buildbot/#builders/11/builds/1327) of `10-rip.debian-12-bookworm-rtpreempt-amd64` 4failed.
03:48 PM linuxcnc-build2: Build [#1397](http://buildbot2.highlab.com/buildbot/#builders/13/builds/1397) of `00-checkin` 4failed.
03:49 PM linuxcnc-build: build #3328 of 1660.rip-buster-python3 is complete: Failure [4failed compile] Build details are at http://buildbot.linuxcnc.org/buildbot/builders/1660.rip-buster-python3/builds/3328 blamelist: andypugh <andy@bodgesoc.org>
03:50 PM linuxcnc-build: build #3730 of 1640.rip-buster-rtpreempt-amd64 is complete: Failure [4failed compile] Build details are at http://buildbot.linuxcnc.org/buildbot/builders/1640.rip-buster-rtpreempt-amd64/builds/3730 blamelist: andypugh <andy@bodgesoc.org>
03:50 PM linuxcnc-build: build #10148 of 0000.checkin is complete: Failure [4failed] Build details are at http://buildbot.linuxcnc.org/buildbot/builders/0000.checkin/builds/10148 blamelist: andypugh <andy@bodgesoc.org>
04:17 PM -!- #linuxcnc-devel mode set to +v by ChanServ
05:02 PM pere: andypugh_: did you get a newer valgrind building?
05:03 PM andypugh_: Yes, but I don’t know where make install has put it :-)
05:18 PM andypugh_: The new version does seem to be better-behaved.
05:20 PM pere: so you did not make .debs?
05:21 PM pere: could be a good opportunity to get deb building experience. :)
05:39 PM andypugh_: I have _plenty_ od deb building experience…
05:40 PM andypugh_: Where do you think that RTAI debs in our repository came from? The buildbot doesn’t make them.
05:41 PM andypugh_: pere: Do you know if this answer is right? cnicutar seems to be suggesting that realloc just returns some memory, without retaining the existing data?
05:41 PM andypugh_: https://stackoverflow.com/questions/13709419/c-valgrind-conditional-jump-or-move-depends-on-uninitialised-values
05:41 PM -!- #linuxcnc-devel mode set to +v by ChanServ
05:44 PM pere: andypugh_: that sound very strange, as realloc() should always copy the existing data to the new location if relocating.
05:44 PM andypugh_: Yeah, I think he is just wrong.
05:46 PM pere: the code in the stackoverflow question is too short for me to know what the start values are.
05:46 PM andypugh_: Also, valgrind complains about reallocing a nulll pointer, but AFAIK it’s OK to do that?
05:47 PM andypugh_: ie, realloc with a null pointer is equivalent to malloc?
05:47 PM pere: I believe that is platform dependant.
05:49 PM andypugh_: Hmm, some interesting info here: https://stackoverflow.com/questions/12134315/realloc-on-null-valued-or-undefined-pointer
05:50 PM andypugh_: Nul pointer is OK. unintialised pointer, less so.
05:50 PM pere: nope, <URL: https://pubs.opengroup.org/onlinepubs/9699919799/functions/realloc.html > state "If ptr is a null pointer, realloc() shall be equivalent to malloc() for the specified size.".
05:50 PM pere: uninitialized pointer is never ok for realloc(), everywhere.
05:50 PM pere: and the new memory might be uninitialized when extending the block.
05:55 PM pere: <URL: https://en.cppreference.com/w/cpp/memory/c/realloc > - " If the area is expanded, the contents of the new part of the array are undefined."
07:22 PM linuxcnc-build: build #3490 of 1650.rip-buster-rtpreempt-rpi4 is complete: Failure [4failed compile] Build details are at http://buildbot.linuxcnc.org/buildbot/builders/1650.rip-buster-rtpreempt-rpi4/builds/3490 blamelist: andypugh <andy@bodgesoc.org>
07:22 PM linuxcnc-build: build #3329 of 1660.rip-buster-python3 is complete: Failure [4failed compile] Build details are at http://buildbot.linuxcnc.org/buildbot/builders/1660.rip-buster-python3/builds/3329 blamelist: andypugh <andy@bodgesoc.org>
07:23 PM linuxcnc-build: build #3731 of 1640.rip-buster-rtpreempt-amd64 is complete: Failure [4failed compile] Build details are at http://buildbot.linuxcnc.org/buildbot/builders/1640.rip-buster-rtpreempt-amd64/builds/3731 blamelist: andypugh <andy@bodgesoc.org>
07:23 PM linuxcnc-build: build #10149 of 0000.checkin is complete: Failure [4failed] Build details are at http://buildbot.linuxcnc.org/buildbot/builders/0000.checkin/builds/10149 blamelist: andypugh <andy@bodgesoc.org>
08:04 PM Unterhaus__ is now known as Unterhausen