-
Notifications
You must be signed in to change notification settings - Fork 19
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
Segmentation fault in cutest_cigr_r_ #63
Comments
No issues here, @amontoison runcutest -p test -sp -D ALLINITA Problem name: ALLINITA Single precision version will be formed The objective function uses 2 linear groups There is 1 linear equality constraint There is 1 free variable File successfully decoded This problem is constrained CALL CUTEST_cdimen
CALL CUTEST_cigr for the objective function
.... CALL CUTEST_cigr for a constraint
... Call CUTEST_cterminate Sound like it might be related to your libALLINITA_single.so ? In particular, it seems to be the call to group_s that you are providing usied in this library. Can you get line numbers here? Of course these are fortran tests. Perhaps one of you should produce equivalent tests for the C interfaces? That would be a good sanity check, and is definitely missing at the moment. It needs to match the functionality of utest.F90 and ctest.f90 in src/test/ |
The line number in Good idea for the C interface. |
LIne 19 is IGRTYP = ITYPEG(IGROUP), so either ITYPEG is not being set or IGROUP is outside the |
I have a violation of memory on Windows so maybe |
OK, I would |
The content of SUBROUTINE GROUP_s( GVALUE, LGVALU, FVALUE, GPVALU, NCALCG,
* ITYPEG, ISTGPA, ICALCG, LTYPEG, LSTGPA,
* LCALCG, LFVALU, LGPVLU, DERIVS, IGSTAT )
INTEGER LGVALU, NCALCG, LTYPEG, LSTGPA
INTEGER LCALCG, LFVALU, LGPVLU, IGSTAT
LOGICAL DERIVS
INTEGER ITYPEG(LTYPEG), ISTGPA(LSTGPA), ICALCG(LCALCG)
REAL GVALUE(LGVALU,3), FVALUE(LFVALU), GPVALU(LGPVLU)
C
C Problem name : ALLINITA
C
C -- produced by SIFdecode 2.6.0
C
INTEGER IGRTYP, IGROUP, IPSTRT, JCALCG
REAL GVAR
IGSTAT = 0
DO 2 JCALCG = 1, NCALCG
IGROUP = ICALCG(JCALCG)
IGRTYP = ITYPEG(IGROUP)
IF ( IGRTYP == 0 ) GO TO 2
IPSTRT = ISTGPA(IGROUP) - 1
C
C Group type : L2
C
GVAR = FVALUE(IGROUP)
IF ( .NOT. DERIVS ) THEN
GVALUE(IGROUP,1)= GVAR * GVAR
ELSE
GVALUE(IGROUP,2)= GVAR + GVAR
GVALUE(IGROUP,3)= 2.0
END IF
2 CONTINUE
RETURN
END |
Yes, so add the lines I just suggested to this code before you compile it Remember to indent to column 7 though, it is fortran 77 (old form) so columns 1-6 are used for labels, etc |
ltypeg = 16
itypeg = 0 0 0 0 0 0 1 1 1 1 1 1 0 0 0 0
igroup = 1
igroup = 2
igroup = 3
igroup = 4
igroup = 5
igroup = 6
igroup = 7
igroup = 8
igroup = 9
igroup = 10
igroup = 11
igroup = 12
ltypeg = 16
itypeg = 0 0 0 0 0 0 1 1 1 1 1 1 0 0 0 0
igroup = 1
igroup = 2
igroup = 3
igroup = 4
igroup = 5
igroup = 6
igroup = 7
igroup = 8
igroup = 9
igroup = 10
igroup = 11
igroup = 12
ltypeg = 16
itypeg = 0 0 0 0 0 0 1 1 1 1 1 1 0 0 0 0
igroup = 1
igroup = 2
igroup = 3
igroup = 4
igroup = 5
igroup = 6
igroup = 7
igroup = 8
igroup = 9
igroup = 10
igroup = 11
igroup = 12
ltypeg = 16
itypeg = 0 0 0 0 0 0 1 1 1 1 1 1 0 0 0 0
igroup = 1
igroup = 2
igroup = 3
igroup = 4
igroup = 5
igroup = 6
igroup = 7
igroup = 8
igroup = 9
igroup = 10
igroup = 11
igroup = 12
igroup = 50033768
[7514] signal (11.1): Erreur de segmentation
in expression starting at /home/alexis/Bureau/git/CUTEst.jl/test/multiple_precision.jl:19
group_s at /home/alexis/Bureau/git/CUTEst.jl/deps/files/GROUP_s.f:22
cutest_cigr_threadsafe_s at /home/alexis/Applications/CUTEst/builddir/../src/tools/cigr.F90:426
cutest_cigr_s at /home/alexis/Applications/CUTEst/builddir/../src/tools/cigr.F90:37
cutest_cigr_s_ at /home/alexis/Bureau/git/CUTEst.jl/src/libcutest.jl:925
cigr at /home/alexis/Bureau/git/CUTEst.jl/src/core_interface.jl:3055 ltypeg = 16
itypeg = 0 0 0 0 0 0 1 1 1 1 1 1 0 0 0 0
igroup = 1
igroup = 2
igroup = 3
igroup = 4
igroup = 5
igroup = 6
igroup = 7
igroup = 8
igroup = 9
igroup = 10
igroup = 11
igroup = 12
ltypeg = 16
itypeg = 0 0 0 0 0 0 1 1 1 1 1 1 0 0 0 0
igroup = 1
igroup = 2
igroup = 3
igroup = 4
igroup = 5
igroup = 6
igroup = 7
igroup = 8
igroup = 9
igroup = 10
igroup = 11
igroup = 12
ltypeg = 16
itypeg = 0 0 0 0 0 0 1 1 1 1 1 1 0 0 0 0
igroup = 1
igroup = 2
igroup = 3
igroup = 4
igroup = 5
igroup = 6
igroup = 7
igroup = 8
igroup = 9
igroup = 10
igroup = 11
igroup = 12
ltypeg = 16
itypeg = 0 0 0 0 0 0 1 1 1 1 1 1 0 0 0 0
igroup = 1
igroup = 2
igroup = 3
igroup = 4
igroup = 5
igroup = 6
igroup = 7
igroup = 8
igroup = 9
igroup = 10
igroup = 11
igroup = 12
igroup = 233881008 |
right, more writes needed. Before loop |
(also, what cutest routines are you calling and in what order. This is going wrong on the 4th call to group as far as I can tell) |
lcalcg, ncalcg = 16 12
icalcg 1 2 3 4 5 6 7 8 9 10 11 12 1660348536 32759 30038672 0
ltypeg = 16
itypeg = 0 0 0 0 0 0 1 1 1 1 1 1 0 0 0 0
igroup = 1
igroup = 2
igroup = 3
igroup = 4
igroup = 5
igroup = 6
igroup = 7
igroup = 8
igroup = 9
igroup = 10
igroup = 11
igroup = 12 lcalcg, ncalcg = 16 12
icalcg 1 2 3 4 5 6 7 8 9 10 11 12 1660348536 32759 30038672 0
ltypeg = 16
itypeg = 0 0 0 0 0 0 1 1 1 1 1 1 0 0 0 0
igroup = 1
igroup = 2
igroup = 3
igroup = 4
igroup = 5
igroup = 6
igroup = 7
igroup = 8
igroup = 9
igroup = 10
igroup = 11
igroup = 12 lcalcg, ncalcg = 16 12
icalcg 1 2 3 4 5 6 7 8 9 10 11 12 1660348536 32759 30038672 0
ltypeg = 16
itypeg = 0 0 0 0 0 0 1 1 1 1 1 1 0 0 0 0
igroup = 1
igroup = 2
igroup = 3
igroup = 4
igroup = 5
igroup = 6
igroup = 7
igroup = 8
igroup = 9
igroup = 10
igroup = 11
igroup = 12 lcalcg, ncalcg = 16 16
icalcg 1 2 3 4 5 6 7 8 9 10 11 12 1660348536 32759 30038672 0
ltypeg = 16
itypeg = 0 0 0 0 0 0 1 1 1 1 1 1 0 0 0 0
igroup = 1
igroup = 2
igroup = 3
igroup = 4
igroup = 5
igroup = 6
igroup = 7
igroup = 8
igroup = 9
igroup = 10
igroup = 11
igroup = 12
igroup = 1660348536 |
The routines that I'm calling are:
|
Thank you. One further question, what is iprob here? |
|
Nick, I get the same error if I don't call |
OK, this doesn't make sense. The array kndofc that should be imported and adjusted in csetup - you are calling this aren't you, not usetup - says which of the groups are objectives and which aren't. For the ALLINITA example, I get |
I confirm that I'm calling I use Ubuntu 22.04 with gfortran v11.4 on my laptop so it's also linuxland here. |
OK, can you edit cigr.f90, and print out the values of the array data%KNDOFC( : ) just after the else on line 365 (before the loop that calculates ncalcg) |
Oh no, I now see the bug. The second call to GROUP_r is using data%ng = 16 not ncalcg = 12. I thought I fixed this before! Presumably on my linux, the later array weren't filled with junk, so the bug didn't show. I fixed this in cisgr a while ago. Fix on its way ... |
Committed. Well found |
Nick, you pushed a few files but not |
Yup, that's the trouble with working on a public holiday, my brain is on the beach! |
A last question before that I close the issue.
I didn't find a routine to just evaluate all constraints (without the objective) that takes as input the vector |
Sorry for that! I need to finish my boxes for Chicago after so I will not annoy you anymore for today ;) |
You could also try ccfsg with grad = false and lj = 0. |
Maybe there could be a ccf function, but as I said before, every function we add takes a day+ to write all the tests, documentation and interfaces. My usual fee is a very reasonable $2000 |
No worries! The fix is in release 2.2.4. I can close the issue. |
I wanted to use
cifn
andcigr
in the Julia interfaceCUTEst.jl
but I have segmentation faults when I callcigr
.All my CI builds on Linux and Windows failed.
I compiled CUTEst in debug mode to reproduce the error and I have the following stack-trace:
The issue seems to be in
cigr.F90
at line426
.Ref JuliaSmoothOptimizers/CUTEst.jl#375
The text was updated successfully, but these errors were encountered: