Re: [osol-discuss] C programming, invalid argc value

2010-10-06 Thread George Vasick
On 10/5/2010 11:04 AM, Jürgen Keil wrote: I can reproduce the problem on my system running bash so I don't think it is related the the shell: (gdb) b main Breakpoint 1 at 0x8050ccc: file g.c, line 4. (gdb) r Starting program: /home/gvasick/a.out Breakpoint 1, main (argc=260904,

Re: [osol-discuss] C programming, invalid argc value

2010-10-06 Thread Jürgen Keil
I retested with gcc 3.4.3 and everything works fine. Using the 4.3.3 compiler, the breakpoint is being set right at the address of main before the prologue code is executed. I will need to investigate why that is happening. Hmm... On opensolaris b134, after pkg install gcc-43, and

Re: [osol-discuss] C programming, invalid argc value

2010-10-05 Thread Brian Ruthven - Solaris Network Sustaining - Oracle UK
Scott Rotondo wrote: On 10/ 4/10 10:45 AM, George Vasick wrote: Hi Alan, I can reproduce the problem on my system running bash so I don't think it is related the the shell: (gdb) b main Breakpoint 1 at 0x8050ccc: file g.c, line 4. (gdb) r Starting program: /home/gvasick/a.out Breakpoint 1,

Re: [osol-discuss] C programming, invalid argc value

2010-10-05 Thread Jürgen Keil
I can reproduce the problem on my system running bash so I don't think it is related the the shell: (gdb) b main Breakpoint 1 at 0x8050ccc: file g.c, line 4. (gdb) r Starting program: /home/gvasick/a.out Breakpoint 1, main (argc=260904, argv=0xfef90018) at g.c:4 Which compiler,

Re: [osol-discuss] C programming, invalid argc value

2010-10-05 Thread Scott Rotondo
On 10/ 5/10 11:04 AM, Jürgen Keil wrote: I can reproduce the problem on my system running bash so I don't think it is related the the shell: (gdb) b main Breakpoint 1 at 0x8050ccc: file g.c, line 4. (gdb) r Starting program: /home/gvasick/a.out Breakpoint 1, main (argc=260904, argv=0xfef90018)

Re: [osol-discuss] C programming, invalid argc value

2010-10-05 Thread John Martin
On 10/ 5/10 02:04 PM, Jürgen Keil wrote: Which compiler, compiler version, gdb version did you use? What compilation flags? What does the test program look like? Using Opensolaris b134, gcc 3.4.3, gdb 6.8, a simple hello, world type test program, and compilation options -g -O it works for me.

Re: [osol-discuss] C programming, invalid argc value

2010-10-04 Thread George Vasick
Hi Alan, I can reproduce the problem on my system running bash so I don't think it is related the the shell: (gdb) b main Breakpoint 1 at 0x8050ccc: file g.c, line 4. (gdb) r Starting program: /home/gvasick/a.out Breakpoint 1, main (argc=260904, argv=0xfef90018) at g.c:4 4 { I also

Re: [osol-discuss] C programming, invalid argc value

2010-10-04 Thread Alan Burlison
On 04/10/2010 18:45, George Vasick wrote: I can reproduce the problem on my system running bash so I don't think it is related the the shell: OK, was just wondering if it might be related to http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=6974936 -- Alan Burlison --

Re: [osol-discuss] C programming, invalid argc value

2010-10-04 Thread Scott Rotondo
On 10/ 4/10 10:45 AM, George Vasick wrote: Hi Alan, I can reproduce the problem on my system running bash so I don't think it is related the the shell: (gdb) b main Breakpoint 1 at 0x8050ccc: file g.c, line 4. (gdb) r Starting program: /home/gvasick/a.out Breakpoint 1, main (argc=260904,

Re: [osol-discuss] C programming, invalid argc value

2010-10-01 Thread Alan Burlison
On 01/10/2010 03:17, Saadia Fatima wrote: Invalid argc value is passed to main, when I run the program with no cmmand line arguments main(argc = 134551360, argv=0x8047b2a) // from gdb How to fix this?? Which shell are you using? -- Alan Burlison --

Re: [osol-discuss] C programming, invalid argc value

2010-10-01 Thread Joerg Schilling
Richard L. Hamilton rlha...@smart.net wrote: Maybe something strange with gdb, or with the compiler? A bug in gdb could be verified by checking with mdb or pstack. Jörg -- EMail:jo...@schily.isdn.cs.tu-berlin.de (home) Jörg Schilling D-13353 Berlin j...@cs.tu-berlin.de

[osol-discuss] C programming, invalid argc value

2010-09-30 Thread Saadia Fatima
Hi, Invalid argc value is passed to main, when I run the program with no cmmand line arguments main(argc = 134551360, argv=0x8047b2a) // from gdb How to fix this?? -Thanks SF -- This message posted from opensolaris.org ___ opensolaris-discuss

Re: [osol-discuss] C programming, invalid argc value

2010-09-30 Thread Richard L. Hamilton
Maybe something strange with gdb, or with the compiler? By convention, there is always supposed to be at least one argument, argv[0], which should be the same as the pathname or the last level of the pathname being executed (login shells typically get the last level of the pathname but prefixed

Re: [osol-discuss] C programming, invalid argc value

2010-09-30 Thread Edward Martinez
Hi, Invalid argc value is passed to main, when I run the program with no cmmand line arguments main(argc = 134551360, argv=0x8047b2a) // from gdb How to fix this?? -Thanks SF not a C guru;-) but i think main needs to be converted from string to an interger, something like this

Re: [osol-discuss] C programming, invalid argc value

2010-09-30 Thread Richard L. Hamilton
And for the curious, after adding a pause() following the printf() in atest.c, so I could use ps to see what a process with no argv[0] looked like: $ ps -o pid,fname -p 15789 PID COMMAND 15789 atest $ ps -o pid,comm -p 15789 PID COMMAND 15789 $ ps -o pid,args -p 15789 PID COMMAND 15789 $