I have been trying to get oorexx to compile on Net, Free and OpenBSD .
A patch for this is attached.
Comments on the patch:
BSD don't have libdl, use CMAKE_DL_LIBS instead of hardcoding dl.
CMAKE_DL_LIBS is set to dl on systems that have it.
sys/stat.h is where S_IWUSR etc are defined according to posix.
It is needed to get these on NetBSD in
common/platform/unix/SysFile.hpp and sys/stat.h is assumed
to be always available in other parts of the code
(interpreter/platform/unix/SysFileSystem.hpp) so always include
it.
arpa/inet.h was needed to get htons etc on FreeBSD.
Instead of setting HOST_NAME_MAX to _POSIX_HOST_NAME_MAX for
certain OS:s set it if HOST_NAME_MAX is not defined and
_POSIX_HOST_NAME_MAX is available. This should work on all
platforms.
Anonymous
Sorry I filed this in bugs it should have gone to patches
I append this here, the provided patch made the build go through but the testing showed quite some problems. Even excluding the samples and the native APIs there are plenty of problems.
Please also note that freeBSD install to /usr/bin NOT to /usr/local/bin
Correction: freeBSD install to /usr/local/bin. OpenIndiana on the other hand install to /usr/bin
I have tried to run the tests on Net and OpenBSD and it segdumps. Running gdb backtrace shows on all crashes that Activity is NULL when it runs Activity::checkStackSpace, I have no clue why this happens.
I do not have Net or OpenBSD and there is no official build for any of them yet. I have experienced the segdumps to happen only the first time I run a new setup but it normally dissapears, if you have a reproducible scenario with segdumps maybe you can upload the tracefile and indicate the place where it happends maybe one of the developers can get something out of it.
Maybe add some basic info on the build as well (where is it installing, bitness etc)
We now have FreeBSD OpenBSD and OpenIndiana runnning on the Jenkins buildmachine.
Regarding the segfaults this is what I found out so far: OpenBSD is building just fine but testing is resulting in a segfault unless the "untick" option -U is used. By tracing I found out that the testing on OpenBSD can be made to run again with ticks disabled. I traced the culprit back to ooTest.frm. I think there is something wrong in in
::class 'PhaseReport'
somewhere around here, starting at line 2474
::method tickTock unguarded
The segfaults come back when the -U parameter is removed in the testing
The tickTock method claims to spawn a 2nd process, maybe this is critical on a multi-user multi-tasking (virtual) machine with only one core?
also Alarm.testGroup seems to provoke a segfault so I have excluded (-x) it for now.
I have just tested to run the tes suite on NetBSD and it does not segfault if I use the -U option. it does not finish though. it seems to not get past TIME.testGroup.
There have been problems like this in the past where the cause was in how
the classes in SysSemaphore.cpp were getting built. This caused the mutexes
to not work at all, so anything that used multiple threads would just
crash. I was never involved in troubleshooting these issues, so I don't
recall the specifics of the solution.
Rick
On Thu, May 13, 2021 at 5:37 AM Niclas Rosenvik nros@users.sourceforge.net
wrote:
Related
Bugs:
#1761I checked the DEFINEs in SysSemaphore - all are found
Running this TstConcurrencyCooperate.rex test where two threads switch back and forth works when I run at most two switches back/forth (other platforms than OpenBSD work fine, of course, with any number of switches)
When running three switches back/forth in the debugger, I get
So it seems that GUARD cannot find its WHEN variable any more.
Into what direction is this pointing?
(There are other issues I don't understand, but these may be just some side effects:
)
On Wed, May 26, 2021 at 12:05 PM Erich erich_st@users.sourceforge.net
wrote:
i've never seen anything like this before but the index value for used for
the variable name is NULL. I have no theories on how that might happen. I
still suspect a problem with the semaphores, but if GUARD instructions are
involved, it might be a problem with the event semaphores, not the mutexes.
Related
Bugs:
#1761I've taken a closer look at the stack trace and can see what is going on. The exception is caused by a null pointer used to add an object to an IdentityTable. The object in question should be the pointer to the current activity, from a call at line 130 in RexxVariable.cpp. This means that the field ActivityManager::currentActivity is NULL while there is active running Rexx code, something that should never happen.
The only way this could happen like this is for the semaphores that are used for thread dispatch to not be working correctly. Again, this points to the issue being a problem with how the semaphores are getting built for this platform.
Ok, I am having the same on OpenBSD. Add -x TIME.testGroup to the command line and run until it balks again and then add the testGroup it balks on that time after TIME.testGroup. I am installing NetBSD on a virtual machine right now but since I am a newbie on NetBSD and all the *nixes use different package handlers it will take some time. The normal install did not eve add a user so I am starting really from scratch here. Also have a look at #213 , I added some remarks there since this is most likely a bug on BSD that we cannot capture just yet.
@Nicklas: maybe we can take this off the list to save some bandwith? I have a dozen of questions on how to get NetBSD set up correctly. You can contact me on oorexx@jonases.se
Revision [r12269] adds an alternate code path using sysctl CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME to identify the currently running executable on BSDs without installed /proc/..
Though on the OpenBSD 6.9 on which we currently build, KERN_PROC_PATHNAME is undefined and thus also this alternative fails.
Related
Commit: [r12269]
We now have ooRexx building stably on FreeBSD OpenBSD and NetBSD, can we close this ticket?
There are still problems in the testing on the BSDs (segmentation faults), I would like to open a ticket for that, I think it is related to the way the threads (in the testing framework) are dispatched as Rick explains above.
From my perspective, yes.
The bugs concerning threads etc can also be in the respective OS it does not have to be oorexx fault.
Did the TstConcurrencyCooperate.rex issue mentioned above go away with a new OpenBSD installation?
I could run it successfully on all of our three BSDs
I will have a look 👀 next year
Von meinem iPhone gesendet
Related
Bugs:
#1761I have repeatedly tested on FreeBSD OpenBSD and NetBSD and the test passed everytime. Also from my point of view you can close this ticket.
FreeBSD
osboxes@osboxes:~ $ which rexx
/home/osboxes/workspace/ooRexx-FreeBSD-build/oorexxBuild/bin/rexx
osboxes@osboxes:~ $ rexx TstConcurrencyCooperate.rex
5000 back and forth task switches in 0.07 seconds, 67666 switches/sec
osboxes@osboxes:~ $ rexx TstConcurrencyCooperate.rex
5000 back and forth task switches in 0.13 seconds, 38030 switches/sec
osboxes@osboxes:~ $ rexx TstConcurrencyCooperate.rex
5000 back and forth task switches in 0.12 seconds, 41801 switches/sec
osboxes@osboxes:~ $ rexx TstConcurrencyCooperate.rex
5000 back and forth task switches in 0.08 seconds, 62723 switches/sec
osboxes@osboxes:~ $ rexx TstConcurrencyCooperate.rex
5000 back and forth task switches in 0.10 seconds, 50136 switches/sec
OpenBSD
OpenBSD7$ which rexx
/home/osboxes/workspace/ooRexx-OpenBSD-build/oorexxBuild/bin/rexx
OpenBSD7$ rexx TstConcurrencyCooperate.rex
5000 back and forth task switches in 0.36 seconds, 13879 switches/sec
OpenBSD7$ rexx TstConcurrencyCooperate.rex
5000 back and forth task switches in 0.41 seconds, 12119 switches/sec
OpenBSD7$ rexx TstConcurrencyCooperate.rex
5000 back and forth task switches in 0.39 seconds, 12949 switches/sec
OpenBSD7$ rexx TstConcurrencyCooperate.rex
5000 back and forth task switches in 0.41 seconds, 12100 switches/sec
OpenBSD7$ rexx TstConcurrencyCooperate.rex
5000 back and forth task switches in 0.37 seconds, 13573 switches/sec
OpenBSD7$ rexx TstConcurrencyCooperate.rex
5000 back and forth task switches in 0.41 seconds, 12074 switches/sec
OpenBSD7$
NetBSD
localhost$ which rexx
/home/osboxes/workspace/ooRexx-NetBSD-build/oorexxBuild/bin/rexx
localhost$ rexx TstConcurrencyCooperate.rex
5000 back and forth task switches in 0.06 seconds, 87679 switches/sec
localhost$ rexx TstConcurrencyCooperate.rex
5000 back and forth task switches in 0.05 seconds, 107416 switches/sec
localhost$ rexx TstConcurrencyCooperate.rex
5000 back and forth task switches in 0.05 seconds, 106803 switches/sec
localhost$ rexx TstConcurrencyCooperate.rex
5000 back and forth task switches in 0.05 seconds, 103016 switches/sec
localhost$ rexx TstConcurrencyCooperate.rex
5000 back and forth task switches in 0.05 seconds, 110495 switches/sec