Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid GC problem in Cyclotomic #2313

Merged
merged 1 commit into from
Mar 28, 2018

Conversation

ChrisJefferson
Copy link
Contributor

DIFF can cause a GC, which might move ResultCyc

Found using 'memory canary'.

This should also be cherry-picked onto 4.9.

@ChrisJefferson ChrisJefferson added kind: bug: crash Issues describing bugs that cause GAP to crash, and PRs fixing them (used for release notes) release notes: not needed PRs introducing changes that are wholly irrelevant to the release notes backport-to-4.9 labels Mar 27, 2018
@fingolfin fingolfin added this to the GAP 4.9.1 milestone Mar 27, 2018
@@ -688,7 +688,9 @@ Obj Cyclotomic (
res[0] = cof;
else {
CHANGED_BAG( ResultCyc );
res[0] = DIFF( INTOBJ_INT(0), cof );
Obj negcof = DIFF( INTOBJ_INT(0), cof );
Copy link
Member

Choose a reason for hiding this comment

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

I am happy to merge this, though you might want to change this to Obj negcof = AInvInt(cof);.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No I can't, because cof can be a rational :) (seperate note, some int related functions could produce more helpful errors when given non integres)

Copy link
Member

Choose a reason for hiding this comment

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

Ah, sorry for the red herring

Copy link
Member

Choose a reason for hiding this comment

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

(Actually, I have a déjà-vu ... didn't we discuss the exact same thing at the same spot before?)

DIFF can cause a GC, which might move ResultCyc
@codecov
Copy link

codecov bot commented Mar 27, 2018

Codecov Report

Merging #2313 into master will decrease coverage by 0.02%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master    #2313      +/-   ##
==========================================
- Coverage   72.33%   72.31%   -0.03%     
==========================================
  Files         479      479              
  Lines      250960   251946     +986     
==========================================
+ Hits       181538   182185     +647     
- Misses      69422    69761     +339
Impacted Files Coverage Δ
src/cyclotom.c 94.52% <100%> (+0.01%) ⬆️
hpcgap/lib/hpc/queue.g 66.4% <0%> (-3.2%) ⬇️
src/hpc/traverse.c 95.75% <0%> (-0.59%) ⬇️
src/blister.h 85.06% <0%> (-0.53%) ⬇️
hpcgap/lib/hpc/stdtasks.g 38.61% <0%> (-0.26%) ⬇️
src/opers.c 92.02% <0%> (-0.13%) ⬇️
src/system.h 100% <0%> (ø) ⬆️
src/stringobj.h 100% <0%> (ø) ⬆️
src/hpc/threadapi.c 37.42% <0%> (ø) ⬆️
lib/grpfp.gi 65.12% <0%> (+0.03%) ⬆️

@fingolfin fingolfin merged commit ad6d758 into gap-system:master Mar 28, 2018
@fingolfin fingolfin added release notes: added PRs introducing changes that have since been mentioned in the release notes and removed release notes: not needed PRs introducing changes that are wholly irrelevant to the release notes labels Mar 28, 2018
@fingolfin
Copy link
Member

Backported to stable-4.9 as 01b3b13

@ChrisJefferson ChrisJefferson deleted the cyclotom-fix branch March 28, 2018 22:23
@fingolfin fingolfin added the kind: bug Issues describing general bugs, and PRs fixing them label Mar 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: bug: crash Issues describing bugs that cause GAP to crash, and PRs fixing them (used for release notes) kind: bug Issues describing general bugs, and PRs fixing them release notes: added PRs introducing changes that have since been mentioned in the release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants