Commit Graph

2310 Commits

Author SHA1 Message Date
Darryl L. Miles b7dd2f0e9c GHA: appimage9: Add support for EL9 2025-07-26 17:29:19 -04:00
Darryl L. Miles c5e0165e5e GHA: appimage8: Add support for EL8 2025-07-26 17:29:19 -04:00
Darryl L. Miles b9296074b2 GHA: appimage7: fixup relocated files 2025-07-26 17:29:19 -04:00
Darryl L. Miles 96b89a53b7 GHA: appimage7: appimage/* => appimage/7/* (relocate EL7) 2025-07-26 17:29:19 -04:00
Darryl L. Miles 6c952f98eb GHA: appimage7: Maintenance update
Upgrade Tcl to 8.6.16
Use versioning to include tag, indication of timestamp and git hash.
Rename to include '7' in the labeling (as it is EL7 based)
Improve log output to keep information about versions used.
Update README.md a little.
2025-07-26 17:29:19 -04:00
Darryl L. Miles ea5f1ed3f1 tiles/tile.h: Remove unused inlines breaking older GCC
This was breaking on older GCCs (such as GCC 4.8.x used for
AppImage with CentOS7).
2025-07-26 17:29:19 -04:00
Darryl L. Miles 66e72c748a CIFParsePath() prototype change to simply return of created data
Previously this was returning two values, a 'bool' and a data
structure that is created.  Now it simply returns the data
structure which makes it easier to reason about who takes
ownership of the memory and when, also that no address-of can
be supplied that has any side-effect that interacts with how
the method works / the returned result.

-extern bool CIFParsePath(CIFPath **pathheadpp, int iscale);
+extern CIFPath *CIFParsePath(int iscale);

Previous related comments:

Easier to reason about, there can be no interaction from *pathheadpp
and the various functions called, which maybe the first concern to
the next reader as visibility of new data is limited to that of a
local variable of the function.
2025-06-26 16:09:43 +01:00
R. Timothy Edwards eb81da6c56 Updated the version to go along with pull request #406 from Darryl
Miles (updates for github actions).
2025-06-19 09:55:57 -04:00
Darryl L. Miles ab73c716a4 GHA: main.yml (move to ubuntu-22.04) 2025-06-17 16:35:34 +01:00
Darryl L. Miles f947543fe3 GHA: canary-matrix.yml: remove sunseted ubuntu-20.04 runner 2025-06-17 16:35:27 +01:00
Darryl L. Miles 9551167e10 GHA: canary-matrix.yml: use set -o pipefail 2025-06-17 16:35:24 +01:00
Darryl L. Miles 5e32174dbb GHA: appimage.yml (move to ubuntu-latest) 2025-06-17 16:17:29 +01:00
R. Timothy Edwards 490fc6f9d7 Added a quick hack solution from Darryl Miles to prevent the
database corruption discovered recently that was uncovered by a
commit on Jan. 31 and is caused by DBMergeNMTiles0() using a
freed tile (reported in github issue #404).
2025-06-12 19:54:33 -04:00
R. Timothy Edwards 5ecc55b37d Added some alternative key bindings to the keypad for "stretch"
commands, because the keypad numerical values no longer work
regardless of the setting of Num Lock.  The keypad arrow keys
alone implement "move", while Shift + keypad arrow keys
implement "stretch".
2025-05-22 08:47:03 -04:00
R. Timothy Edwards f1f4b82a30 Corrected an error caused by extending the parsing of the FOREIGN
keyword in LEF.  FOREIGN may take an origin offset, but it is
optional.  The routine to check that there were no offset values
in the statement incorrectly checked for a NULL token instead of
a value ";" which would indicate an end-of-statement.
2025-05-16 19:36:16 -04:00
R. Timothy Edwards 02669de267 Updated the version number to go along with a bunch of pull request
merges for PRs by Darryl Miles.
2025-04-09 15:27:18 -04:00
Darryl L. Miles 31400dd45f plotPNM.c: Fix crash due to uninited rtl_args.outfile
I introduced this issue in recent commit e88dcba1c
2025-04-09 15:26:54 -04:00
Darryl L. Miles e592122199 ASSERT fixes (typo in variable and bad integer casting)
routerLayer => routeLayer (my typo from a recent commit, compile fix)
MINFINITY compiler warning
2025-04-09 15:26:06 -04:00
Darryl L. Miles 44bb9327a2 ExtTech.c: fix uninitialized exts_linearResist value leaks into extresist
This value appears to be initialised at only one spot in the codebase
(under very narrow conditions) but extresist will read it and make
branching decisions based on the uninitialised state.

This 'X' state propagation appears to eventually get processed in
ResWriteExtFile() near where final output formatting is occurring.

It is unclear (at this time) if it perturbs output values in a
problematic way, or if due to algorithmic reasons the data is
discarded before output anyway.  I have at least one trace run (with
multiple triggers) of printf formatters handling uninitialised data
in ResWriteExtFile().
2025-04-09 15:25:02 -04:00
Darryl L. Miles 2c9e3a558d git rm SimSelect.c.new (was this always here?) 2025-04-09 15:23:21 -04:00
Darryl L. Miles 739f0f27fe sim: DBCellSrArea() cb_database_cellsrarea_t SimCellTileSrFunc() 2025-04-09 15:23:21 -04:00
Darryl L. Miles 56bdf9ce28 sim: DBSrPaintArea() cb_database_srpaintarea_t SimSelectFunc() 2025-04-09 15:23:21 -04:00
Darryl L. Miles dceb5cfad7 database.h.in: dbSrConnectFunc()/dbSrConnectStartFunc() add public prototype 2025-04-09 15:23:21 -04:00
Darryl L. Miles ef123be806 database.h.in: dbcUnconnectFunc() add public prototype 2025-04-09 15:23:21 -04:00
Darryl L. Miles fa1f1583df database: DBPrintUseId() K&R removal 2025-04-09 15:23:21 -04:00
Darryl L. Miles cface55c5b sim: various cleanups (non existent funcs) 2025-04-09 15:23:21 -04:00
Darryl L. Miles 67f7db9540 sim: remove declaration for getenv() 2025-04-09 15:23:21 -04:00
Darryl L. Miles b5ac7e4f92 sim: use pid_t where appropiate 2025-04-09 15:23:21 -04:00
Darryl L. Miles 559eb94f3e sim: use 'const' with 'sccsid' 2025-04-09 15:23:21 -04:00
Darryl L. Miles ef79d33dd4 database.h.in constify various TileTypeBitMask* data usages 2025-04-09 15:23:21 -04:00
Darryl L. Miles 6ec826fb8b sim: constify various APIs 2025-04-09 15:23:21 -04:00
Darryl L. Miles 1fbba4408f K&R sim/*.c: bulk function implementation conversion
K&R obsolete syntax removal for C23 compatibility series
2025-04-09 15:23:21 -04:00
Darryl L. Miles b3384f9104 K&R sim.h: conversion to ANSI
K&R obsolete syntax removal for C23 compatibility series
2025-04-09 15:23:21 -04:00
Darryl L. Miles be09d8d402 SimRsim.c: update with const API change to utils module 2025-04-09 15:23:21 -04:00
Darryl L. Miles 120cea3921 SimRsim.c: remove declaration SimGetReplyLine() as it is in sim.h 2025-04-09 15:23:21 -04:00
Darryl L. Miles 10f82355f5 txCommands.c TxGetInputEvent() rework main loop to iterate less
Original version would iterate exhaustively, even when it was not
necessary.

This version seeks to do the minimum amount of iteration work based
on the information available.
2025-04-09 15:19:25 -04:00
Darryl L. Miles 3c3ebcfd2b txCommands.c txInputDevRec FD select() usage overhaul
There are numerous concerns with the original code from a read through.

The #define TX_MAX_OPEN_FILES 20 is badly named, the txCommand.c uses
fd_set to hold active FD for each device, and makes no attempt to bounds
check the 'fd' or 'fd_set' of any TxAdd1InputDevice() is in range.

The real name of this variable should be TX_MAX_INPUT_DEVICES as it
related to the fixed compile time slots available for devices, each input
device must have at least one active FD and it can be in the range
that fd_set allows, which is 0..1023 on linux.

So based on this being the original intention, due to the way the code is
constructed and API calls made available, the file has been reworked
to allow all these considerations at the same time.

Now the design should be FD clean for FDs in the range 0..1023 instead of
being artificially clamped to the first 20 FDs being valid input devices.

Renaming of variable 'i' to 'fd' when it relates to an fd number, so all
uses of FD_XXXX() should use fd, this helps clarify the different domain
the number relates to.
When 'i' is used it relates to the index into the txInputDevRec array.
A large part of the concerns relate to trying to mix the two numbering
domains interchangeably, just using a different name really clears up
understanding to the reader.

Other items that look like errors TxDelete1InputDevice() will
shuffle-remove entries with no active FD, but it is iterating an array
it is also modifying, so it looks like it would have incorrectly skipped
the next item that should be inspected just after a shuffle-removal
occurred.

The various iterators that works from 0..TX_MAX_OPEN_FILES incorrectly
limited the visibility of the routines to the first 20 FDs instead of
the full FD_SETSIZE the TxAddInputDevice API call allows to be
registered.

Passing in TxAdd1InputDevice with an fd above 19 would have resulted in
everything looking successful until select() was used, then the kernel
would likely not sleep/wait because the input fd_set would look blank due
to being clipped by nfds=TX_MAX_OPEN_FILES (instead of that plus 1).

The use of TX_MAX_OPEN_FILES in select instead of TX_MAX_OPEN_FILES+1 for
the 'nfds' field would have meant a device with fd=19 would not work as
the design intended.

The define definition has been removed from the module public header,
I assume it was there for use by another module, but the incorrect
select() usage has been corrected over there in a previous commit.
So now the define can be maintained near the array it relates to.

While the code might looks less 'efficient' as it is now sweeping all
1024 FDs when input devices during add/remove (hopefully there maybe some
compiler auto-vectorization/tzcnt use there).  The main event loop is
slightly more 'efficient' (especially for the single device with input
fd=0 case) as it will only check the 1 FD each input event loop iteration,
not check all 20 FDs for data readyness everytime.
2025-04-09 15:19:25 -04:00
Darryl L. Miles 6d2d4353d3 select() API usages add ASSERT() to validate fd number is in-range
This encapsulates the expectation the 'fd' is in the permitted range for
the standard sizes 'fd_set'.

This is so there is some form of detection with issues in this area, if
the RLIMIT_NOFILE limit is increased.
2025-04-09 15:19:25 -04:00
Darryl L. Miles 8d6571066d grMain.c select() usage fix and protect from higher numbered fd's
The old code would only work is the fileno(stream) returned an fd
in the range 0 <= 19.  It would silently fail, if the fd was in
the range 20..1023 because FD_SET() would work and syscall select()
would be limited to only look at the first 20 fd's.  Ignoring any
fd's higher even if set.
This would theoretically cause high CPU usage due to select()
never blocking because there are no active fd's in the fd_set
as far as the kernel interprets the request and the kernel would
immediately return.

But reading the code the 1st argument to select() seems self
limiting for no good reason.  It should be fileno(stream)+1 as
documented in man select(2).

Added the assertion as well, because we are trying to allow magic
to use fd's beyond the standard environmental limits.  So it
becomes an assertion condition if the fd is outside the range
0..1023 because the FD_SET() macro will not operate correctly /
undefined-behaviour.

I can't find any user of this func in the codebase right now.

If you look at sim/SimRsim.c and the use of select() there, it is
correctly using select() to wait on a single fd over there.  This
commit changes this code to match this correct usage.
2025-04-09 15:19:25 -04:00
Darryl L. Miles bcd81c74b2 tclmagic.c: RLIMIT_NOFILE to 4096 on startup (only for TCL9 envs) 2025-04-09 15:19:25 -04:00
Darryl L. Miles f5f59846da configure: autoconf regen (2.69) getrlimit setrlimit sys/resource.h 2025-04-09 15:19:25 -04:00
Darryl L. Miles c676c6b1d3 configure.in: getrlimit setrlimit sys/resource.h 2025-04-09 15:19:25 -04:00
Darryl L. Miles 61e4e155ec ext2sim.c: remove unused mergeAttr()
If this is ever restored please audit the implementation as it does
not look sound.
2025-04-09 15:11:48 -04:00
Darryl L. Miles e7c46102d6 ext2spice: mergeAttr() fix, leak removal and restore original intention 2025-04-09 15:11:48 -04:00
Darryl L. Miles b3617f603d extract: DBSrCellPlaneArea() cb_database_srcellplanearea_t extContainsCellFunc() 2025-04-09 15:07:28 -04:00
Darryl L. Miles 321b2d61c7 extract: DBSrCellPlaneArea() const Rect * arg2 2025-04-09 15:07:28 -04:00
Darryl L. Miles 5c8510355f extract: DBSrCellPlaneArea() cb_database_srcellplanearea_t extContainsCellFunc 2025-04-09 15:07:28 -04:00
Darryl L. Miles 5b03081d03 cif: TiPlaneRect const ripple 2025-04-09 15:07:28 -04:00
Darryl L. Miles 16efabe9ee calma: TiPlaneRect const ripple 2025-04-09 15:07:28 -04:00
Darryl L. Miles 00b479301f tiles: TiPlaneRect const ripple 2025-04-09 15:07:28 -04:00