[opensuse] c - Segmentation fault on 11.4 - need help figuring out (strtod?)
Guys, Helping my son with a simple little area program, I am running into a segmentation fault after program execution. It seems to be with the strtod conversion, but I can't figure out why. It compiles without issue and executes fine, but then I get a Segmentation Fault error after the program ends. The code is: #include <stdio.h> #include <stdlib.h> #include <math.h> int main (int argc, char *argv[]) { if (argc < 2) { fprintf(stderr, "\nERROR: Usage: %s radius list\n", argv[0]); fprintf(stderr, "\n example: %s 4 16 21 8 for area calculations\n\n", argv[0]); exit (1); } char *p; int i; double rad; double area; for (i=1;i<=argc;i++) { rad = strtod(argv[i],&p); area = M_PI*rad*rad; printf(" rad : %5.2f area : %10.4f\n", rad, area); } return 0; } It compiles without error on 11.4 (x86_64) with: gcc -Wall ztst.c -o ztst It seems to run fine: 13:22 alchemy:~/dev/prg/ccpp/src-c/misc> ./ztst 1 2 3 4 rad : 1.00 area : 3.1416 rad : 2.00 area : 12.5664 rad : 3.00 area : 28.2743 rad : 4.00 area : 50.2655 Segmentation fault So where is this segfault coming from? I have experimented and commented out of the strtod function and just hard coded values for rad (i.e.: rad = (double) i;) and it runs without a segfault. Am I doing something wrong with the strtod call? What say the experts? -- David C. Rankin, J.D.,P.E. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On Wed, 02 Nov 2011 13:33:27 -0500, David C. Rankin wrote:
So where is this segfault coming from?
I'd compile with debug info and load it up in gdb to see what's happening. My instinct is that the issue has to do with how you're addressing p - you may well be using an incorrect redirection. If memory serves, when you declare a pointer: char *p; When you want to reference that address, you just reference it as 'p', not as '&p' - the latter is the address of the address of p, not the address of p. But it's been a while since I did anything with pointers in C. Jim -- Jim Henderson Please keep on-topic replies on the list so everyone benefits -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 11/2/2011 11:33 AM, David C. Rankin wrote:
Guys,
Helping my son with a simple little area program, I am running into a segmentation fault after program execution.
David: I have a little mail pop-up running for this list. It shows the subject of the new message. When "Segmentation fault on 11.4" appeared I nearly fell off the chair. I'll have a portable defibrillator installed in my office tomorrow. -- _____________________________________ ---This space for rent--- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 02/11/11 15:33, David C. Rankin wrote:
So where is this segfault coming from?
gdb --args ./a.out 1 2 3 4 Program received signal SIGSEGV, Segmentation fault. 0x00007ffff7a88b03 in ____strtod_l_internal () from /lib64/libc.so.6 (gdb) bt full #0 0x00007ffff7a88b03 in ____strtod_l_internal () from /lib64/libc.so.6 No symbol table info available. #1 0x00000000004006d1 in main (argc=5, argv=0x7fffffffda78) at dcr.c:19 p = 0x7fffffffdf72 "" i = 5 rad = 4 area = 50.26548245743669 (gdb) frame 1 #1 0x00000000004006d1 in main (argc=5, argv=0x7fffffffda78) at dcr.c:19 19 rad = strtod(argv[i],&p); (gdb) p argv[i] $1 = 0x0 --> that's why ! argv[argc] is a null pointer! bug is for (i=1;i<= argc;i++) { ^^ should be < argc -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 02/11/11 16:11, Cristian Rodríguez wrote:
On 02/11/11 15:33, David C. Rankin wrote:
So where is this segfault coming from?
It would be easy to spot at compile time if GCC did something meaningful http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17308 , but as we all know, it is made to make the programmer's life miserable. it should tell you: warning: null argument where non-null required (argument 1) because the prototypes of strtod() clearly says that argument 1 should be non-null... -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 11/02/2011 02:11 PM, Cristian Rodríguez wrote:
On 02/11/11 15:33, David C. Rankin wrote:
So where is this segfault coming from?
gdb --args ./a.out 1 2 3 4
Program received signal SIGSEGV, Segmentation fault. 0x00007ffff7a88b03 in ____strtod_l_internal () from /lib64/libc.so.6 (gdb) bt full #0 0x00007ffff7a88b03 in ____strtod_l_internal () from /lib64/libc.so.6 No symbol table info available. #1 0x00000000004006d1 in main (argc=5, argv=0x7fffffffda78) at dcr.c:19 p = 0x7fffffffdf72 "" i = 5 rad = 4 area = 50.26548245743669 (gdb) frame 1 #1 0x00000000004006d1 in main (argc=5, argv=0x7fffffffda78) at dcr.c:19 19 rad = strtod(argv[i],&p); (gdb) p argv[i] $1 = 0x0 --> that's why ! argv[argc] is a null pointer!
bug is
for (i=1;i<= argc;i++) { ^^ should be< argc
Thank you Christian! I would have looked at this for days and not caught the '<=' issue. Aye, yie, yie, what possessed me to do that is beyond me, but I can assure you that once I did it, it would have taken an act of congress to make me see the error in my ways! Thanks again! 18:46 alchemy:~/dev/prg/ccpp/src-c/misc> gcc -Wall ztst.c -o ztst 18:46 alchemy:~/dev/prg/ccpp/src-c/misc> ./ztst 2 4 6 8 10 rad : 2.00 area : 12.5664 rad : 4.00 area : 50.2655 rad : 6.00 area : 113.0973 rad : 8.00 area : 201.0619 rad : 10.00 area : 314.1593 -- David C. Rankin, J.D.,P.E. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
The real issue here is that C uses zero-base-index arrays Yes there were 5 arguments in the example argv[0] is the name of the program and argv[1..4] were the parameters. That is why you count from 1 .. argc-1 as opposed to 0 .. argc. The zero-base-index arrays of C have caught many people out. -- Man's mind once stretched by a new idea, never regains its original dimension. -- Oliver Wendell Holmes. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 02/11/11 20:49, David C. Rankin wrote:
Thank you Christian! I would have looked at this for days and not caught the '<=' issue.
Well deserved then :-D , unless you are doing this as a learning experience or plan to roll such code in an intensive math computing environment, you are picking the wrong language. python or ruby will do the trick just fine. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On Wed, 2011-11-02 at 21:34 -0300, Cristian Rodríguez wrote:
On 02/11/11 20:49, David C. Rankin wrote:
Thank you Christian! I would have looked at this for days and not caught the '<=' issue.
Well deserved then :-D , unless you are doing this as a learning experience or plan to roll such code in an intensive math computing environment, you are picking the wrong language. python or ruby will do the trick just fine.
C is never the wrong language. It is the tasks that are wrong :) ;) Add Tcl to the list of alternatives. Yours sincerely, Roger Oberholtzer OPQ Systems / Ramböll RST Office: Int +46 10-615 60 20 Mobile: Int +46 70-815 1696 roger.oberholtzer@ramboll.se ________________________________________ Ramböll Sverige AB Krukmakargatan 21 P.O. Box 17009 SE-104 62 Stockholm, Sweden www.rambollrst.se -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Roger Oberholtzer said the following on 11/03/2011 04:58 AM:
On Wed, 2011-11-02 at 21:34 -0300, Cristian Rodríguez wrote:
On 02/11/11 20:49, David C. Rankin wrote:
Thank you Christian! I would have looked at this for days and not caught the '<=' issue.
Well deserved then :-D , unless you are doing this as a learning experience or plan to roll such code in an intensive math computing environment, you are picking the wrong language. python or ruby will do the trick just fine.
C is never the wrong language. It is the tasks that are wrong :) ;)
Add Tcl to the list of alternatives.
And shell. The bash shell is an incredibly powerful programming language and very easy to debug. It used to be, in Bourne-days, that large shell programs were unwieldy and slow. I found that I'd have to turn to perl to get performance. Not now. These days I see perl as being unwieldy for most of what I have to deal with. Unless Its GUI-fied (yes, Tcl wins!) then the more complex things need Ruby. It just seems to make complexity vanish. Despite all that's said the Object extensions to Perl (5) are a kludge. Ocaml? One day ... -- Auditing security is complex, challenging, and not for the uninformed Avoiding IS Icebergs http://infosecuritymag.techtarget.com/articles/october00/features3.shtml -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On Thu, 2011-11-03 at 07:24 -0400, Anton Aylward wrote:
Ocaml? One day ...
My next goal in this area is python + Qt. See if it displaces my use of Tcl/Tk. Unless I get crazy and try TkQt, which loads Qt interfaces into Tcl/Tk... Too many languages. Too little time... Yours sincerely, Roger Oberholtzer OPQ Systems / Ramböll RST Office: Int +46 10-615 60 20 Mobile: Int +46 70-815 1696 roger.oberholtzer@ramboll.se ________________________________________ Ramböll Sverige AB Krukmakargatan 21 P.O. Box 17009 SE-104 62 Stockholm, Sweden www.rambollrst.se -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 11/03/2011 06:24 AM, Anton Aylward wrote:
Roger Oberholtzer said the following on 11/03/2011 04:58 AM:
On Wed, 2011-11-02 at 21:34 -0300, Cristian Rodríguez wrote:
On 02/11/11 20:49, David C. Rankin wrote:
Thank you Christian! I would have looked at this for days and not caught the '<=' issue.
Well deserved then :-D , unless you are doing this as a learning experience or plan to roll such code in an intensive math computing environment, you are picking the wrong language. python or ruby will do the trick just fine.
C is never the wrong language. It is the tasks that are wrong :) ;)
Add Tcl to the list of alternatives.
And shell. The bash shell is an incredibly powerful programming language and very easy to debug.
<snip> I actually did the little area calc in bash first :) for i in 5 7 4 16 9 15 11 13 12; do \ printf "r: %2s area: %7.3f\n" $i $(calc "3.1459265358*$i*$i") \ done I agree, C is never the wrong language. The reason for the choice was I want my son to have exposure to it and learn the fundamentals before he gets corrupted by whatever the latest trendy flavor of language is they teach in school now. C can do it all, but sometimes it is just takes a bit more effort. Forget the polymorphism and multi-inheritance for now, well structured basic C will more than do anything you need to do and with the flexibility to encapsulate assembler and with tools ranging from X libraries to mysql connector, there really is no language quite as structured or flexible. It's a big step up from the F77 I cut my teeth on :) -- David C. Rankin, J.D.,P.E. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On Thursday 03 November 2011 07:57:42 David C. Rankin wrote:
Forget the polymorphism and multi-inheritance for now,
You might want to forget it, but it is of course possible to do this in C as well (trivial proof of concept: almost all compilers for languages with these features are written in C - by the same token, it is possible to do it in assembly :) Anders -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 11/03/2011 07:57 AM, David C. Rankin wrote:
On 11/03/2011 06:24 AM, Anton Aylward wrote:
Roger Oberholtzer said the following on 11/03/2011 04:58 AM:
On Wed, 2011-11-02 at 21:34 -0300, Cristian Rodríguez wrote:
On 02/11/11 20:49, David C. Rankin wrote:
Thank you Christian! I would have looked at this for days and not caught the '<=' issue.
Well deserved then :-D , unless you are doing this as a learning experience or plan to roll such code in an intensive math computing environment, you are picking the wrong language. python or ruby will do the trick just fine.
C is never the wrong language. It is the tasks that are wrong :) ;)
Add Tcl to the list of alternatives.
And shell. The bash shell is an incredibly powerful programming language and very easy to debug.
<snip>
I actually did the little area calc in bash first :)
for i in 5 7 4 16 9 15 11 13 12; do \ printf "r: %2s area: %7.3f\n" $i $(calc "3.1459265358*$i*$i") \ done
The full script, with input checking would look like this: #!/bin/bash for i in $@; do [ $i -eq $i ] &>/dev/null || continue printf "r: %2s area: %7.3f\n" $i $(calc "3.14592638*$i*$i") done exit 0 Save as area.sh, then sh area.sh 1 2 3 dog 4 5 r: 1 area: 3.146 r: 2 area: 12.584 r: 3 area: 28.313 r: 4 area: 50.335 r: 5 area: 78.648 Oh, don't forget to install 'calc' first: http://www.isthe.com/chongo/tech/comp/calc/ tar -xjf calc-2.12.4.4.tar.bz2 cd calc-2.12.4.4 make all sudo make install or see: http://sourceforge.net/projects/calc/files/calc/2.12.4.3/ There are src.rpms there, but they don't build on 11.4 and I haven't taken time to debug. Job left to the interested reader :) -- David C. Rankin, J.D.,P.E. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 11/03/2011 08:20 AM, David C. Rankin wrote:
Oh, don't forget to install 'calc' first:
http://www.isthe.com/chongo/tech/comp/calc/
tar -xjf calc-2.12.4.4.tar.bz2 cd calc-2.12.4.4 make all sudo make install
or see:
http://sourceforge.net/projects/calc/files/calc/2.12.4.3/
There are src.rpms there, but they don't build on 11.4 and I haven't taken time to debug. Job left to the interested reader :)
Oops, latest sources here: http://www.isthe.com/chongo/src/calc/ -- David C. Rankin, J.D.,P.E. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On Thu, Nov 3, 2011 at 9:20 AM, David C. Rankin <drankinatty@suddenlinkmail.com> wrote:
On 11/03/2011 07:57 AM, David C. Rankin wrote: <snip> Oh, don't forget to install 'calc' first:
http://www.isthe.com/chongo/tech/comp/calc/
tar -xjf calc-2.12.4.4.tar.bz2 cd calc-2.12.4.4 make all sudo make install
or see:
http://sourceforge.net/projects/calc/files/calc/2.12.4.3/
There are src.rpms there, but they don't build on 11.4 and I haven't taken time to debug. Job left to the interested reader :)
Sounds like a perfect job for a budding contributor. If anyone is interested it is just: Build that in your home OBS project. Test it. Submit it to a devel project. Test it. Submit it to factory.. It goes into the next release. It's too late for 12.1, but 12.2 will be in another 8 months. Greg -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On Thu, 3 Nov 2011 09:48:10 -0400 Greg Freemyer <greg.freemyer@gmail.com> wrote:
On Thu, Nov 3, 2011 at 9:20 AM, David C. Rankin <drankinatty@suddenlinkmail.com> wrote:
On 11/03/2011 07:57 AM, David C. Rankin wrote: <snip> Oh, don't forget to install 'calc' first:
http://www.isthe.com/chongo/tech/comp/calc/
tar -xjf calc-2.12.4.4.tar.bz2 cd calc-2.12.4.4 make all sudo make install
or see:
http://sourceforge.net/projects/calc/files/calc/2.12.4.3/
There are src.rpms there, but they don't build on 11.4 and I haven't taken time to debug. Job left to the interested reader :)
Sounds like a perfect job for a budding contributor.
If anyone is interested it is just: Build that in your home OBS project. Test it. Submit it to a devel project. Test it. Submit it to factory..
It goes into the next release. It's too late for 12.1, but 12.2 will be in another 8 months.
Greg Hi There is a user with it already... https://build.opensuse.org/project/packages?project=home%3Amichal-m
-- Cheers Malcolm °¿° (Linux Counter #276890) openSUSE 11.4 (x86_64) Kernel 2.6.37.6-0.7-desktop up 3 days 1:26, 6 users, load average: 0.27, 0.32, 0.22 GPU GeForce 8600 GTS Silent - Driver Version: 285.05.09 -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On Thu, Nov 3, 2011 at 10:22 AM, Malcolm <malcolm_lewis@bellsouth.net> wrote:
On Thu, 3 Nov 2011 09:48:10 -0400 Greg Freemyer <greg.freemyer@gmail.com> wrote:
On Thu, Nov 3, 2011 at 9:20 AM, David C. Rankin <drankinatty@suddenlinkmail.com> wrote:
On 11/03/2011 07:57 AM, David C. Rankin wrote: <snip> Oh, don't forget to install 'calc' first:
http://www.isthe.com/chongo/tech/comp/calc/
tar -xjf calc-2.12.4.4.tar.bz2 cd calc-2.12.4.4 make all sudo make install
or see:
http://sourceforge.net/projects/calc/files/calc/2.12.4.3/
There are src.rpms there, but they don't build on 11.4 and I haven't taken time to debug. Job left to the interested reader :)
Sounds like a perfect job for a budding contributor.
If anyone is interested it is just: Build that in your home OBS project. Test it. Submit it to a devel project. Test it. Submit it to factory..
It goes into the next release. It's too late for 12.1, but 12.2 will be in another 8 months.
Greg Hi There is a user with it already... https://build.opensuse.org/project/packages?project=home%3Amichal-m
The specfile looks nicely done. (In general getting the specfile in good shape is the hardest part of packaging a utility for openSUSE formal submissions.) https://build.opensuse.org/package/view_file?file=calc.spec&package=calc&project=home%3Amichal-m&srcmd5=ec9ad07630f88d98e960a1ec300ac0d9 So all the budding contributor has to do is branch that package to their own OBS home project. Build it against factory (should happen automatically.) and whatever release they are running. (Likely will need to use the WebUI to add that repo.) Enable publishing for the build they want to test (via the WebUI). It should then show up in the test search at: http://software.opensuse.org/search?q=calc&baseproject=openSUSE%3AFactory&lang=en&include_home=true&exclude_debug=true Once you find it, install it and test it. Assuming it works submit to an appropriate devel project. Once accepted install from that repo, then submit it on to factory for inclusion in 12.2 and beyond. Greg -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Hello, On Thu, 03 Nov 2011, Greg Freemyer wrote:
On Thu, Nov 3, 2011 at 10:22 AM, Malcolm <malcolm_lewis@bellsouth.net> wrote:
On Thu, 3 Nov 2011 09:48:10 -0400 Greg Freemyer <greg.freemyer@gmail.com> wrote:
On Thu, Nov 3, 2011 at 9:20 AM, David C. Rankin <drankinatty@suddenlinkmail.com> wrote:
On 11/03/2011 07:57 AM, David C. Rankin wrote: <snip> Oh, don't forget to install 'calc' first:
http://www.isthe.com/chongo/tech/comp/calc/
tar -xjf calc-2.12.4.4.tar.bz2 [..] There is a user with it already... https://build.opensuse.org/project/packages?project=home%3Amichal-m
Someone, probably David C. R. here recently asked for that. Thus: http://download.opensuse.org/repositories/home:/dnh/openSUSE_11.4/x86_64/cal... HTH, -dnh -- Indifference will be the downfall of mankind, but who cares? -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 11/03/2011 12:02 PM, David Haller wrote:
Hello,
On Thu, 03 Nov 2011, Greg Freemyer wrote:
On Thu, Nov 3, 2011 at 10:22 AM, Malcolm<malcolm_lewis@bellsouth.net> wrote:
On Thu, 3 Nov 2011 09:48:10 -0400 Greg Freemyer<greg.freemyer@gmail.com> wrote:
On Thu, Nov 3, 2011 at 9:20 AM, David C. Rankin <drankinatty@suddenlinkmail.com> wrote:
On 11/03/2011 07:57 AM, David C. Rankin wrote: <snip> Oh, don't forget to install 'calc' first:
http://www.isthe.com/chongo/tech/comp/calc/
tar -xjf calc-2.12.4.4.tar.bz2 [..] There is a user with it already... https://build.opensuse.org/project/packages?project=home%3Amichal-m
Someone, probably David C. R. here recently asked for that. Thus:
http://download.opensuse.org/repositories/home:/dnh/openSUSE_11.4/x86_64/cal...
HTH, -dnh
Thanks dnh, I don't know why http://software.opensuse.org/search doesn't return it on a search for 'calc'. Damn I miss a working 'webpin'. The indexing that is done now on the available packages just down right 'suc..' (doesn't work well). I scrolled though 8 pages of junk and still didn't get any useful information. Superb Job! 21:41 alchemy:~/suse/114/srpm> http://download.opensuse.org/repositories/home:/dnh/openSUSE_11.4/src/calc-2... 21:41 alchemy:~/suse/114/srpm> rpmbuild --rebuild calc-2.12.4.4-3.1.src.rpm Installing calc-2.12.4.4-3.1.src.rpm warning: InstallSourcePackage at: psm.c:244: Header V3 DSA/SHA1 Signature, key ID ce4c0d2f: NOKEY Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.Ah0Wz5 + umask 022 + cd /usr/src/packages/BUILD <snip> Wrote: /usr/src/packages/RPMS/x86_64/calc-2.12.4.4-3.1.x86_64.rpm Wrote: /usr/src/packages/RPMS/x86_64/calc-devel-2.12.4.4-3.1.x86_64.rpm Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.Rj7gsH + umask 022 + cd /usr/src/packages/BUILD + cd calc-2.12.4.4 + rm -rf /usr/src/packages/BUILDROOT/calc-2.12.4.4-3.1.x86_64 + rm -rf filelists Executing(--clean): /bin/sh -e /var/tmp/rpm-tmp.kaYdPu + umask 022 + cd /usr/src/packages/BUILD + rm -rf calc-2.12.4.4 + rm -rf filelists -- David C. Rankin, J.D.,P.E. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On Thu, Nov 3, 2011 at 10:52 PM, David C. Rankin <drankinatty@suddenlinkmail.com> wrote:
Thanks dnh, I don't know why http://software.opensuse.org/search doesn't return it on a search for 'calc'. Damn I miss a working 'webpin'. The indexing that is done now on the available packages just down right 'suc..' (doesn't work well). I scrolled though 8 pages of junk and still didn't get any useful information.
I find the search in the upper right corner of build.opensuse.org to be my favorite place to see if anyone has a package hidden away. OBS is the crown jewel of opensuse in my mind, so it is worth figuring out how to leverage it. I will use search.opensuse.com as well, but it does have it's issues. Greg -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Hello, On Thu, 03 Nov 2011, David C. Rankin wrote:
On 11/03/2011 12:02 PM, David Haller wrote: [calc package]
Someone, probably David C. R. here recently asked for that. Thus:
http://download.opensuse.org/repositories/home:/dnh/openSUSE_11.4/x86_64/cal...
Thanks dnh, I don't know why http://software.opensuse.org/search doesn't return it on a search for 'calc'.
Had you enabled to search in "home" repositories?
Damn I miss a working 'webpin'.
Dito.
The indexing that is done now on the available packages just down right 'suc..' (doesn't work well). I scrolled though 8 pages of junk and still didn't get any useful information.
What bugs me more is that there's no way to specify "strict", or "anchored" strings or whatchamaycallem. SQL patterns, regexes, anything! Even a simple 'if in "", it's not a name-substring, only match on ^{STRING}-*' would be a great step forward. E.g. to search only for a package named "calc". It's especially bad with stuff like basic libs like "gtk" or "qt" or whatever. Or packages with names that are substrings of totally unrelated stuff. Like anything with "ing". That'll flood results with the whole shebang of "*-branding*" and a metric buttload of other "*ing*" packages... Basically, in those cases the search is useless unless you're exceptionally determined (to wade through even 40+ result pages or whatever, one at a tedious time ...). Oh, and the "only 10 results per page" bugs me too. I'd prefer 20, 30, 50, 100, all results per page, as that would enable me to use my browsers text-search facility to find "my" package. But clicking through >200 results at 10 per page is just masochistic. And sadistic by whoever came up with that. IM_definitely_not_HO. Ok, who's bugzilling it?
Superb Job!
Thanksalot :))
21:41 alchemy:~/suse/114/srpm> http://download.opensuse.org/repositories/home:/dnh/openSUSE_11.4/src/calc-2... 21:41 alchemy:~/suse/114/srpm> rpmbuild --rebuild calc-2.12.4.4-3.1.src.rpm Installing calc-2.12.4.4-3.1.src.rpm warning: InstallSourcePackage at: psm.c:244: Header V3 DSA/SHA1 Signature, key ID ce4c0d2f: NOKEY Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.Ah0Wz5 + umask 022 + cd /usr/src/packages/BUILD <snip> Wrote: /usr/src/packages/RPMS/x86_64/calc-2.12.4.4-3.1.x86_64.rpm Wrote: /usr/src/packages/RPMS/x86_64/calc-devel-2.12.4.4-3.1.x86_64.rpm
Ah, well, if I publish a package in my repo (not the :testing though), you can expect a clean build, if not: bug me (via mail or bugzilla) ;) In the over 10 years building rpms for my ex-Suse-6.2 (dubbed "Hallerlix" in '05 or somewhen) I learned a lot of stuff and tricks for a lot of packaging / build system problems and quirks[2]. Which did not remain unnoticed ;) I had other "packaging policies" for my box though[0][1] :) Most of what's in my home:dnh repo is what I use daily here. "calc" is one of the exceptions (I use bc by custom ;) But apart from the a bit quirky "build-system" (read: quirky Makefiles, the dynamic/static stuff etc.) calc itself built well and clean, so I'd continue packaging it. Mail me if I miss an update. @all: Oh, and, as this is my first "calc" package: mail me on opensuse-packaging or via PM if anything crops up and, once you've thoroughly tested it, if you want me to push "calc" to a devel-project to push it to Factory, for whatever "next" release. -dnh P.S: random sig! Need I be afraid of my sigmonster? [0] the box and "Hallerlix" were retired as of, ah, this May 19 and replaced by a new one with a 11.2->11.4 update. But I've already got quite a few self-built packages already (only a couple in my repo). [1] e.g. I liked to package everything (lib, -devel, -doc and even additional documentation) into a single rpm ;) And today, I still like to package programs/lib-devel and documentation together. I think there's a Gimp-RPM somewhere on one of my disks that includes the GUM ;) And a WindowMaker RPM including the Manual and the Userguide. Apropos WindowMaker: Yay! Windowmaker.{org,info} is back online with the documentation. Finally :))) [2] which is why I "hate" some of them. Ah. Most. Ah. All. But there's one that, surprisingly, andagainst all odds, sucks much much less than the others, at least from a packagers view. And that's autotools/-make. Yes. It sucks! Massively! But I've yet to see anything sucking less and esp. even remotely as packager friendly. *me looks sharply at e.g. qmake, cmake, bjam, scons here* Hell, "imake" is more packager friendly than those newfangled "build-systems". -- Contrary to popular belief, Unix is user friendly. It just happens to be very selective about who its friends are. -- Kyle Hearn -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On Thu, Nov 3, 2011 at 1:02 PM, David Haller <dnh@opensuse.org> wrote:
Someone, probably David C. R. here recently asked for that. Thus:
http://download.opensuse.org/repositories/home:/dnh/openSUSE_11.4/x86_64/cal...
HTH, -dnh
David, Are you (or anyone else) planning to push calc to a devel project and then to factory. Seems like a nice tool but I'm trying to stick to packages I can push via security. It gets to be a pain when I have packages I want to work together spread around various devel projects. Greg -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Hello, On Thu, 03 Nov 2011, Greg Freemyer wrote:
Someone, probably David C. R. here recently asked for that. Thus:
http://download.opensuse.org/repositories/home:/dnh/openSUSE_11.4/x86_64/cal... [..] Are you (or anyone else) planning to push calc to a devel project and
On Thu, Nov 3, 2011 at 1:02 PM, David Haller <dnh@opensuse.org> wrote: then to factory.
Seems like a nice tool but I'm trying to stick to packages I can push via security. It gets to be a pain when I have packages I want to work together spread around various devel projects.
'Twas an ad-hoc package, so, I need feedback! calc seems mature and builds cleanly, so I see no reason why not to push it towards Factory. As an aside, I don't have the need, as I use bc, but I'm always up for packaging a mature program which just suits someone better. I'd be willing to "maintain" the package except for looking for new releases / bugfix releases[1]. I just don't have the time to look. So, if you are willing to notify me of new releases / security related problems / patches etc., I'd be willing. Oh, I also am willing to share the duty and make you and dcr maintainers, and coach you along if it's not a simple version update of e.g. "make '.4' a '.5'" in one single place in the .spec ;) You'd be surprised how much simple, tedious work is needed to keep a package "up-to-date" once you have a working .spec. I'd say (with exceptions): >>95% is to keep an eye out for security/bug-issues or feature releases, both of which you can usually just "drop in" by simply changing the "version" in the .spec and maybe adapt some filename or so (but that should be a marco e.g. the soname of a lib). Or add the patch. Trouble is, when the "how to build" of a package changes. It's not often. But when you grab a new package or a package changes the build system, or the architecture of stuff, that's when there's major work on a .spec needed. -dnh [1] well, I might, at random -- Sir, I think you have a problem with your brain being missing. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 11/04/2011 12:38 AM, David Haller wrote:
'Twas an ad-hoc package, so, I need feedback! calc seems mature and builds cleanly, so I see no reason why not to push it towards Factory.
As an aside, I don't have the need, as I use bc, but I'm always up for packaging a mature program which just suits someone better.
I'd be willing to "maintain" the package except for looking for new releases / bugfix releases[1]. I just don't have the time to look. So, if you are willing to notify me of new releases / security related problems / patches etc., I'd be willing.
Oh, I also am willing to share the duty and make you and dcr maintainers, and coach you along if it's not a simple version update of e.g. "make '.4' a '.5'" in one single place in the .spec ;)
You're on... The package is mature and the updating should be minimal, but I know how 'tedious' maintaining packages can be. I have a couple for Arch and when gcc changes an breaks everything, even simple packages that should have 'minimal' update needs can become huge pains for the short period of time it takes to figure out what broke. But with calc, even with potential gcc changes, it won't be near as bad or likely to break as other packages. I have an OBS page that I haven't visited in some time... If you have it building in yours, then I guess we can push it from there. I've never pushed a package to factory before, but Greg's howto earlier in this thread seems to lay it out very well. I've looked at the .spec file and it looks great. I don't see anything off-hand that needs changing, I think we can just do whatever is needed to push it to factory as is. The only thing I don't know is if: Group: Productivity/Scientific/Math is the correct Group, but it looks like where it should be. dnh, I'm 'drankinatty' on OBS, I just checked and I still have a good login there. So in the future, if needed, you can just associate me with the calc project.. although I'm not sure how you do that :) -- David C. Rankin, J.D.,P.E. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 04/11/11 10:35, David C. Rankin wrote:
The only thing I don't know is if:
Group: Productivity/Scientific/Math
is the correct Group, but it looks like where it should be.
RPM groups are deprecated and will probably disappear from all packages automatically in the very near future. We agreed to remove them during the openSUSE conference in Sept. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Hello, On Fri, 04 Nov 2011, David C. Rankin wrote:
You're on... The package is mature and the updating should be minimal, but I know how 'tedious' maintaining packages can be. I have a couple for Arch and when gcc changes an breaks everything, even simple packages that should have 'minimal' update needs can become huge pains for the short period of time it takes to figure out what broke. But with calc, even with potential gcc changes, it won't be near as bad or likely to break as other packages.
Aye :)
I have an OBS page that I haven't visited in some time... If you have it building in yours, then I guess we can push it from there. I've never pushed a package to factory before, but Greg's howto earlier in this thread seems to lay it out very well. I've looked at the .spec file and it looks great. I don't see anything off-hand that needs changing, I think we can just do whatever is needed to push it to factory as is.
Neither have I and yes. I'll have a look tomorrow.
The only thing I don't know is if:
Group: Productivity/Scientific/Math
is the correct Group, but it looks like where it should be.
Well, bc and dc (it's in the bc package), gcalctool, kcalc, pgcalc are in the same group, so it seems the best one (as long as one adds one). BTW: I like to use RPM groups in yast when looking for stuff. Much more than the patterns or anything. I'd prefer to keep them.
dnh, I'm 'drankinatty' on OBS, I just checked and I still have a good login there. So in the future, if needed, you can just associate me with the calc project.. although I'm not sure how you do that :)
I've added you as maintainer for the calc package. -dnh -- If the bit is set to 1, the packet has evil intent. Secure systems SHOULD try to defend themselves against such packets. Insecure systems MAY chose to crash, be penetrated, etc. -- RfC 3514 -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
* David C. Rankin <drankinatty@suddenlinkmail.com> [11-03-11 09:23]: ....
Oh, don't forget to install 'calc' first:
http://www.isthe.com/chongo/tech/comp/calc/
tar -xjf calc-2.12.4.4.tar.bz2 cd calc-2.12.4.4 make all sudo make install
or see:
http://sourceforge.net/projects/calc/files/calc/2.12.4.3/
There are src.rpms there, but they don't build on 11.4 and I haven't taken time to debug. Job left to the interested reader :)
http://download.opensuse.org/repositories/home:/dnh/ many build available, SLE_10, SLE_11, 11.3,11.4, factory, tumbleweed.... -- (paka)Patrick Shanahan Plainfield, Indiana, USA HOG # US1244711 http://wahoo.no-ip.org Photo Album: http://wahoo.no-ip.org/gallery2 http://en.opensuse.org openSUSE Community Member Registered Linux User #207535 @ http://linuxcounter.net -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
* David C. Rankin <drankinatty@suddenlinkmail.com> [11-03-11 09:23]: ....
Oh, don't forget to install 'calc' first:
http://www.isthe.com/chongo/tech/comp/calc/
tar -xjf calc-2.12.4.4.tar.bz2 cd calc-2.12.4.4 make all sudo make install
or see:
There are also mathomatic builds available that will suffice. Mathomatic is a free, portable, general-purpose Computer Algebra System (CAS) that can automatically solve, differentiate, simplify, combine, and compare algebraic equations, perform standard, complex number, modular, and polynomial arithmetic, etc. It does some calculus and is very easy to learn and use. Plotting expressions with gnuplot is also supported. This package is complete, including Mathomatic, the Prime Number Tools, m4 Mathomatic, and all documentation. -- (paka)Patrick Shanahan Plainfield, Indiana, USA HOG # US1244711 http://wahoo.no-ip.org Photo Album: http://wahoo.no-ip.org/gallery2 http://en.opensuse.org openSUSE Community Member Registered Linux User #207535 @ http://linuxcounter.net -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Hello, On Thu, 03 Nov 2011, Patrick Shanahan wrote:
There are also mathomatic builds available that will suffice.
And bc. ### 4*a(1) = pi, libm (bc -l) is needed for the a() function. for i in 5 7 4 16 ; do printf "r: %2s area: %7.3f\n" $i $(echo "$i^2 * 4*a(1);" | bc -l) done and perl: perl -w -e ' use strict; use Math::Trig qw(:pi); for( 5, 7, 4, 16 ) { printf("r: %2s area: %7.3f\n", $_, pi * $_ ** 2); }' or the full version: ==== area.pl ==== #!/usr/bin/perl use warnings; use strict; use Math::Trig qw(:pi); foreach(@ARGV) { next unless /^-?\d+\.?\d*$/; printf("r: %2s area: %7.3f\n", $_, pi * $_ ** 2); } ==== $ perl area.pl 1 2 3 dog 4 5 GNU awk: ==== area.awk #!/usr/bin/gawk -f BEGIN { pi = 4 * atan2(1,1); for( a = 0; a < ARGC; a++ ) { if( i = strtonum(ARGV[a]) ) { printf("r: %2s area: %7.3f\n", i, i^2 * pi); } } } ==== perl area.awk 1 2 3 dog 4 5 and then there's: for i in 1 2 3 dog 4 5 7 16; do units "pi $i^2"; done or for i in 1 2 3 dog 4 5 7 16; do units "circlearea(${i} m)"; done HTH, -dnh -- Every fleeting thought you've ever had in your life, no matter how bizarre, is someone's lifelong obsession. And he has a website. -- Skif's Internet Theorem -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On Thursday, November 03, 2011 08:20:47 David C. Rankin wrote:
Oh, don't forget to install 'calc' first:
tar -xjf calc-2.12.4.4.tar.bz2 cd calc-2.12.4.4 make all sudo make install
david-- calc is awesome -- thank you for leading me to it! sc -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 11/3/2011 5:57 AM, David C. Rankin wrote:
The reason for the choice was I want my son to have exposure to it and learn the fundamentals before he gets corrupted by whatever the latest trendy flavor of language is they teach in school now.
Good Idea, because once they are exposed to visual basic they can't be taught to program. -- _____________________________________ ---This space for rent--- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Thursday, 2011-11-03 at 07:57 -0500, David C. Rankin wrote:
I agree, C is never the wrong language.
I don't. >:-) - -- Cheers, Carlos E. R. (from 11.4 x86_64 "Celadon" at Telcontar) -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (GNU/Linux) iEYEARECAAYFAk6yyPQACgkQtTMYHG2NR9V+mACeNtcH9KELhtp6phXEXPyR1RDW AZMAnj5M/P374m/DdPmD3iVohO1kDTD0 =tXmi -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
participants (14)
-
Anders Johansson
-
Anton Aylward
-
Carlos E. R.
-
Cristian Rodríguez
-
David C. Rankin
-
David Haller
-
Greg Freemyer
-
Jim Henderson
-
John Andersen
-
Malcolm
-
Martin Helm
-
Patrick Shanahan
-
Roger Oberholtzer
-
sc