Skip to content

Fix memtester compilation failure with latest gcc-15#3169

Open
Pavithra1602 wants to merge 1 commit into
avocado-framework-tests:masterfrom
Pavithra1602:memtester_fix
Open

Fix memtester compilation failure with latest gcc-15#3169
Pavithra1602 wants to merge 1 commit into
avocado-framework-tests:masterfrom
Pavithra1602:memtester_fix

Conversation

@Pavithra1602

Copy link
Copy Markdown
Contributor

memtester testsuite compilation is failing on latest distros with gcc-15, modified code to use gcc-13 for memtester if default gcc version is 15 or higher and revert it back.

Comment thread memory/memtester.py Outdated
try:
shutil.copy2(gcc_path, self.gcc_backup_path)
self.log.info(f"Backed up {gcc_path} to {self.gcc_backup_path}")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you please remove inconsistent blank line across the code

@Pavithra1602

Copy link
Copy Markdown
Contributor Author

Removed blank lines

Comment thread memory/memtester.py Outdated
self.cancel('gcc-13 is required but could not be installed')
if not os.path.exists(gcc13_path):
self.cancel('gcc-13 package installed but binary not found at /usr/bin/gcc-13')
gcc_path = '/usr/bin/gcc'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is just a sym-link

Comment thread memory/memtester.py Outdated
gcc_path = '/usr/bin/gcc'
self.gcc_backup_path = '/usr/bin/gcc.backup.memtester'
try:
shutil.copy2(gcc_path, self.gcc_backup_path)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of copy, can't we point gcc to gcc-13 using ln ?

Comment thread memory/memtester.py Outdated
for pkg in ['gcc', 'make']:
if not smm.check_installed(pkg) and not smm.install(pkg):
self.cancel('%s is needed for the test to be run' % pkg)
self.gcc_backup_path = None

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IS this problem across releases? If not can we restrict this code block for a specific affected release?

@Pavithra1602 Pavithra1602 force-pushed the memtester_fix branch 2 times, most recently from 0150e75 to 653b00a Compare June 6, 2026 13:11
@Pavithra1602

Copy link
Copy Markdown
Contributor Author

Added patch to fix compilation issues with latest gcc15. Test runs fine even with older gcc.

@Pavithra1602 Pavithra1602 changed the title Fix memtester to use gcc-13 if default gcc is gcc-15. Fix memtester compilation failure with latest gcc-15 Jun 6, 2026
@Pavithra1602

Copy link
Copy Markdown
Contributor Author

/usr/local/lib/python3.13/site-packages/avocado/core/init.py:18: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81.
import pkg_resources
Fetching asset from memtester.py:Memtester.test
JOB ID : ba142183bacdfd06b9b1fad1f5bdba95cf103566
JOB LOG : /home/avocado-fvt-wrapper/results/job-2026-06-06T15.05-ba14218/job.log
(1/1) memtester.py:Memtester.test: STARTED
(1/1) memtester.py:Memtester.test: PASS (51312.80 s)
RESULTS : PASS 1 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 0
JOB HTML : /home/avocado-fvt-wrapper/results/job-2026-06-06T15.05-ba14218/results.html
JOB TIME : 51327.13 s

@PraveenPenguin PraveenPenguin requested a review from sacsant June 17, 2026 04:01
char *name;
- int (*fp)();
+ int (*fp)(ulv *bufa, ulv *bufb, size_t count);
};

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume the latest memtester source contains code that uses updated function signatures.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Sachin

yes, while calling the functions arguments are passed but during declaration arguments were not explicitly declared.

Comment thread memory/memtester.py Outdated
process.run(memtester_patch, shell=True)
self.log.info("Applied memtester patch to fix GCC 15+ compilation issues")
except Exception as e:
self.log.warning(f"Failed to apply memtester patch: {e}")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is warning sufficient? If the patching fails, compilation of code with gcc-15 will fail. Should this be marked as failed or cancel out if gcc-15 is detected?

memtester testsuite compilation is failing on latest distros with
gcc-15, modified code to apply patch to fix this compilation issue.

Signed-off-by: Pavithra <pavrampu@linux.ibm.com>
@Pavithra1602

Copy link
Copy Markdown
Contributor Author

Addressed review comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants