swanss / peptide_design

This repository contains code for the paper: "Tertiary motifs as building blocks for the design of protein-binding peptides"
Other
15 stars 9 forks source link

Buffer overflow in Building sasaCalculator in run_generateSeeds.sh #5

Closed blacktanktop closed 2 years ago

blacktanktop commented 2 years ago

Thank you for uploading singlechain_22188_sim30_STRIDE.db.

I ran the pipeline run_generateSeeds.sh using singlechain_22188_sim30_STRIDE.db. So, I got the standard output "Building sasaCalculator..." and then buffer overflow detected " and it exits.

Is this a problem with FreeSASA?

Actually, I am concerned that if I configure FreeSASA as --disable-threads as in the README, configure it, compile it, and then run it, I get the following.

% freesasa tests/data/1a0q.pdb
FreeSASA:sasa_lr.c:178: error: L&R does not support more than 1 threads
FreeSASA:freesasa.c:172: error:
FreeSASA:freesasa.c:176: error:
freesasa: error: can't calculate SASA

run_generateSeeds.sh output

sh ./run_generateSeeds.sh                 

TERM Extension Parameters
cd_threshold 0.01
cdSeqConst_threshold 1
int_threshold 0.01
bbInteraction_cutoff 3.5
max_rmsd 1.2
flanking_res 3
match_req 5000
adaptive_rmsd 0
seq_const 0
config_file ../input_files/singlechainDB.configfile
seed_flanking_res 2
homology_cutoff 0.5
verbose 1
Select residues with freedom above the threshold: 0
The following residues were selected for TERM Extension: A347 A348 A349 A350 A351 A352 A353 A354 A355 A356 A357 A358 A359 A360 A361 A362 A363 A364 A365 A366 A367 A368 A369 A370 A371 A372 A373 A374 A375 A376 A377 A378 A379 A380 A381 A382 A383 A384 A385 A386 A387 A388 A389 A390 A391 A392 A393 A394 A395 A396 A397 A398 A399 A400 A401 A402 A403 A404 A405 A406 A407 A408 A409 A410 A411 A412 A413 A414 A415 A416 A417 A418 A419 A420 A421 A422 A423 A424 A425 A426 A427 A428 A429 A430 A431 A432 A433 A434 A435 A436 A437 A438 A439 A440 A441 A442 A443 A444 A445 A446 A447 A448 A449 A450 A451 A452 A453 A454 A455 A456 A457 A458 A459 A460 A461 A462 A463 A464 A465 A466 A467 A468 A469 A470 A471 A472 A473 A474 A475 A476 A477 A478 A479 A480 A481 A482 A483 A484 A485 A486 A487 A488 A489 A490 A491 A492 A493 A494 A495 A496 A497 A498 A499 A500 A501
Reading FASST database...
Reading the database took 86 s...
Checking which properties are populated...
Residue pair property: cont = 1
Residue pair property: interfering = 1
Residue pair property: interfered = 1
Residue pair property: bb = 1
Set the AAToSeqContProp map
key: ARG, value: contARG
key: ASN, value: contASN
key: ASP, value: contASP
key: CYS, value: contCYS
key: GLN, value: contGLN
key: GLU, value: contGLU
key: HIS, value: contHIS
key: ILE, value: contILE
key: LEU, value: contLEU
key: LYS, value: contLYS
key: MET, value: contMET
key: PHE, value: contPHE
key: SER, value: contSER
key: THR, value: contTHR
key: TRP, value: contTRP
key: TYR, value: contTYR
key: VAL, value: contVAL
key: ALA, value: contALA
155 residues selected. Setting target structure...
Extracting target backbone to construct a promixity search object...
Building sasaCalculator...
*** buffer overflow detected ***: terminated
Aborted
Elapsed: 0hrs 0min 0sec
swanss commented 2 years ago

I suspect that this isn't a problem with FreeSASA. When I try to run freesasa after compiling with --disable-threads, I get the same error you do, but when I run generateSeeds (which is built using the freesasa library), it works just fine.

It's likely that this is an issue with converting the MST Structure object into a FreeSASA Structure object. Can you please send the stack trace from the core file that should have been generated when the program exited?

swanss commented 2 years ago

I fixed a bug in one of the functions that is called when constructing the FreeSASA structure object. I suspect this was causing the buffer overflow, which is not being reported on my system.

Let me know if this fixes your issue. And in general, sorry for the hassle, you're the first person outside of our lab to run this in a new computing environment. I appreciate you bringing the problems to my attention.

blacktanktop commented 2 years ago

Thank you for updating. I am new to c++ and did not know how to use gdb and could not trace the core, but when I updated the code, the error that had occurred before was no longer there, and it probably completed successfully (It took roughly an hour and a half.) and output extendedfragments.bin and other files.

The last few lines of the stdout are shown below

Fragment 1LB6_A__-A500--3 generated 5481 extended fragments!
Extending fragment: 1LB6_A__-A501--3
matches size: 4999 match req: 5000
Fragment 1LB6_A__-A501--3 generated 1671 extended fragments!
Seed creation took 907 s
907 seconds to generate seeds
Writing fragment pdbs...
Done
Elapsed: 0hrs 0min 0sec

I will continue to run findOverlaps in the pipeline.

swanss commented 2 years ago

Great! I'm going to close this issue, but will be available in case other issues arise.