#73 patch for very tricky bug

open
nobody
None
1
2014-03-12
2014-03-12
No

This problems occures at least in v3.3.a (git)

If "module use /some/path" is used in a module and ModulePathVec capacity is full, then uvec_increase is called.
Unfortunately, ModulePath that is initialized in main.c at the beginning of modulecmd is not updated and still points to the old ModulePathVec.vector value.
thus in locate_module.c:205, pathlist is assigned to a deprecated pointer and a segfault occures at line 209.

My Path removes the global value ModulePath and uses instead uvec_vector(ModulePathVec). (patched all .c and .h). By that way, we are sure that we work on the correct ModulePathVec.vector value. the overhead is not dramatic as the pointer is read before a loop when used in a loop.

If you don't like my patch, then another aproach (that I find ugly) would be to update the global ModulePath pointer in uvec.c:uvec_inclrease() and uvec.c:uvec_decrease() (and maybe in other uvec.c functions where ModulePathVec.vector is updated).

1 Attachments

Discussion

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks